Merge branch 'develop' into long-string-variables

This commit is contained in:
Axel Kohlmeyer
2022-07-02 11:30:16 -04:00
233 changed files with 41780 additions and 2976 deletions

View File

@ -129,9 +129,8 @@ LAMMPS::LAMMPS(int narg, char **arg, MPI_Comm communicator) :
version = (const char *) LAMMPS_VERSION;
num_ver = utils::date2num(version);
clientserver = 0;
cslib = nullptr;
cscomm = 0;
external_comm = 0;
mdicomm = nullptr;
skiprunflag = 0;
@ -155,19 +154,16 @@ LAMMPS::LAMMPS(int narg, char **arg, MPI_Comm communicator) :
#endif
// check if -mpicolor is first arg
// if so, then 2 apps were launched with one mpirun command
// if so, then 2 or more apps were launched with one mpirun command
// this means passed communicator (e.g. MPI_COMM_WORLD) is bigger than LAMMPS
// e.g. for client/server coupling with another code
// in the future LAMMPS might leverage this in other ways
// universe communicator needs to shrink to be just LAMMPS
// syntax: -mpicolor color
// color = integer for this app, different than other app(s)
// color = integer for this app, different than any other app(s)
// do the following:
// perform an MPI_Comm_split() to create a new LAMMPS-only subcomm
// NOTE: this assumes other app(s) does same thing, else will hang!
// NOTE: this assumes other app(s) make same call, else will hang!
// re-create universe with subcomm
// store full multi-app comm in cscomm
// cscomm is used by CSLIB package to exchange messages w/ other app
// store comm that all apps belong to in external_comm
int iarg = 1;
if (narg-iarg >= 2 && (strcmp(arg[iarg],"-mpicolor") == 0 ||
@ -178,7 +174,7 @@ LAMMPS::LAMMPS(int narg, char **arg, MPI_Comm communicator) :
int color = atoi(arg[iarg+1]);
MPI_Comm subcomm;
MPI_Comm_split(communicator,color,me,&subcomm);
cscomm = communicator;
external_comm = communicator;
communicator = subcomm;
delete universe;
universe = new Universe(this,communicator);
@ -290,7 +286,7 @@ LAMMPS::LAMMPS(int narg, char **arg, MPI_Comm communicator) :
logflag = iarg + 1;
iarg += 2;
} else if (strcmp(arg[iarg],"-mpi") == 0 ||
} else if (strcmp(arg[iarg],"-mpicolor") == 0 ||
strcmp(arg[iarg],"-m") == 0) {
if (iarg+2 > narg)
error->universe_all(FLERR,"Invalid command-line argument");
@ -766,13 +762,13 @@ LAMMPS::~LAMMPS()
delete [] suffix2;
delete [] suffixp;
// free the MPI comm created by -mpi command-line arg processed in constructor
// free the MPI comm created by -mpicolor cmdline arg processed in constructor
// it was passed to universe as if original universe world
// may have been split later by partitions, universe will free the splits
// free a copy of uorig here, so check in universe destructor will still work
MPI_Comm copy = universe->uorig;
if (cscomm) MPI_Comm_free(&copy);
if (external_comm) MPI_Comm_free(&copy);
delete input;
delete universe;