Skip to content

PythonPackage built-in sanity check fails for MPI-bound packages #3914

@MdHassanPappu

Description

@MdHassanPappu

I’m encountering a problem with EasyBuild’s PythonPackage easyblock for MPI-bound Python packages, the Dolfinx Python bindings. The built-in sanity check automatically runs:

python -c "import <module>"

and this fails because the import requires an initialized MPI environment.

Even after setting sanity_check_skip = True or using:

sanity_check_commands = [
    'srun -n 1 python -c "from mpi4py import MPI; import dolfinx"'
]
sanity_check_paths = {}
sanity_pip_check = False
runtest = False

the automatic import (import dolfinx) still runs and causes the build to fail.

Easyconfigs:

easyblock = 'PythonPackage'

name = 'fenics-dolfinx-py'
version = '0.9.0'
homepage = 'https://github.com/FEniCS/dolfinx'
description = "DOLFINx is the computational environment of FEniCSx - python binding"

toolchain = {'name': 'foss', 'version': '2023b'}

source_urls = ['https://github.com/FEniCS/dolfinx/archive']
sources = ['v%(version)s.tar.gz']
checksums = ['b266c74360c2590c5745d74768c04568c965b44739becca4cd6b5aa58cdbbbd1']

builddependencies = [
    ('CMake', '3.27.6'),
    ('scikit-build-core', '0.10.7'),
    ('nanobind', '2.5.0'),
    ('setuptools', '64.0.3'),
    ('pkgconfig', '1.5.5', '-python'),
    ('fenics-dolfinx-cpp', '%(version)s'),
]

dependencies = [
    ('Python', '3.11.5'),
    ('SciPy-bundle', '2023.11'),
    ('HDF5', '1.14.3'),
    ('mpi4py', '3.1.5'),
    ('cffi', '1.15.1'),
    ('PETSc', '3.22.5'),
    ('petsc4py', '3.22.5'),
    ('slepc4py', '3.22.2'),
    ('fenics-basix', '0.9.0'),
    ('fenics-basix-py', '0.9.0'),
    ('fenics-ufl-py', '2024.2.0'),
    ('fenics-ffcx-py', '0.9.0'),
]

install_src = './python'

options = {'modulename': 'dolfinx'}

sanity_check_commands = [
    'srun -n 1 python -c "from mpi4py import MPI; import dolfinx"'
]

runtest = False
sanity_check_paths = {}
sanity_pip_check = False

moduleclass = 'cae'

Issues :

>> running command 'srun -n 1 python -c "from mpi4py import MPI; import dolfinx"' ...
  >> result for command 'srun -n 1 python -c "from mpi4py import MPI; import dolfinx"': OK
== ... (took 5 secs)
== FAILED: Installation ended unsuccessfully: Sanity check failed: command 
"/opt/apps/easybuild/systems/aion/rhel810-20250803/2023b/epyc/software/Python/3.11.5-GCCcore-13.2.0/bin/python -c "import dolfinx"" failed;
output:
[aion-0242:3427192] OPAL ERROR: Unreachable in file ext3x_client.c at line 111
--------------------------------------------------------------------------
The application appears to have been direct launched using "srun",
but OMPI was not built with SLURM's PMI support and therefore cannot
execute. There are several options for building PMI support under
SLURM, depending upon the SLURM version you are using:

I would greatly appreciate any guidance on whether there is a way to fully bypass this automatic import sanity check for MPI-bound Python packages? Or any Alternative way to build ? Thnaks in advance.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions