-
Notifications
You must be signed in to change notification settings - Fork 147
/
hpc-amd-slurm-v5-legacy.yaml
231 lines (213 loc) · 7.04 KB
/
hpc-amd-slurm-v5-legacy.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
---
blueprint_name: hpc-amd-slurm
vars:
project_id: ## Set GCP Project ID Here ##
deployment_name: amd-v5
region: us-east4
zone: us-east4-c
deployment_groups:
- group: primary
modules:
- id: network1
source: modules/network/vpc
- id: homefs
source: modules/file-system/filestore
use: [network1]
settings:
local_mount: /home
- id: swfs
source: modules/file-system/filestore
use: [network1]
settings:
local_mount: /sw
- id: spack-setup
source: community/modules/scripts/spack-setup
settings:
install_dir: /sw/spack
spack_ref: v0.18.1
- id: spack-execute
source: community/modules/scripts/spack-execute
use: [spack-setup]
settings:
log_file: /var/log/spack.log
data_files:
- destination: /tmp/projections-config.yaml
content: |
modules:
default:
tcl:
hash_length: 0
all:
conflict:
- '{name}'
projections:
all: '{name}/{version}-{compiler.name}-{compiler.version}'
- destination: /tmp/slurm-external-config.yaml
content: |
packages:
slurm:
externals:
- spec: slurm@22-05-8
prefix: /usr/local
buildable: False
- destination: /sw/spack/openfoam_env.yaml
content: |
spack:
definitions:
- compilers:
- gcc@10.3.0
- mpis:
- openmpi@4.1.3+legacylaunchers+pmi fabrics=none schedulers=slurm
- packages:
- flex@2.6.4
- mpi_packages:
- openfoam-org@8 ^flex@2.6.4 target=zen3
specs:
- matrix:
- - $mpis
- - $%compilers
- matrix:
- - $packages
- - $%compilers
- matrix:
- - $mpi_packages
- - $%compilers
- - $^mpis
concretizer:
unify: when_possible
commands: |
spack config --scope defaults add config:build_stage:/opt/spack_build_stage
spack config --scope defaults add -f /tmp/projections-config.yaml
spack config --scope site add -f /tmp/slurm-external-config.yaml
spack config --scope site add concretizer:targets:host_compatible:false
# gcc 12.1.0 is known to have runtime failures with OpenFOAM 8
# gcc 10.3.0 is the earliest copy of gcc with Zen 3 support
spack install gcc@10.3.0 %gcc@4.8.5 target=x86_64
spack load gcc@10.3.0 %gcc@4.8.5 target=x86_64
spack compiler find --scope site
if ! spack env list | grep -q openfoam; then
spack env create openfoam /sw/spack/openfoam_env.yaml
spack env activate openfoam
spack concretize
spack install
fi
- id: spack-startup
source: modules/scripts/startup-script
settings:
runners:
- $(spack-execute.spack_runner)
- type: shell
destination: shutdown.sh
content: |
#!/bin/bash
if [ ! -f /etc/block_auto_shutdown ]; then
touch /etc/block_auto_shutdown
shutdown -h +1
fi
- id: slurm_startup
source: modules/scripts/startup-script
settings:
runners:
- $(spack-setup.spack_runner)
# the following installation of AOCC may be automated in the future
# with a clear direction to the user to read the EULA at
# https://developer.amd.com/aocc-compiler-eula/
- type: data
destination: /var/tmp/install_aocc.sh
content: |
#!/bin/bash
source /sw/spack/share/spack/setup-env.sh
spack install aocc@3.2.0 +license-agreed
spack load aocc@3.2.0
spack compiler find --scope site
spack -d install -v openmpi@4.1.3 %aocc@3.2.0 +legacylaunchers +pmi schedulers=slurm
- type: data
destination: /var/tmp/openfoam_test.sh
content: |
#!/bin/bash
# the following line works around a problem activating environments
# before directory is accessed
ls -lha /sw/spack/var/spack/environments/openfoam/ &>/dev/null
spack env activate openfoam
DIR=$HOME/openfoam_test
mkdir -p $DIR
cd $DIR
cp -fr $WM_PROJECT_DIR/tutorials/incompressible/simpleFoam/motorBike .
cd motorBike
./Allrun
- id: spack_builder
source: modules/compute/vm-instance
use: [network1, swfs, spack-startup]
settings:
name_prefix: spack-builder
machine_type: c2d-standard-16
disable_public_ips: true
instance_image:
# these images must match the images used by Slurm modules below because
# we are building OpenMPI with PMI support in libraries contained in
# Slurm installation
family: slurm-gcp-5-12-hpc-centos-7
project: schedmd-slurm-public
- id: low_cost_node_group
source: community/modules/compute/schedmd-slurm-gcp-v5-node-group
settings:
machine_type: c2d-standard-4
node_count_dynamic_max: 10
bandwidth_tier: gvnic_enabled
- id: low_cost_partition
source: community/modules/compute/schedmd-slurm-gcp-v5-partition
use:
- network1
- low_cost_node_group
settings:
partition_name: lowcost
enable_placement: false
- id: compute_node_group
source: community/modules/compute/schedmd-slurm-gcp-v5-node-group
settings:
machine_type: c2d-standard-112
node_count_dynamic_max: 50
bandwidth_tier: gvnic_enabled
# because is_default is set to true, jobs will run on this partition unless an
# alternative partition is specified using, for example, "srun -p lowcost"
- id: compute_partition
source: community/modules/compute/schedmd-slurm-gcp-v5-partition
use:
- network1
- compute_node_group
settings:
partition_name: compute
enable_placement: true
is_default: true
- id: slurm_controller
source: community/modules/scheduler/schedmd-slurm-gcp-v5-controller
use:
- network1
- homefs
- swfs
- low_cost_partition
- compute_partition
settings:
machine_type: c2d-standard-4
- id: slurm_login
source: community/modules/scheduler/schedmd-slurm-gcp-v5-login
use:
- network1
- slurm_controller
- slurm_startup
settings:
# need at least 8 physical cores to run OpenFOAM test
machine_type: c2d-standard-16