Bug#944769: python3-h5py fails to import if offline due to apparent MPI failure
Drew Parsons
dparsons at debian.org
Mon Jan 27 04:40:26 GMT 2020
Source: h5py
Followup-For: Bug #944769
It might not be so simple. Some of the code is cython, so the obvious
runtime tests don't work, not via os.getenv at least.
For instance, the instance of "if MPI:" in api_types_ext.pxd can be
patched to
from os import getenv as os_getenv
OPENMPI_MULTIPROC = os_getenv('OMPI_COMM_WORLD_SIZE') and int(os_getenv('OMPI_COMM_WORLD_SIZE')) > 1
MPICH_MULTIPROC = os_getenv('MPI_LOCALNRANKS') and int(os_getenv('MPI_LOCALNRANKS'))>1
MPI_ACTIVE = MPI and ( OPENMPI_MULTIPROC or MPICH_MULTIPROC )
IF MPI_ACTIVE:
from mpi4py.MPI cimport MPI_Comm, MPI_Info, Comm, Info
But then during configuration cython fails:
Error compiling Cython file:
------------------------------------------------------------
...
from os import getenv as os_getenv
OPENMPI_MULTIPROC = os_getenv('OMPI_COMM_WORLD_SIZE') and int(os_getenv('OMPI_COMM_WORLD_SIZE')) > 1
MPICH_MULTIPROC = os_getenv('MPI_LOCALNRANKS') and int(os_getenv('MPI_LOCALNRANKS'))>1
MPI_ACTIVE = MPI and ( OPENMPI_MULTIPROC or MPICH_MULTIPROC )
IF MPI_ACTIVE:
^
------------------------------------------------------------
h5py/api_types_ext.pxd:22:3: Compile-time name 'MPI_ACTIVE' not defined
even though MPI_ACTIVE is defined in code right there.
I haven't coded in cython before, perhaps it needs a different syntax?
More information about the debian-science-maintainers
mailing list