Skip to content

Commit

Permalink
lock macos mpich version to previous, use Popens in context just-in-case
Browse files Browse the repository at this point in the history
  • Loading branch information
jlnav committed Apr 26, 2023
1 parent 6469950 commit b80b06e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ jobs:
include:
- os: macos-latest
python-version: 3.9
mpi-version: "mpich"
mpi-version: "mpich=4.0.3"
comms-type: m
- os: macos-latest
python-version: 3.9
mpi-version: "mpich"
mpi-version: "mpich=4.0.3"
comms-type: l
- os: ubuntu-latest
python-version: "3.10"
Expand Down
8 changes: 4 additions & 4 deletions libensemble/resources/mpi_resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ def get_MPI_variant() -> str:
pass

try:
try_msmpi = subprocess.Popen(["mpiexec"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
stdout, _ = try_msmpi.communicate(timeout=4)
with subprocess.Popen(["mpiexec"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) as try_msmpi:
stdout, _ = try_msmpi.communicate(timeout=4)
if "Microsoft" in stdout.decode():
return "msmpi"
except Exception:
Expand All @@ -55,8 +55,8 @@ def get_MPI_variant() -> str:

try:
# Explore mpi4py.MPI.get_vendor() and mpi4py.MPI.Get_library_version() for mpi4py
try_mpich = subprocess.Popen(["mpirun", "-npernode"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
stdout, _ = try_mpich.communicate(timeout=4)
with subprocess.Popen(["mpirun", "-npernode"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) as try_mpich:
stdout, _ = try_mpich.communicate(timeout=4)
if "unrecognized argument npernode" in stdout.decode():
return "mpich"
return "openmpi"
Expand Down

0 comments on commit b80b06e

Please sign in to comment.