support checking the size of MPI communicators and fail if LAMMPS and mpi4py have a mismatch

This commit is contained in:
Axel Kohlmeyer
2021-02-16 20:22:18 -05:00
parent f929e57261
commit 742eebec2d
2 changed files with 9 additions and 3 deletions

View File

@ -325,6 +325,10 @@ class lammps(object):
else:
MPI_Comm = c_void_p
# Detect whether LAMMPS and mpi4py definitely use different MPI libs
if sizeof(MPI_Comm) != self.lib.lammps_config_has_mpi_support():
raise Exception('Inconsistent MPI library in LAMMPS and mpi4py')
narg = 0
cargs = None
if cmdargs: