1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
|
# avoid running mpi with serial (1 process) jobs
# by checking whether mpi is actually being used over multiple processes
# Probe number of processes with OMPI_COMM_WORLD_SIZE (openmpi) and MPI_LOCALNRANKS (mpich)
from os import getenv as os_getenv
from sys import modules as sys_modules
from importlib import import_module
_OPENMPI_MULTIPROC = os_getenv('OMPI_COMM_WORLD_SIZE') is not None
_MPICH_MULTIPROC = os_getenv('MPI_LOCALNRANKS') is not None
_MPI_USE_ALWAYS = os_getenv('ADIOS2_ALWAYS_USE_MPI') is not None
_MPI_ACTIVE = _OPENMPI_MULTIPROC or _MPICH_MULTIPROC or _MPI_USE_ALWAYS
if _MPI_ACTIVE:
try:
from .adios2_bindings_mpi import *
except:
from .adios2_bindings_serial import *
else:
from .adios2_bindings_serial import *
__version__ = "@ADIOS2_VERSION@"
|