From 44ed6f1896f39e98cd12cc02a13b180b5128ea2e Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 13 May 2021 14:21:23 -0400 Subject: [PATCH] don't use provided communicator when LAMMPS was compiled with STUBS --- src/USER-MDI/library_mdi.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/USER-MDI/library_mdi.cpp b/src/USER-MDI/library_mdi.cpp index ce7e38754e..6b90da91ff 100644 --- a/src/USER-MDI/library_mdi.cpp +++ b/src/USER-MDI/library_mdi.cpp @@ -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);