mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 06:05:58 -04:00
Merge pull request #1268 from drewejohnson/operator-mpi-checks
Check that hdf5 has MPI if performing depletion with MPI
This commit is contained in:
commit
d10265ac2c
1 changed files with 14 additions and 0 deletions
|
|
@ -4,12 +4,26 @@ openmc.deplete
|
|||
|
||||
A depletion front-end tool.
|
||||
"""
|
||||
from sys import exit
|
||||
|
||||
from h5py import get_config
|
||||
|
||||
from .dummy_comm import DummyCommunicator
|
||||
|
||||
try:
|
||||
from mpi4py import MPI
|
||||
|
||||
comm = MPI.COMM_WORLD
|
||||
have_mpi = True
|
||||
# check if running with MPI and if using parallel HDF5
|
||||
|
||||
if not get_config().mpi and comm.size > 1:
|
||||
# Raise exception only on process 0
|
||||
if comm.rank:
|
||||
exit()
|
||||
raise RuntimeError(
|
||||
"Need parallel HDF5 installed to perform depletion with MPI"
|
||||
)
|
||||
except ImportError:
|
||||
comm = DummyCommunicator()
|
||||
have_mpi = False
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue