don't use provided communicator when LAMMPS was compiled with STUBS

This commit is contained in:
Axel Kohlmeyer
2021-05-13 14:21:23 -04:00
parent fa80903ac2
commit 44ed6f1896

View File

@ -82,7 +82,11 @@ int MDI_Plugin_init_lammps()
if (!found_filename) MPI_Abort(MPI_COMM_WORLD, 1);
// create and run a LAMMPS instance
auto lmp = lammps_open(mdi_argc, mdi_argv, mpi_world_comm, NULL);
void *lmp = nullptr;
if (lammps_config_has_mpi_support() > 0)
lmp = lammps_open(mdi_argc, mdi_argv, mpi_world_comm, nullptr);
else
lmp = lammps_open_no_mpi(mdi_argc, mdi_argv, nullptr);
lammps_file(lmp, filename);
lammps_close(lmp);