Skip to content
Open
Show file tree
Hide file tree
Changes from 11 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions experiments/gromacs/experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ class Gromacs(
):
variant(
"workload",
default="water_gmx50_adac",
default="water_gmx50",
description="workload name",
)

variant(
"version",
default="2024",
values=("2024", "2023.3"),
default="2025.2",
values=("2025.2", "2024", "2023.3"),
description="app version",
)

Expand All @@ -41,6 +41,14 @@ class Gromacs(
description="Use GPU-aware MPI",
)

variant(
"sycl",
default=True,
values=(True, False),
when=("+rocm"),
description="Enable GPU-aware MPI",
)

def compute_applications_section(self):
if self.spec.satisfies("+openmp"):
self.set_environment_variable("OMP_PROC_BIND", "close")
Expand Down Expand Up @@ -79,6 +87,7 @@ def compute_applications_section(self):
"pme": "auto",
"bonded": f"{bonded_target}",
"update": f"{target}",
"additional_args": " -pin {pin} -nb {nb} -pme {pme} -bonded {bonded} -update {update} -maxh {maxh} -nstlist {nstlist} -npme {npme} ",
}

for k, v in input_variables.items():
Expand All @@ -97,7 +106,7 @@ def compute_package_section(self):
app_version = self.spec.variants["version"][0]

spack_specs = "+mpi~hwloc"
spack_specs += "+sycl" if self.spec.satisfies("+rocm") else "~sycl"
spack_specs += "+sycl" if self.spec.satisfies("+sycl") else "~sycl"

if self.spec.satisfies("+cuda") or self.spec.satisfies("+rocm"):
spack_specs += f" gpu-aware-mpi={self.spec.variants['gpu-aware-mpi'][0]} "
Expand Down
5 changes: 5 additions & 0 deletions modifiers/allocation/modifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,7 @@ def slurm_instructions(self, v):
sbatch_directives = list(f"#SBATCH {x}" for x in (srun_opts + sbatch_opts))

v.mpi_command = f"srun {' '.join(srun_opts)}"
v.single_rank_mpi_command = "srun -n 1 -N 1"
Copy link
Collaborator Author

@rfhaque rfhaque Jun 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@scheibelp I've added a single_rank_mpi_command that is used for mpi executables meant to be run on a single node

v.batch_submit = "sbatch {execute_experiment}"
v.allocation_directives = "\n".join(sbatch_directives)

Expand Down Expand Up @@ -390,6 +391,7 @@ def flux_instructions(self, v):
batch_directives = list(f"# flux: {x}" for x in (cmd_opts + batch_opts))

v.mpi_command = f"flux run {' '.join([cmd_ranks] + cmd_opts)}"
v.single_rank_mpi_command = "flux run -n 1 -N 1"
v.batch_submit = "flux batch {execute_experiment}"
v.allocation_directives = "\n".join(batch_directives)

Expand All @@ -398,6 +400,7 @@ def mpi_instructions(self, v):
cmd_opts.extend([f"-n {v.n_ranks}"])

v.mpi_command = "mpirun " + " ".join(cmd_opts)
v.single_rank_mpi_command = "mpirun -n 1"
v.batch_submit = "{execute_experiment}"
v.allocation_directives = ""

Expand Down Expand Up @@ -428,6 +431,7 @@ def lsf_instructions(self, v):
batch_directives = list(f"#BSUB {x}" for x in batch_opts)

v.mpi_command = f"lrun {' '.join(cmd_opts)}"
v.single_rank_mpi_command = "lrun -n 1"
v.batch_submit = "bsub {execute_experiment}"
v.allocation_directives = "\n".join(batch_directives)

Expand All @@ -444,6 +448,7 @@ def pjm_instructions(self, v):
batch_directives = list(f"#PJM {x}" for x in batch_opts)

v.mpi_command = "mpiexec " + " ".join(cmd_opts)
v.single_rank_mpi_command = "mpiexec --mpi proc=1"
v.batch_submit = "pjsub {execute_experiment}"
v.allocation_directives = "\n".join(batch_directives)

Expand Down
Loading
Loading