diff --git a/src/REPLICA/prd.cpp b/src/REPLICA/prd.cpp index e11dae149c..14686f91ac 100644 --- a/src/REPLICA/prd.cpp +++ b/src/REPLICA/prd.cpp @@ -431,7 +431,7 @@ void PRD::dephase() timer->barrier_start(TIME_LOOP); for (int i = 0; i < n_dephase; i++) { - int seed = static_cast (random_dephase->uniform() * MAXINT32); + int seed = static_cast (random_dephase->uniform() * MAXSMALLINT); if (seed == 0) seed = 1; velocity->create(temp_dephase,seed); update->integrate->run(t_dephase); diff --git a/src/XTC/dump_xtc.cpp b/src/XTC/dump_xtc.cpp index 0aed69ea7b..32d6f3cf3c 100644 --- a/src/XTC/dump_xtc.cpp +++ b/src/XTC/dump_xtc.cpp @@ -67,9 +67,11 @@ DumpXTC::DumpXTC(LAMMPS *lmp, int narg, char **arg) : Dump(lmp, narg, arg) // allocate global array for atom coords - if (igroup == 0) natoms = static_cast (atom->natoms); - else natoms = static_cast (group->count(igroup)); - if (natoms <= 0) error->all("Invalid natoms for dump xtc"); + bigint n; + if (igroup == 0) n = static_cast (atom->natoms); + else n = static_cast (group->count(igroup)); + if (n > MAXSMALLINT) error->all("Too many atoms for dump xtc"); + natoms = n; coords = (float *) memory->smalloc(3*natoms*sizeof(float),"dump:coords"); diff --git a/src/compute_reduce.cpp b/src/compute_reduce.cpp index db9c3b6a6b..da1ff6bcbd 100644 --- a/src/compute_reduce.cpp +++ b/src/compute_reduce.cpp @@ -604,7 +604,7 @@ bigint ComputeReduce::count(int m) } else if (flavor[m] == LOCAL) { bigint ncount = compute->size_local_rows; bigint ncountall; - MPI_Allreduce(&ncount,&ncountall,1,MPI_UNSIGNED_LONG_LONG,MPI_SUM,world); + MPI_Allreduce(&ncount,&ncountall,1,MPI_LMP_BIGINT,MPI_SUM,world); return ncountall; } } else if (which[m] == FIX) { @@ -614,7 +614,7 @@ bigint ComputeReduce::count(int m) } else if (flavor[m] == LOCAL) { bigint ncount = fix->size_local_rows; bigint ncountall; - MPI_Allreduce(&ncount,&ncountall,1,MPI_UNSIGNED_LONG_LONG,MPI_SUM,world); + MPI_Allreduce(&ncount,&ncountall,1,MPI_LMP_BIGINT,MPI_SUM,world); return ncountall; } } else if (which[m] == VARIABLE) diff --git a/src/create_atoms.cpp b/src/create_atoms.cpp index e895c68531..98acf8dda9 100644 --- a/src/create_atoms.cpp +++ b/src/create_atoms.cpp @@ -169,7 +169,7 @@ void CreateAtoms::command(int narg, char **arg) // new total # of atoms bigint nblocal = atom->nlocal; - MPI_Allreduce(&nblocal,&atom->natoms,1,MPI_UNSIGNED_LONG_LONG,MPI_SUM,world); + MPI_Allreduce(&nblocal,&atom->natoms,1,MPI_LMP_BIGINT,MPI_SUM,world); // print status @@ -185,8 +185,8 @@ void CreateAtoms::command(int narg, char **arg) // if global map exists, reset it // if a molecular system, set nspecial to 0 for new atoms - if (atom->natoms > MAXINT32) atom->tag_enable = 0; - if (atom->natoms <= MAXINT32) atom->tag_extend(); + if (atom->natoms > MAXTAGINT) atom->tag_enable = 0; + if (atom->natoms <= MAXTAGINT) atom->tag_extend(); if (atom->map_style) { atom->nghost = 0; diff --git a/src/delete_atoms.cpp b/src/delete_atoms.cpp index 1fcf224b0f..d3a2bed8ea 100644 --- a/src/delete_atoms.cpp +++ b/src/delete_atoms.cpp @@ -93,7 +93,7 @@ void DeleteAtoms::command(int narg, char **arg) // set nghost to 0 so old ghosts of deleted atoms won't be mapped bigint nblocal = atom->nlocal; - MPI_Allreduce(&nblocal,&atom->natoms,1,MPI_UNSIGNED_LONG_LONG,MPI_SUM,world); + MPI_Allreduce(&nblocal,&atom->natoms,1,MPI_LMP_BIGINT,MPI_SUM,world); if (atom->map_style) { atom->nghost = 0; atom->map_init(); diff --git a/src/delete_bonds.cpp b/src/delete_bonds.cpp index b2c80cd8f1..9bf92c512d 100644 --- a/src/delete_bonds.cpp +++ b/src/delete_bonds.cpp @@ -341,7 +341,7 @@ void DeleteBonds::command(int narg, char **arg) if (atom->avec->bonds_allow) { bigint nbonds = 0; for (i = 0; i < nlocal; i++) nbonds += atom->num_bond[i]; - MPI_Allreduce(&nbonds,&atom->nbonds,1,MPI_UNSIGNED_LONG_LONG, + MPI_Allreduce(&nbonds,&atom->nbonds,1,MPI_LMP_BIGINT, MPI_SUM,world); if (force->newton_bond == 0) atom->nbonds /= 2; } @@ -349,7 +349,7 @@ void DeleteBonds::command(int narg, char **arg) if (atom->avec->angles_allow) { bigint nangles = 0; for (i = 0; i < nlocal; i++) nangles += atom->num_angle[i]; - MPI_Allreduce(&nangles,&atom->nangles,1,MPI_UNSIGNED_LONG_LONG, + MPI_Allreduce(&nangles,&atom->nangles,1,MPI_LMP_BIGINT, MPI_SUM,world); if (force->newton_bond == 0) atom->nangles /= 3; } @@ -358,7 +358,7 @@ void DeleteBonds::command(int narg, char **arg) bigint ndihedrals = 0; for (i = 0; i < nlocal; i++) ndihedrals += atom->num_dihedral[i]; MPI_Allreduce(&ndihedrals,&atom->ndihedrals, - 1,MPI_UNSIGNED_LONG_LONG,MPI_SUM,world); + 1,MPI_LMP_BIGINT,MPI_SUM,world); if (force->newton_bond == 0) atom->ndihedrals /= 4; } @@ -366,7 +366,7 @@ void DeleteBonds::command(int narg, char **arg) bigint nimpropers = 0; for (i = 0; i < nlocal; i++) nimpropers += atom->num_improper[i]; MPI_Allreduce(&nimpropers,&atom->nimpropers, - 1,MPI_UNSIGNED_LONG_LONG,MPI_SUM,world); + 1,MPI_LMP_BIGINT,MPI_SUM,world); if (force->newton_bond == 0) atom->nimpropers /= 4; } @@ -386,9 +386,9 @@ void DeleteBonds::command(int narg, char **arg) for (m = 0; m < atom->num_bond[i]; m++) if (atom->bond_type[i][m] > 0) bond_on++; else bond_off++; - MPI_Allreduce(&bond_on,&tmp,1,MPI_UNSIGNED_LONG_LONG,MPI_SUM,world); + MPI_Allreduce(&bond_on,&tmp,1,MPI_LMP_BIGINT,MPI_SUM,world); bond_on = tmp; - MPI_Allreduce(&bond_off,&tmp,1,MPI_UNSIGNED_LONG_LONG,MPI_SUM,world); + MPI_Allreduce(&bond_off,&tmp,1,MPI_LMP_BIGINT,MPI_SUM,world); bond_off = tmp; if (force->newton_bond == 0) { bond_on /= 2; @@ -402,9 +402,9 @@ void DeleteBonds::command(int narg, char **arg) for (m = 0; m < atom->num_angle[i]; m++) if (atom->angle_type[i][m] > 0) angle_on++; else angle_off++; - MPI_Allreduce(&angle_on,&tmp,1,MPI_UNSIGNED_LONG_LONG,MPI_SUM,world); + MPI_Allreduce(&angle_on,&tmp,1,MPI_LMP_BIGINT,MPI_SUM,world); angle_on = tmp; - MPI_Allreduce(&angle_off,&tmp,1,MPI_UNSIGNED_LONG_LONG,MPI_SUM,world); + MPI_Allreduce(&angle_off,&tmp,1,MPI_LMP_BIGINT,MPI_SUM,world); angle_off = tmp; if (force->newton_bond == 0) { angle_on /= 3; @@ -418,9 +418,9 @@ void DeleteBonds::command(int narg, char **arg) for (m = 0; m < atom->num_dihedral[i]; m++) if (atom->dihedral_type[i][m] > 0) dihedral_on++; else dihedral_off++; - MPI_Allreduce(&dihedral_on,&tmp,1,MPI_UNSIGNED_LONG_LONG,MPI_SUM,world); + MPI_Allreduce(&dihedral_on,&tmp,1,MPI_LMP_BIGINT,MPI_SUM,world); dihedral_on = tmp; - MPI_Allreduce(&dihedral_off,&tmp,1,MPI_UNSIGNED_LONG_LONG,MPI_SUM,world); + MPI_Allreduce(&dihedral_off,&tmp,1,MPI_LMP_BIGINT,MPI_SUM,world); dihedral_off = tmp; if (force->newton_bond == 0) { dihedral_on /= 4; @@ -434,9 +434,9 @@ void DeleteBonds::command(int narg, char **arg) for (m = 0; m < atom->num_improper[i]; m++) if (atom->improper_type[i][m] > 0) improper_on++; else improper_off++; - MPI_Allreduce(&improper_on,&tmp,1,MPI_UNSIGNED_LONG_LONG,MPI_SUM,world); + MPI_Allreduce(&improper_on,&tmp,1,MPI_LMP_BIGINT,MPI_SUM,world); improper_on = tmp; - MPI_Allreduce(&improper_off,&tmp,1,MPI_UNSIGNED_LONG_LONG,MPI_SUM,world); + MPI_Allreduce(&improper_off,&tmp,1,MPI_LMP_BIGINT,MPI_SUM,world); improper_off = tmp; if (force->newton_bond == 0) { improper_on /= 4; diff --git a/src/displace_atoms.cpp b/src/displace_atoms.cpp index 4a9be6df28..ff55334237 100644 --- a/src/displace_atoms.cpp +++ b/src/displace_atoms.cpp @@ -213,7 +213,7 @@ void DisplaceAtoms::command(int narg, char **arg) bigint natoms; bigint nblocal = atom->nlocal; - MPI_Allreduce(&nblocal,&natoms,1,MPI_UNSIGNED_LONG_LONG,MPI_SUM,world); + MPI_Allreduce(&nblocal,&natoms,1,MPI_LMP_BIGINT,MPI_SUM,world); if (natoms != atom->natoms) { char str[128]; sprintf(str,"Lost atoms via displace_atoms: original %lu current %lu", diff --git a/src/displace_box.cpp b/src/displace_box.cpp index 33d1a3137c..ece73177d5 100644 --- a/src/displace_box.cpp +++ b/src/displace_box.cpp @@ -379,7 +379,7 @@ void DisplaceBox::command(int narg, char **arg) bigint natoms; bigint nblocal = atom->nlocal; - MPI_Allreduce(&nblocal,&natoms,1,MPI_UNSIGNED_LONG_LONG,MPI_SUM,world); + MPI_Allreduce(&nblocal,&natoms,1,MPI_LMP_BIGINT,MPI_SUM,world); if (natoms != atom->natoms) { char str[128]; sprintf(str,"Lost atoms via displace_box: original %lu current %lu", diff --git a/src/dump.cpp b/src/dump.cpp index 76708f01eb..c0939f2453 100644 --- a/src/dump.cpp +++ b/src/dump.cpp @@ -174,7 +174,7 @@ void Dump::init() irregular = new Irregular(lmp); bigint size = group->count(igroup); - if (size > MAXINT32) error->all("Too many atoms to dump sort"); + if (size > MAXSMALLINT) error->all("Too many atoms to dump sort"); // set reorderflag = 1 if can simply reorder local atoms rather than sort // criteria: sorting by ID, atom IDs are consecutive from 1 to Natoms diff --git a/src/dump_dcd.cpp b/src/dump_dcd.cpp index 222b8dc4be..1a8743ae76 100644 --- a/src/dump_dcd.cpp +++ b/src/dump_dcd.cpp @@ -71,7 +71,7 @@ DumpDCD::DumpDCD(LAMMPS *lmp, int narg, char **arg) : Dump(lmp, narg, arg) bigint n; if (igroup == 0) n = static_cast (atom->natoms); else n = static_cast (group->count(igroup)); - if (n > MAXINT32) error->all("Too many atoms for dump dcd"); + if (n > MAXSMALLINT) error->all("Too many atoms for dump dcd"); natoms = n; coords = (float *) memory->smalloc(3*natoms*sizeof(float),"dump:coords"); diff --git a/src/finish.cpp b/src/finish.cpp index d45cf63b29..5d148a7be5 100644 --- a/src/finish.cpp +++ b/src/finish.cpp @@ -86,7 +86,7 @@ void Finish::end(int flag) // use actual natoms, in case atoms were lost bigint nblocal = atom->nlocal; - MPI_Allreduce(&nblocal,&natoms,1,MPI_UNSIGNED_LONG_LONG,MPI_SUM,world); + MPI_Allreduce(&nblocal,&natoms,1,MPI_LMP_BIGINT,MPI_SUM,world); if (me == 0) { if (screen) diff --git a/src/group.cpp b/src/group.cpp index b2ee3c4afd..79a526b5b7 100644 --- a/src/group.cpp +++ b/src/group.cpp @@ -497,7 +497,7 @@ bigint Group::count(int igroup) bigint nsingle = n; bigint nall; - MPI_Allreduce(&nsingle,&nall,1,MPI_UNSIGNED_LONG_LONG,MPI_SUM,world); + MPI_Allreduce(&nsingle,&nall,1,MPI_LMP_BIGINT,MPI_SUM,world); return nall; } @@ -520,7 +520,7 @@ bigint Group::count(int igroup, int iregion) bigint nsingle = n; bigint nall; - MPI_Allreduce(&nsingle,&nall,1,MPI_UNSIGNED_LONG_LONG,MPI_SUM,world); + MPI_Allreduce(&nsingle,&nall,1,MPI_LMP_BIGINT,MPI_SUM,world); return nall; } diff --git a/src/lammps.cpp b/src/lammps.cpp index 6b87c0a33b..920f336768 100644 --- a/src/lammps.cpp +++ b/src/lammps.cpp @@ -247,9 +247,9 @@ LAMMPS::LAMMPS(int narg, char **arg, MPI_Comm communicator) error->all("No support for 8-byte unsigned integers"); int mpisize; - MPI_Type_size(MPI_UNSIGNED_LONG_LONG,&mpisize); + MPI_Type_size(MPI_LMP_BIGINT,&mpisize); if (mpisize != 8) - error->all("MPI_UNSIGNED_LONG_LONG is not 8-byte data type"); + error->all("MPI_LMP_BIGINT is not 8-byte data type"); // allocate input class now that MPI is fully setup diff --git a/src/library.cpp b/src/library.cpp index 546ad4f3f7..2b2cc39778 100644 --- a/src/library.cpp +++ b/src/library.cpp @@ -348,7 +348,7 @@ void *lammps_extract_variable(void *ptr, char *name, char *group) int lammps_get_natoms(void *ptr) { LAMMPS *lmp = (LAMMPS *) ptr; - if (lmp->atom->natoms > MAXINT32) return 0; + if (lmp->atom->natoms > MAXSMALLINT) return 0; int natoms = static_cast (lmp->atom->natoms); return natoms; } @@ -362,7 +362,7 @@ void lammps_get_coords(void *ptr, double *coords) // error if tags are not defined or not consecutive if (lmp->atom->tag_enable == 0 || lmp->atom->tag_consecutive() == 0) return; - if (lmp->atom->natoms > MAXINT32) return; + if (lmp->atom->natoms > MAXSMALLINT) return; int natoms = static_cast (lmp->atom->natoms); double *copy = new double[3*natoms]; @@ -394,7 +394,7 @@ void lammps_put_coords(void *ptr, double *coords) // error if no map defined by LAMMPS if (lmp->atom->map_style == 0) return; - if (lmp->atom->natoms > MAXINT32) return; + if (lmp->atom->natoms > MAXSMALLINT) return; int natoms = static_cast (lmp->atom->natoms); double **x = lmp->atom->x; diff --git a/src/lmptype.h b/src/lmptype.h index 1ab30c82cc..82c4644e7e 100644 --- a/src/lmptype.h +++ b/src/lmptype.h @@ -11,6 +11,23 @@ See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ +// define integer data types used by LAMMPS and associated size limits + +// smallint = variables for system on 1 processor (nlocal, etc) +// tagint = variables for atom IDs (tag) +// bigint = variables for total system and timesteps (natoms, ntimestep, etc) + +// smallint must be an int, as defined by C compiler +// tagint can be 32-bit or 64-bit int, must be >= smallint +// bigint can be 32-bit or 64-bit int, must be >= smallint and >= tagint + +// MAXSMALLINT = max value of a smallint +// MAXTAGINT = max value of a tagint +// MAXBIGINT = max value of a bigint + +// MPI_LMP_TAGINT = MPI data type corresponding to tagint +// MPI_LMP_BIGINT = MPI data type corresponding to bigint + #ifndef LMP_LMPTYPE_H #define LMP_LMPTYPE_H @@ -18,8 +35,18 @@ namespace LAMMPS_NS { -typedef uint64_t bigint; -#define MAXINT32 0x7FFFFFFF +// default settings: 4-byte smallint, 4-byte tagint, 8-byte bigint + +typedef int smallint; +typedef int tagint; +typedef int64_t bigint; + +#define MAXSMALLINT 0x7FFFFFFF +#define MAXTAGINT 0x7FFFFFFF +#define MAXBIGINT 0x7FFFFFFFFFFFFFFFL + +#define MPI_LMP_TAGINT MPI_INT +#define MPI_LMP_BIGINT MPI_LONG_LONG } diff --git a/src/min.cpp b/src/min.cpp index 8f58ceae55..a1e0a5bbff 100644 --- a/src/min.cpp +++ b/src/min.cpp @@ -202,7 +202,7 @@ void Min::setup() bigint ndofme = 3*atom->nlocal; for (int m = 0; m < nextra_atom; m++) ndofme += extra_peratom[m]*atom->nlocal; - MPI_Allreduce(&ndofme,&ndoftotal,1,MPI_UNSIGNED_LONG_LONG,MPI_SUM,world); + MPI_Allreduce(&ndofme,&ndoftotal,1,MPI_LMP_BIGINT,MPI_SUM,world); ndoftotal += nextra_global; // setup domain, communication and neighboring diff --git a/src/min_cg.cpp b/src/min_cg.cpp index 63ed35fddd..9ad87904fb 100644 --- a/src/min_cg.cpp +++ b/src/min_cg.cpp @@ -51,7 +51,7 @@ int MinCG::iterate(int maxiter) // nlimit = max # of CG iterations before restarting // set to ndoftotal unless too big - int nlimit = static_cast (MIN(MAXINT32,ndoftotal)); + int nlimit = static_cast (MIN(MAXSMALLINT,ndoftotal)); // initialize working vectors diff --git a/src/read_data.cpp b/src/read_data.cpp index f8229bdfd0..92a1fef909 100644 --- a/src/read_data.cpp +++ b/src/read_data.cpp @@ -435,7 +435,7 @@ void ReadData::atoms() // check that all atoms were assigned correctly bigint tmp = atom->nlocal; - MPI_Allreduce(&tmp,&natoms,1,MPI_UNSIGNED_LONG_LONG,MPI_SUM,world); + MPI_Allreduce(&tmp,&natoms,1,MPI_LMP_BIGINT,MPI_SUM,world); if (me == 0) { if (screen) fprintf(screen," %lu atoms\n",natoms); @@ -568,7 +568,7 @@ void ReadData::bonds() bigint sum; bigint n = 0; for (i = 0; i < nlocal; i++) n += atom->num_bond[i]; - MPI_Allreduce(&n,&sum,1,MPI_UNSIGNED_LONG_LONG,MPI_SUM,world); + MPI_Allreduce(&n,&sum,1,MPI_LMP_BIGINT,MPI_SUM,world); int factor = 1; if (!force->newton_bond) factor = 2; @@ -613,7 +613,7 @@ void ReadData::angles() bigint sum; bigint n = 0; for (i = 0; i < nlocal; i++) n += atom->num_angle[i]; - MPI_Allreduce(&n,&sum,1,MPI_UNSIGNED_LONG_LONG,MPI_SUM,world); + MPI_Allreduce(&n,&sum,1,MPI_LMP_BIGINT,MPI_SUM,world); int factor = 1; if (!force->newton_bond) factor = 3; @@ -658,7 +658,7 @@ void ReadData::dihedrals() bigint sum; bigint n = 0; for (i = 0; i < nlocal; i++) n += atom->num_dihedral[i]; - MPI_Allreduce(&n,&sum,1,MPI_UNSIGNED_LONG_LONG,MPI_SUM,world); + MPI_Allreduce(&n,&sum,1,MPI_LMP_BIGINT,MPI_SUM,world); int factor = 1; if (!force->newton_bond) factor = 4; @@ -704,7 +704,7 @@ void ReadData::impropers() bigint sum; bigint n = 0; for (i = 0; i < nlocal; i++) n += atom->num_improper[i]; - MPI_Allreduce(&n,&sum,1,MPI_UNSIGNED_LONG_LONG,MPI_SUM,world); + MPI_Allreduce(&n,&sum,1,MPI_LMP_BIGINT,MPI_SUM,world); int factor = 1; if (!force->newton_bond) factor = 4; @@ -976,7 +976,7 @@ void ReadData::scan(int &bond_per_atom, int &angle_per_atom, int i,tmp1,tmp2,atom1,atom2,atom3,atom4; char *eof; - if (atom->natoms > MAXINT32) + if (atom->natoms > MAXSMALLINT) error->all("Molecular data file has too many atoms"); int natoms = static_cast (atom->natoms); diff --git a/src/read_restart.cpp b/src/read_restart.cpp index f325bc67b2..0078a8324d 100644 --- a/src/read_restart.cpp +++ b/src/read_restart.cpp @@ -293,7 +293,7 @@ void ReadRestart::command(int narg, char **arg) bigint natoms; bigint nblocal = atom->nlocal; - MPI_Allreduce(&nblocal,&natoms,1,MPI_UNSIGNED_LONG_LONG,MPI_SUM,world); + MPI_Allreduce(&nblocal,&natoms,1,MPI_LMP_BIGINT,MPI_SUM,world); if (me == 0) { if (screen) fprintf(screen," %lu atoms\n",natoms); @@ -819,6 +819,6 @@ bigint ReadRestart::read_bigint() { bigint value; if (me == 0) fread(&value,sizeof(bigint),1,fp); - MPI_Bcast(&value,1,MPI_UNSIGNED_LONG_LONG,0,world); + MPI_Bcast(&value,1,MPI_LMP_BIGINT,0,world); return value; } diff --git a/src/replicate.cpp b/src/replicate.cpp index a4e02bd12a..7c8fc5e68e 100644 --- a/src/replicate.cpp +++ b/src/replicate.cpp @@ -129,16 +129,16 @@ void Replicate::command(int narg, char **arg) // if molecular, N/Nbonds/etc cannot be > 2^31 else tags/counts invalid double rep = nrep; - if (rep*old->natoms > MAXINT32) atom->tag_enable = 0; + if (rep*old->natoms > MAXSMALLINT) atom->tag_enable = 0; if (atom->tag_enable == 0) for (int i = 0; i < atom->nlocal; i++) atom->tag[i] = 0; if (atom->molecular) { - if (rep*old->natoms > MAXINT32 || rep*old->nbonds > MAXINT32 || - rep*old->nangles > MAXINT32 || rep*old->ndihedrals > MAXINT32 || - rep*old->nimpropers > MAXINT32) + if (rep*old->natoms > MAXBIGINT || rep*old->nbonds > MAXBIGINT || + rep*old->nangles > MAXBIGINT || rep*old->ndihedrals > MAXBIGINT || + rep*old->nimpropers > MAXBIGINT) error->all("Too big a problem to replicate with molecular atom style"); } @@ -365,7 +365,7 @@ void Replicate::command(int narg, char **arg) bigint natoms; bigint nblocal = atom->nlocal; - MPI_Allreduce(&nblocal,&natoms,1,MPI_UNSIGNED_LONG_LONG,MPI_SUM,world); + MPI_Allreduce(&nblocal,&natoms,1,MPI_LMP_BIGINT,MPI_SUM,world); if (me == 0) { if (screen) fprintf(screen," %lu atoms\n",natoms); diff --git a/src/thermo.cpp b/src/thermo.cpp index 042a28fcea..76af0c0d13 100644 --- a/src/thermo.cpp +++ b/src/thermo.cpp @@ -353,7 +353,7 @@ bigint Thermo::lost_check() bigint ntotal; bigint nblocal = atom->nlocal; - MPI_Allreduce(&nblocal,&ntotal,1,MPI_UNSIGNED_LONG_LONG,MPI_SUM,world); + MPI_Allreduce(&nblocal,&ntotal,1,MPI_LMP_BIGINT,MPI_SUM,world); if (ntotal == atom->natoms) return ntotal; // if not checking or already warned, just return diff --git a/src/velocity.cpp b/src/velocity.cpp index 0a9e944b08..4cadf22de6 100644 --- a/src/velocity.cpp +++ b/src/velocity.cpp @@ -223,7 +223,7 @@ void Velocity::create(double t_desired, int seed) // error check - if (atom->natoms > MAXINT32) + if (atom->natoms > MAXSMALLINT) error->all("Too big a problem to use velocity create loop all"); if (atom->tag_enable == 0) error->all("Cannot use velocity create loop all unless atoms have IDs"); diff --git a/src/write_restart.cpp b/src/write_restart.cpp index 25cba1c04d..3608ddfad6 100644 --- a/src/write_restart.cpp +++ b/src/write_restart.cpp @@ -122,7 +122,7 @@ void WriteRestart::write(char *file) // if unequal and thermo lostflag is "error", don't write restart file bigint nblocal = atom->nlocal; - MPI_Allreduce(&nblocal,&natoms,1,MPI_UNSIGNED_LONG_LONG,MPI_SUM,world); + MPI_Allreduce(&nblocal,&natoms,1,MPI_LMP_BIGINT,MPI_SUM,world); if (natoms != atom->natoms && output->thermo->lostflag == ERROR) error->all("Atom count is inconsistent, cannot write restart file");