From 55e8b2bee6cf63d6461b56eaea1c989d2688a65c Mon Sep 17 00:00:00 2001 From: sjplimp Date: Wed, 5 Jan 2011 00:29:35 +0000 Subject: [PATCH] git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@5476 f3b2605a-c512-4ea7-a41b-209d697bcdaa --- src/STUBS/mpi.cpp | 18 +++++++++--------- src/STUBS/mpi.h | 2 +- src/compute_reduce.cpp | 4 ++-- src/create_atoms.cpp | 2 +- src/delete_atoms.cpp | 2 +- src/delete_bonds.cpp | 24 ++++++++++++------------ src/displace_atoms.cpp | 2 +- src/displace_box.cpp | 2 +- src/finish.cpp | 2 +- src/group.cpp | 4 ++-- src/lammps.cpp | 10 ++++++++++ src/memory.cpp | 13 +------------ src/min.cpp | 2 +- src/read_data.cpp | 10 +++++----- src/read_restart.cpp | 4 ++-- src/replicate.cpp | 2 +- src/thermo.cpp | 2 +- src/write_restart.cpp | 2 +- 18 files changed, 53 insertions(+), 54 deletions(-) diff --git a/src/STUBS/mpi.cpp b/src/STUBS/mpi.cpp index e4f8d82fa6..5087707d5f 100644 --- a/src/STUBS/mpi.cpp +++ b/src/STUBS/mpi.cpp @@ -98,7 +98,7 @@ int MPI_Type_size(MPI_Datatype datatype, int *size) else if (datatype == MPI_DOUBLE) *size = sizeof(double); else if (datatype == MPI_CHAR) *size = sizeof(char); else if (datatype == MPI_BYTE) *size = sizeof(char); - else if (datatype == MPI_UNSIGNED_LONG) *size = sizeof(uint64_t); + else if (datatype == MPI_UNSIGNED_LONG_LONG) *size = sizeof(uint64_t); else if (datatype == MPI_DOUBLE_INT) *size = sizeof(double_int); } @@ -261,7 +261,7 @@ int MPI_Allreduce(void *sendbuf, void *recvbuf, int count, else if (datatype == MPI_DOUBLE) n = count*sizeof(double); else if (datatype == MPI_CHAR) n = count*sizeof(char); else if (datatype == MPI_BYTE) n = count*sizeof(char); - else if (datatype == MPI_UNSIGNED_LONG) n = count*sizeof(uint64_t); + else if (datatype == MPI_UNSIGNED_LONG_LONG) n = count*sizeof(uint64_t); else if (datatype == MPI_DOUBLE_INT) n = count*sizeof(double_int); memcpy(recvbuf,sendbuf,n); @@ -282,7 +282,7 @@ int MPI_Reduce(void *sendbuf, void *recvbuf, int count, else if (datatype == MPI_DOUBLE) n = count*sizeof(double); else if (datatype == MPI_CHAR) n = count*sizeof(char); else if (datatype == MPI_BYTE) n = count*sizeof(char); - else if (datatype == MPI_UNSIGNED_LONG) n = count*sizeof(uint64_t); + else if (datatype == MPI_UNSIGNED_LONG_LONG) n = count*sizeof(uint64_t); else if (datatype == MPI_DOUBLE_INT) n = count*sizeof(double_int); memcpy(recvbuf,sendbuf,n); @@ -301,7 +301,7 @@ int MPI_Scan(void *sendbuf, void *recvbuf, int count, else if (datatype == MPI_DOUBLE) n = count*sizeof(double); else if (datatype == MPI_CHAR) n = count*sizeof(char); else if (datatype == MPI_BYTE) n = count*sizeof(char); - else if (datatype == MPI_UNSIGNED_LONG) n = count*sizeof(uint64_t); + else if (datatype == MPI_UNSIGNED_LONG_LONG) n = count*sizeof(uint64_t); else if (datatype == MPI_DOUBLE_INT) n = count*sizeof(double_int); memcpy(recvbuf,sendbuf,n); @@ -322,7 +322,7 @@ int MPI_Allgather(void *sendbuf, int sendcount, MPI_Datatype sendtype, else if (sendtype == MPI_DOUBLE) n = sendcount*sizeof(double); else if (sendtype == MPI_CHAR) n = sendcount*sizeof(char); else if (sendtype == MPI_BYTE) n = sendcount*sizeof(char); - else if (sendtype == MPI_UNSIGNED_LONG) n = sendcount*sizeof(uint64_t); + else if (sendtype == MPI_UNSIGNED_LONG_LONG) n = sendcount*sizeof(uint64_t); else if (sendtype == MPI_DOUBLE_INT) n = sendcount*sizeof(double_int); memcpy(recvbuf,sendbuf,n); @@ -343,7 +343,7 @@ int MPI_Allgatherv(void *sendbuf, int sendcount, MPI_Datatype sendtype, else if (sendtype == MPI_DOUBLE) n = sendcount*sizeof(double); else if (sendtype == MPI_CHAR) n = sendcount*sizeof(char); else if (sendtype == MPI_BYTE) n = sendcount*sizeof(char); - else if (sendtype == MPI_UNSIGNED_LONG) n = sendcount*sizeof(uint64_t); + else if (sendtype == MPI_UNSIGNED_LONG_LONG) n = sendcount*sizeof(uint64_t); else if (sendtype == MPI_DOUBLE_INT) n = sendcount*sizeof(double_int); memcpy(recvbuf,sendbuf,n); @@ -363,7 +363,7 @@ int MPI_Reduce_scatter(void *sendbuf, void *recvbuf, int *recvcounts, else if (datatype == MPI_DOUBLE) n = *recvcounts*sizeof(double); else if (datatype == MPI_CHAR) n = *recvcounts*sizeof(char); else if (datatype == MPI_BYTE) n = *recvcounts*sizeof(char); - else if (datatype == MPI_UNSIGNED_LONG) n = *recvcounts*sizeof(uint64_t); + else if (datatype == MPI_UNSIGNED_LONG_LONG) n = *recvcounts*sizeof(uint64_t); else if (datatype == MPI_DOUBLE_INT) n = *recvcounts*sizeof(double_int); memcpy(recvbuf,sendbuf,n); @@ -384,7 +384,7 @@ int MPI_Gather(void *sendbuf, int sendcount, MPI_Datatype sendtype, else if (sendtype == MPI_DOUBLE) n = sendcount*sizeof(double); else if (sendtype == MPI_CHAR) n = sendcount*sizeof(char); else if (sendtype == MPI_BYTE) n = sendcount*sizeof(char); - else if (sendtype == MPI_UNSIGNED_LONG) n = sendcount*sizeof(uint64_t); + else if (sendtype == MPI_UNSIGNED_LONG_LONG) n = sendcount*sizeof(uint64_t); else if (sendtype == MPI_DOUBLE_INT) n = sendcount*sizeof(double_int); memcpy(recvbuf,sendbuf,n); @@ -405,7 +405,7 @@ int MPI_Gatherv(void *sendbuf, int sendcount, MPI_Datatype sendtype, else if (sendtype == MPI_DOUBLE) n = sendcount*sizeof(double); else if (sendtype == MPI_CHAR) n = sendcount*sizeof(char); else if (sendtype == MPI_BYTE) n = sendcount*sizeof(char); - else if (sendtype == MPI_UNSIGNED_LONG) n = sendcount*sizeof(uint64_t); + else if (sendtype == MPI_UNSIGNED_LONG_LONG) n = sendcount*sizeof(uint64_t); else if (sendtype == MPI_DOUBLE_INT) n = sendcount*sizeof(double_int); memcpy(recvbuf,sendbuf,n); diff --git a/src/STUBS/mpi.h b/src/STUBS/mpi.h index d9874d79ec..8c70c9f0fd 100644 --- a/src/STUBS/mpi.h +++ b/src/STUBS/mpi.h @@ -25,7 +25,7 @@ #define MPI_DOUBLE 3 #define MPI_CHAR 4 #define MPI_BYTE 5 -#define MPI_UNSIGNED_LONG 6 +#define MPI_UNSIGNED_LONG_LONG 6 #define MPI_DOUBLE_INT 7 #define MPI_SUM 1 diff --git a/src/compute_reduce.cpp b/src/compute_reduce.cpp index 0e07f95dd1..db9c3b6a6b 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,MPI_SUM,world); + MPI_Allreduce(&ncount,&ncountall,1,MPI_UNSIGNED_LONG_LONG,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,MPI_SUM,world); + MPI_Allreduce(&ncount,&ncountall,1,MPI_UNSIGNED_LONG_LONG,MPI_SUM,world); return ncountall; } } else if (which[m] == VARIABLE) diff --git a/src/create_atoms.cpp b/src/create_atoms.cpp index 5f54d8fe80..e895c68531 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,MPI_SUM,world); + MPI_Allreduce(&nblocal,&atom->natoms,1,MPI_UNSIGNED_LONG_LONG,MPI_SUM,world); // print status diff --git a/src/delete_atoms.cpp b/src/delete_atoms.cpp index b2fec4e2a7..1fcf224b0f 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,MPI_SUM,world); + MPI_Allreduce(&nblocal,&atom->natoms,1,MPI_UNSIGNED_LONG_LONG,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 424e39750a..3b8d7da8f3 100644 --- a/src/delete_bonds.cpp +++ b/src/delete_bonds.cpp @@ -341,14 +341,14 @@ 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,MPI_SUM,world); + MPI_Allreduce(&nbonds,&atom->nbonds,1,MPI_UNSIGNED_LONG_LONG,MPI_SUM,world); if (force->newton_bond == 0) atom->nbonds /= 2; } 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,MPI_SUM,world); + MPI_Allreduce(&nangles,&atom->nangles,1,MPI_UNSIGNED_LONG_LONG,MPI_SUM,world); if (force->newton_bond == 0) atom->nangles /= 3; } @@ -356,7 +356,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,MPI_SUM,world); + 1,MPI_UNSIGNED_LONG_LONG,MPI_SUM,world); if (force->newton_bond == 0) atom->ndihedrals /= 4; } @@ -364,7 +364,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,MPI_SUM,world); + 1,MPI_UNSIGNED_LONG_LONG,MPI_SUM,world); if (force->newton_bond == 0) atom->nimpropers /= 4; } @@ -384,9 +384,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,MPI_SUM,world); + MPI_Allreduce(&bond_on,&tmp,1,MPI_UNSIGNED_LONG_LONG,MPI_SUM,world); bond_on = tmp; - MPI_Allreduce(&bond_off,&tmp,1,MPI_UNSIGNED_LONG,MPI_SUM,world); + MPI_Allreduce(&bond_off,&tmp,1,MPI_UNSIGNED_LONG_LONG,MPI_SUM,world); bond_off = tmp; if (force->newton_bond == 0) { bond_on /= 2; @@ -400,9 +400,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,MPI_SUM,world); + MPI_Allreduce(&angle_on,&tmp,1,MPI_UNSIGNED_LONG_LONG,MPI_SUM,world); angle_on = tmp; - MPI_Allreduce(&angle_off,&tmp,1,MPI_UNSIGNED_LONG,MPI_SUM,world); + MPI_Allreduce(&angle_off,&tmp,1,MPI_UNSIGNED_LONG_LONG,MPI_SUM,world); angle_off = tmp; if (force->newton_bond == 0) { angle_on /= 3; @@ -416,9 +416,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,MPI_SUM,world); + MPI_Allreduce(&dihedral_on,&tmp,1,MPI_UNSIGNED_LONG_LONG,MPI_SUM,world); dihedral_on = tmp; - MPI_Allreduce(&dihedral_off,&tmp,1,MPI_UNSIGNED_LONG,MPI_SUM,world); + MPI_Allreduce(&dihedral_off,&tmp,1,MPI_UNSIGNED_LONG_LONG,MPI_SUM,world); dihedral_off = tmp; if (force->newton_bond == 0) { dihedral_on /= 4; @@ -432,9 +432,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,MPI_SUM,world); + MPI_Allreduce(&improper_on,&tmp,1,MPI_UNSIGNED_LONG_LONG,MPI_SUM,world); improper_on = tmp; - MPI_Allreduce(&improper_off,&tmp,1,MPI_UNSIGNED_LONG,MPI_SUM,world); + MPI_Allreduce(&improper_off,&tmp,1,MPI_UNSIGNED_LONG_LONG,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 bd9171106c..4a9be6df28 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,MPI_SUM,world); + MPI_Allreduce(&nblocal,&natoms,1,MPI_UNSIGNED_LONG_LONG,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 a8b5b351f8..33d1a3137c 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,MPI_SUM,world); + MPI_Allreduce(&nblocal,&natoms,1,MPI_UNSIGNED_LONG_LONG,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/finish.cpp b/src/finish.cpp index 4512a3f97c..1292cc7bf7 100644 --- a/src/finish.cpp +++ b/src/finish.cpp @@ -87,7 +87,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,MPI_SUM,world); + MPI_Allreduce(&nblocal,&natoms,1,MPI_UNSIGNED_LONG_LONG,MPI_SUM,world); if (me == 0) { if (screen) diff --git a/src/group.cpp b/src/group.cpp index bd517d79e1..b2ee3c4afd 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,MPI_SUM,world); + MPI_Allreduce(&nsingle,&nall,1,MPI_UNSIGNED_LONG_LONG,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,MPI_SUM,world); + MPI_Allreduce(&nsingle,&nall,1,MPI_UNSIGNED_LONG_LONG,MPI_SUM,world); return nall; } diff --git a/src/lammps.cpp b/src/lammps.cpp index 11c4a6b3c9..6b87c0a33b 100644 --- a/src/lammps.cpp +++ b/src/lammps.cpp @@ -241,6 +241,16 @@ LAMMPS::LAMMPS(int narg, char **arg, MPI_Comm communicator) } } + // check datatype sizes + + if (sizeof(bigint) != 8) + error->all("No support for 8-byte unsigned integers"); + + int mpisize; + MPI_Type_size(MPI_UNSIGNED_LONG_LONG,&mpisize); + if (mpisize != 8) + error->all("MPI_UNSIGNED_LONG_LONG is not 8-byte data type"); + // allocate input class now that MPI is fully setup input = new Input(this,narg,arg); diff --git a/src/memory.cpp b/src/memory.cpp index c4eb9eba2a..df8cff685d 100644 --- a/src/memory.cpp +++ b/src/memory.cpp @@ -23,18 +23,7 @@ using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ -Memory::Memory(LAMMPS *lmp) : Pointers(lmp) -{ - // check datatype sizes - - if (sizeof(bigint) != 8) - error->all("No support for 8-byte unsigned integers"); - - int mpisize; - MPI_Type_size(MPI_UNSIGNED_LONG,&mpisize); - if (mpisize != 8) - error->all("MPI_UNSIGNED_LONG is not 8-byte data type"); -} +Memory::Memory(LAMMPS *lmp) : Pointers(lmp) {} /* ---------------------------------------------------------------------- safe malloc diff --git a/src/min.cpp b/src/min.cpp index bbac6428e6..8f58ceae55 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,MPI_SUM,world); + MPI_Allreduce(&ndofme,&ndoftotal,1,MPI_UNSIGNED_LONG_LONG,MPI_SUM,world); ndoftotal += nextra_global; // setup domain, communication and neighboring diff --git a/src/read_data.cpp b/src/read_data.cpp index 7ed1e58492..f8229bdfd0 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,MPI_SUM,world); + MPI_Allreduce(&tmp,&natoms,1,MPI_UNSIGNED_LONG_LONG,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,MPI_SUM,world); + MPI_Allreduce(&n,&sum,1,MPI_UNSIGNED_LONG_LONG,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,MPI_SUM,world); + MPI_Allreduce(&n,&sum,1,MPI_UNSIGNED_LONG_LONG,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,MPI_SUM,world); + MPI_Allreduce(&n,&sum,1,MPI_UNSIGNED_LONG_LONG,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,MPI_SUM,world); + MPI_Allreduce(&n,&sum,1,MPI_UNSIGNED_LONG_LONG,MPI_SUM,world); int factor = 1; if (!force->newton_bond) factor = 4; diff --git a/src/read_restart.cpp b/src/read_restart.cpp index 9e0bd656b1..f325bc67b2 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,MPI_SUM,world); + MPI_Allreduce(&nblocal,&natoms,1,MPI_UNSIGNED_LONG_LONG,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,0,world); + MPI_Bcast(&value,1,MPI_UNSIGNED_LONG_LONG,0,world); return value; } diff --git a/src/replicate.cpp b/src/replicate.cpp index 9798b0a09b..a4e02bd12a 100644 --- a/src/replicate.cpp +++ b/src/replicate.cpp @@ -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,MPI_SUM,world); + MPI_Allreduce(&nblocal,&natoms,1,MPI_UNSIGNED_LONG_LONG,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 60997baf29..042a28fcea 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,MPI_SUM,world); + MPI_Allreduce(&nblocal,&ntotal,1,MPI_UNSIGNED_LONG_LONG,MPI_SUM,world); if (ntotal == atom->natoms) return ntotal; // if not checking or already warned, just return diff --git a/src/write_restart.cpp b/src/write_restart.cpp index 44e3de2637..25cba1c04d 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,MPI_SUM,world); + MPI_Allreduce(&nblocal,&natoms,1,MPI_UNSIGNED_LONG_LONG,MPI_SUM,world); if (natoms != atom->natoms && output->thermo->lostflag == ERROR) error->all("Atom count is inconsistent, cannot write restart file");