diff --git a/src/uwtools/drivers/mpassit.py b/src/uwtools/drivers/mpassit.py index f4df401b0..70e5d3f08 100644 --- a/src/uwtools/drivers/mpassit.py +++ b/src/uwtools/drivers/mpassit.py @@ -114,5 +114,12 @@ def _runcmd(self) -> str: """ The full command-line component invocation. """ - executable = self.config[STR.execution][STR.executable] - return "%s %s" % (executable, self._input_config_path.name) + execution = self.config.get(STR.execution, {}) + mpiargs = execution.get(STR.mpiargs, []) + components = [ + execution.get(STR.mpicmd), # MPI run program + *[str(x) for x in mpiargs], # MPI arguments + execution[STR.executable], # component executable name + self._input_config_path.name, # namelist name + ] + return " ".join(filter(None, components)) diff --git a/src/uwtools/tests/drivers/test_mpassit.py b/src/uwtools/tests/drivers/test_mpassit.py index 0274ac57f..d76043c08 100644 --- a/src/uwtools/tests/drivers/test_mpassit.py +++ b/src/uwtools/tests/drivers/test_mpassit.py @@ -100,4 +100,4 @@ def test_MPASSIT__input_config_path(driverobj, tmp_path): def test_MPASSIT__runcmd(driverobj): - assert driverobj._runcmd == "/path/to/mpassit mpassit.nml" + assert driverobj._runcmd == "srun /path/to/mpassit mpassit.nml" diff --git a/src/uwtools/tests/test_schemas.py b/src/uwtools/tests/test_schemas.py index 70bf5e3b3..3f005012a 100644 --- a/src/uwtools/tests/test_schemas.py +++ b/src/uwtools/tests/test_schemas.py @@ -276,6 +276,7 @@ def mpas_streams(): MPASSIT_CONFIG = { "execution": { "executable": "/path/to/mpassit", + "mpicmd": "srun", }, "namelist": { "update_values": {