Skip to content

Commit f81f6ed

Browse files
committed
Partially re-enable a real mpi lib in run_tests.py
This restores some of the mpi lib selection functionality that was removed in #4397. However, I am *not* fully re-enabling mpi support, because I'm not sure what's needed at this point to actually run pFUnit via MPI. So this just puts in place an ability to build the code using an MPI-based software stack rather than an mpi-serial-based software stack. I'm hoping this will help resolve some issues with doing unit testing of the CESM_share code via GitHub actions, where we have an mpi-enabled ESMF rather than an mpi-serial-based ESMF.
1 parent 1a36a5f commit f81f6ed

File tree

1 file changed

+16
-6
lines changed

1 file changed

+16
-6
lines changed

scripts/fortran_unit_testing/run_tests.py

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,16 @@ def parse_command_line(args):
108108
help="""Number of processes to use for build.""",
109109
)
110110

111+
parser.add_argument(
112+
"--mpilib",
113+
default="mpi-serial",
114+
help="""MPI Library to use in build.
115+
If not specified, use mpi-serial.
116+
Note that we don't fully support running parallel tests,
117+
but this option allows use of an mpi-based software stack
118+
rather than requiring an mpi-serial-based software stack."""
119+
)
120+
111121
parser.add_argument(
112122
"--test-spec-dir",
113123
default=".",
@@ -161,6 +171,7 @@ def parse_command_line(args):
161171
args.machine,
162172
args.machines_dir,
163173
args.make_j,
174+
args.mpilib,
164175
args.test_spec_dir,
165176
args.ctest_args,
166177
args.use_openmp,
@@ -300,6 +311,7 @@ def _main():
300311
machine,
301312
machines_dir,
302313
make_j,
314+
mpilib,
303315
test_spec_dir,
304316
ctest_args,
305317
use_openmp,
@@ -359,12 +371,10 @@ def _main():
359371
# Functions to perform various stages of build.
360372
# =================================================
361373

362-
# In the switch from pFUnit3 to pFUnit4, we have dropped support for MPI for now
363-
# because it seems like the way this is done differs for pFUnit4 and we weren't
364-
# leveraging the parallel capabilities of pFUnit anyway. So we force mpilib =
365-
# "mpi-serial" and use_mpiserial = True for now until we need to generalize this.
366-
mpilib = "mpi-serial"
367-
use_mpiserial = True
374+
# Note that we currently only have partial support for a real MPI library: We allow
375+
# use of something other than mpi-serial in order to find the appropriate software
376+
# stack and do the build, but we don't currently support running parallel tests.
377+
use_mpiserial = (mpilib == "mpi-serial")
368378

369379
if compiler is None:
370380
compiler = machobj.get_default_compiler()

0 commit comments

Comments
 (0)