check that wrapper for lammps_open() was compiled with -DLAMMPS_LIB_MPI=1

This commit is contained in:
Axel Kohlmeyer
2022-10-31 16:12:56 -04:00
parent 3ae2f9966b
commit 5d115fec90
3 changed files with 12 additions and 1 deletions

View File

@ -93,7 +93,13 @@ int main(int narg, char **arg)
MPI_Abort(MPI_COMM_WORLD,1);
}
}
if (lammps == 1) lmp = plugin->open(0,NULL,comm_lammps,NULL);
if (lammps == 1) {
if (plugin->open == NULL) {
printf("ERROR: liblammpsmpi.c must be compiled with -DLAMMPS_LIB_MPI=1 for this program\n");
MPI_Abort(MPI_COMM_WORLD,2);
}
lmp = plugin->open(0,NULL,comm_lammps,NULL);
}
while (1) {
if (me == 0) {