Skip to content

Add netket.tools.check_mpi to help debug MPI issues

Vicentini Filippo requested to merge check-mpi into master

Created by: femtobit

Since we regularly see problems with MPI environments, in particular due to a mismatch between the MPI version used to compile mpi4py and the one used to actually run scripts usign NetKet, I propose we add a small utility to help users to check this in an easy way:

$ mpirun -np 2 python3 -m netket.tools.check_mpi
mpi_available                : True
mpi4jax_available            : True
n_nodes                      : 2
mpi4py | MPI version         : (3, 1)
mpi4py | MPI library_version : Open MPI v4.1.0,  <...>

If this breaks, say because I call it using mpirun from MPICH even though NetKet is set up to work with OpenMPI, I get this instead:

$ mpirun.mpich -np 2 python3 -m netket.tools.check_mpi
mpi_available                : True
mpi4jax_available            : True
n_nodes                      : 1
mpi4py | MPI_version         : (3, 1)
mpi4py | MPI_library_version : Open MPI v4.1.0, <...>
mpi_available                : True
mpi4jax_available            : True
n_nodes                      : 1
mpi4py | MPI_version         : (3, 1)
mpi4py | MPI_library_version : Open MPI v4.1.0,  <...>

Merge request reports