From 3d7088a9d9ce439411a3025a3d006fcbf933a211 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 1 Aug 2024 03:45:45 -0400 Subject: [PATCH] make LAMMPS python module compatible with mpi4py 4.x.x --- python/lammps/core.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/python/lammps/core.py b/python/lammps/core.py index f06942cc64..2fd5452c35 100644 --- a/python/lammps/core.py +++ b/python/lammps/core.py @@ -334,8 +334,8 @@ class lammps(object): if self.has_mpi_support: try: from mpi4py import __version__ as mpi4py_version - # tested to work with mpi4py versions 2 and 3 - self.has_mpi4py = mpi4py_version.split('.')[0] in ['2','3'] + # tested to work with mpi4py versions 2, 3, and 4 + self.has_mpi4py = mpi4py_version.split('.')[0] in ['2','3','4'] except ImportError: # ignore failing import pass @@ -361,7 +361,7 @@ class lammps(object): if not self.has_mpi_support: raise Exception('LAMMPS not compiled with real MPI library') if not self.has_mpi4py: - raise Exception('Python mpi4py version is not 2 or 3') + raise Exception('Python mpi4py version is not 2, 3, or 4') if self.MPI._sizeof(self.MPI.Comm) == sizeof(c_int): MPI_Comm = c_int else: