Skip to content

Commit 032dec9

Browse files
committed
Add Urania machine
Add no-validate flag to scheduler Change name of option Add environment file Clean script Fix validate flag Fix
1 parent 50cffd3 commit 032dec9

File tree

5 files changed

+122
-3
lines changed

5 files changed

+122
-3
lines changed

support/Environments/urania.sh

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
#!/bin/env sh
2+
3+
# Distributed under the MIT License.
4+
# See LICENSE.txt for details.
5+
6+
spectre_load_modules() {
7+
module load gcc/11
8+
module load impi/2021.7
9+
module load boost/1.79
10+
module load gsl/1.16
11+
module load cmake/3.26
12+
module load hdf5-serial/1.12.2
13+
module load anaconda/3/2021.11
14+
module load paraview/5.10
15+
# Load Spack environment
16+
source /u/guilara/repos/spack/share/spack/setup-env.sh
17+
spack env activate env3_spectre_impi
18+
# Load python environment
19+
source /u/guilara/envs/spectre_env/bin/activate
20+
# Define Charm paths
21+
export CHARM_ROOT=/u/guilara/charm_impi_3/mpi-linux-x86_64-smp
22+
export PATH=$PATH:/u/guilara/charm_impi_3/mpi-linux-x86_64-smp/bin
23+
}
24+
25+
spectre_unload_modules() {
26+
module unload gcc/11
27+
module unload impi/2021.7
28+
module unload boost/1.79
29+
module unload gsl/1.16
30+
module unload cmake/3.26
31+
module unload hdf5-serial/1.12.2
32+
module unload anaconda/3/2021.11
33+
module unload paraview/5.10
34+
# Unload Spack environment
35+
spack env deactivate
36+
# Unload python environment
37+
deactivate
38+
}
39+
40+
spectre_run_cmake() {
41+
if [ -z ${SPECTRE_HOME} ]; then
42+
echo "You must set SPECTRE_HOME to the cloned SpECTRE directory"
43+
return 1
44+
fi
45+
spectre_load_modules
46+
47+
cmake -D CMAKE_C_COMPILER=gcc \
48+
-D CMAKE_CXX_COMPILER=g++ \
49+
-D CMAKE_Fortran_COMPILER=gfortran \
50+
-D CHARM_ROOT=$CHARM_ROOT \
51+
-D CMAKE_BUILD_TYPE=Release \
52+
-D DEBUG_SYMBOLS=OFF \
53+
-D BUILD_SHARED_LIBS=ON \
54+
-D MEMORY_ALLOCATOR=JEMALLOC \
55+
-D BUILD_PYTHON_BINDINGS=ON \
56+
-D MACHINE=Urania \
57+
-D SPEC_ROOT=/u/guilara/repos/spec \
58+
-D Catch2_DIR=/u/guilara/repos/Catch2/install_dir/lib64/cmake/Catch2 \
59+
"$@" $SPECTRE_HOME
60+
}

support/Machines/Urania.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Distributed under the MIT License.
2+
# See LICENSE.txt for details.
3+
4+
Machine:
5+
Name: Urania
6+
Description: |
7+
Supercomputer at the Max Planck Computing Data Facilty.
8+
DefaultProcsPerNode: 72
9+
DefaultQueue: "p.urania"
10+
DefaultTimeLimit: "1-00:00:00"
11+
LaunchCommandSingleNode: ["srun", "-n", "1"]

support/Python/Schedule.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ def schedule(
137137
submit: Optional[bool] = None,
138138
clean_output: bool = False,
139139
force: bool = False,
140+
validate: Optional[bool] = True,
140141
extra_params: dict = {},
141142
**kwargs,
142143
) -> Optional[subprocess.CompletedProcess]:
@@ -307,6 +308,8 @@ def schedule(
307308
files in the 'run_dir' before scheduling the run. (Default: 'False')
308309
force: Optional. When 'True', overwrite input file and submit script
309310
in the 'run_dir' instead of raising an error when they already exist.
311+
validate: Optional. When 'True', validate that the input file is parsed
312+
correctly. When 'False' skip this step.
310313
extra_params: Optional. Dictionary of extra parameters passed to input
311314
file and submit script templates. Parameters can also be passed as
312315
keyword arguments to this function instead.
@@ -538,9 +541,11 @@ def schedule(
538541
)
539542

540543
# Validate input file
541-
validate_input_file(
542-
input_file_path.resolve(), executable=executable, work_dir=run_dir
543-
)
544+
if validate:
545+
validate_input_file(
546+
input_file_path.resolve(), executable=executable, work_dir=run_dir
547+
)
548+
544549
# - If the input file may request resubmissions, make sure we have a
545550
# segments directory
546551
metadata, input_file = yaml.safe_load_all(rendered_input_file)
@@ -847,6 +852,11 @@ def scheduler_options(f):
847852
"You may also want to use '--clean-output'."
848853
),
849854
)
855+
@click.option(
856+
"--validate/--no-validate",
857+
default=True,
858+
help="Validate or skip the validation of the input file.",
859+
)
850860
# Scheduling options
851861
@click.option(
852862
"--scheduler",

support/SubmitScripts/Urania.sh

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{% extends "SubmitTemplateBase.sh" %}
2+
3+
# Distributed under the MIT License.
4+
# See LICENSE.txt for details.
5+
6+
# Urania -- HPC cluster of ACR division of MPI for Grav Physics, housed at the
7+
# Max Planck Computing & Data Facility.
8+
# https://docs.mpcdf.mpg.de/doc/computing/clusters/systems/Gravitational_Physics_ACR.html
9+
10+
{% block head %}
11+
{{ super() -}}
12+
#SBATCH --nodes {{ num_nodes | default(1) }}
13+
#SBATCH --ntasks-per-node=1
14+
#SBATCH --ntasks-per-core=1
15+
#SBATCH --cpus-per-task=72
16+
#SBATCH -t {{ time_limit | default("1-00:00:00") }}
17+
#SBATCH -p {{ queue | default("p.urania") }}
18+
{% endblock %}
19+
20+
{% block charm_ppn %}
21+
# Two thread for communication
22+
CHARM_PPN=$(expr ${SLURM_CPUS_PER_TASK} - 2)
23+
{% endblock %}
24+
25+
{% block list_modules %}
26+
# Load compiler and MPI modules with explicit version specifications,
27+
# consistently with the versions used to build the executable.
28+
source ${SPECTRE_HOME}/support/Environments/urania.sh
29+
spectre_load_modules
30+
{% endblock %}
31+
32+
{% block run_command %}
33+
srun -n ${SLURM_NTASKS} ${SPECTRE_EXECUTABLE} \
34+
--input-file ${SPECTRE_INPUT_FILE} \
35+
++ppn ${CHARM_PPN} +pemap 0-34,36-70 +commap 35,71 \
36+
${SPECTRE_CHECKPOINT:+ +restart "${SPECTRE_CHECKPOINT}"}
37+
{% endblock %}

tests/support/Python/Test_Schedule.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,7 @@ def test_schedule(self):
230230
extra_option="TestOpt",
231231
metadata_option="MetaOpt",
232232
force=False,
233+
validate=True,
233234
input_file="InputFile.yaml",
234235
input_file_name="InputFile.yaml",
235236
input_file_template=str(self.test_dir / "InputFile.yaml"),

0 commit comments

Comments
 (0)