From fff28a8666f89b5b690c86e78d288f0867b04f40 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 26 Mar 2019 11:17:21 -0400 Subject: [PATCH] remove trailing whitespace --- src/RIGID/fix_rigid_small.cpp | 16 +++---- src/RIGID/fix_shake.cpp | 78 ++++++++++++++++----------------- src/RIGID/fix_shake.h | 2 +- src/comm.cpp | 46 ++++++++++---------- src/comm.h | 12 ++--- src/hashlittle.cpp | 12 ++--- src/irregular.cpp | 2 +- src/special.cpp | 82 +++++++++++++++++------------------ src/special.h | 2 +- 9 files changed, 126 insertions(+), 126 deletions(-) diff --git a/src/RIGID/fix_rigid_small.cpp b/src/RIGID/fix_rigid_small.cpp index d74dd0fc3b..afd597ef8e 100644 --- a/src/RIGID/fix_rigid_small.cpp +++ b/src/RIGID/fix_rigid_small.cpp @@ -601,7 +601,7 @@ void FixRigidSmall::init() // for atom types in rigid bodies - need a more careful test double cutghost = MAX(neighbor->cutneighmax,comm->cutghostuser); - if (maxextent > cutghost) + if (maxextent > cutghost) error->all(FLERR,"Rigid body extent > ghost cutoff - use comm_modify cutoff"); // error if npt,nph fix comes before rigid fix @@ -1549,7 +1549,7 @@ void FixRigidSmall::create_bodies(tagint *bodyID) // allocate buffer for input to rendezvous comm // ncount = # of my atoms in bodies - + int *mask = atom->mask; int nlocal = atom->nlocal; @@ -1559,7 +1559,7 @@ void FixRigidSmall::create_bodies(tagint *bodyID) int *proclist; memory->create(proclist,ncount,"rigid/small:proclist"); - InRvous *inbuf = (InRvous *) + InRvous *inbuf = (InRvous *) memory->smalloc(ncount*sizeof(InRvous),"rigid/small:inbuf"); // setup buf to pass to rendezvous comm @@ -1594,13 +1594,13 @@ void FixRigidSmall::create_bodies(tagint *bodyID) rendezvous_body,0,buf,sizeof(OutRvous), (void *) this); OutRvous *outbuf = (OutRvous *) buf; - + memory->destroy(proclist); memory->sfree(inbuf); // set bodytag of all owned atoms based on outbuf info for constituent atoms - for (i = 0; i < nlocal; i++) + for (i = 0; i < nlocal; i++) if (!(mask[i] & groupbit)) bodytag[i] = 0; for (m = 0; m < nreturn; m++) @@ -1650,7 +1650,7 @@ int FixRigidSmall::rendezvous_body(int n, char *inbuf, InRvous *in = (InRvous *) inbuf; std::map hash; tagint id; - + int ncount = 0; for (i = 0; i < n; i++) { id = in[i].bodyID; @@ -1722,7 +1722,7 @@ int FixRigidSmall::rendezvous_body(int n, char *inbuf, // compute rsqfar for all bodies I own // set rsqfar back in caller - + double rsqfar = 0.0; for (int i = 0; i < n; i++) { @@ -1742,7 +1742,7 @@ int FixRigidSmall::rendezvous_body(int n, char *inbuf, int nout = n; memory->create(proclist,nout,"rigid/small:proclist"); - OutRvous *out = (OutRvous *) + OutRvous *out = (OutRvous *) memory->smalloc(nout*sizeof(OutRvous),"rigid/small:out"); for (int i = 0; i < nout; i++) { diff --git a/src/RIGID/fix_shake.cpp b/src/RIGID/fix_shake.cpp index dcdb190d45..6293028090 100644 --- a/src/RIGID/fix_shake.cpp +++ b/src/RIGID/fix_shake.cpp @@ -816,7 +816,7 @@ void FixShake::find_clusters() MPI_Allreduce(&flag,&flag_all,1,MPI_INT,MPI_SUM,world); if (flag_all) error->all(FLERR,"Did not find fix shake partner info"); - + // ----------------------------------------------------- // identify SHAKEable bonds // set nshake[i] = # of SHAKE bonds attached to atom i @@ -873,7 +873,7 @@ void FixShake::find_clusters() // ----------------------------------------------------- nshake_info(npartner,partner_tag,partner_nshake); - + // ----------------------------------------------------- // error checks // no atom with nshake > 3 @@ -1052,7 +1052,7 @@ void FixShake::atom_owners() int *proclist; memory->create(proclist,nlocal,"shake:proclist"); - IDRvous *idbuf = (IDRvous *) + IDRvous *idbuf = (IDRvous *) memory->smalloc((bigint) nlocal*sizeof(IDRvous),"shake:idbuf"); // setup input buf to rendezvous comm @@ -1068,7 +1068,7 @@ void FixShake::atom_owners() // perform rendezvous operation // each proc assigned every 1/Pth atom - + char *buf; comm->rendezvous(RVOUS,nlocal,(char *) idbuf,sizeof(IDRvous), 0,proclist, @@ -1091,7 +1091,7 @@ void FixShake::partner_info(int *npartner, tagint **partner_tag, // nsend = # of my datums to send // one datum for every off-processor partner - + int nsend = 0; for (i = 0; i < nlocal; i++) { for (j = 0; j < npartner[i]; j++) { @@ -1102,7 +1102,7 @@ void FixShake::partner_info(int *npartner, tagint **partner_tag, int *proclist; memory->create(proclist,nsend,"special:proclist"); - PartnerInfo *inbuf = (PartnerInfo *) + PartnerInfo *inbuf = (PartnerInfo *) memory->smalloc((bigint) nsend*sizeof(PartnerInfo),"special:inbuf"); // set values in 4 partner arrays for all partner atoms I own @@ -1117,9 +1117,9 @@ void FixShake::partner_info(int *npartner, tagint **partner_tag, int *type = atom->type; int *mask = atom->mask; tagint *tag = atom->tag; - + double massone; - + nsend = 0; for (i = 0; i < nlocal; i++) { for (j = 0; j < npartner[i]; j++) { @@ -1129,7 +1129,7 @@ void FixShake::partner_info(int *npartner, tagint **partner_tag, partner_bondtype[i][j] = 0; m = atom->map(partner_tag[i][j]); - + if (m >= 0 && m < nlocal) { partner_mask[i][j] = mask[m]; partner_type[i][j] = type[m]; @@ -1182,13 +1182,13 @@ void FixShake::partner_info(int *npartner, tagint **partner_tag, 0,buf,sizeof(PartnerInfo), (void *) this); PartnerInfo *outbuf = (PartnerInfo *) buf; - + memory->destroy(proclist); memory->sfree(inbuf); // set partner 4 values for un-onwed partners based on output info // outbuf.atomID = my owned atom, outbuf.partnerID = partner the info is for - + for (m = 0; m < nreturn; m++) { i = atom->map(outbuf[m].atomID); for (j = 0; j < npartner[i]; j++) @@ -1200,7 +1200,7 @@ void FixShake::partner_info(int *npartner, tagint **partner_tag, // only set partner_bondtype if my atom did not set it // when setting up rendezvous // if this proc set it, then sender of this datum set outbuf.bondtype = 0 - + if (partner_bondtype[i][j] == 0) partner_bondtype[i][j] = outbuf[m].bondtype; } @@ -1220,7 +1220,7 @@ void FixShake::nshake_info(int *npartner, tagint **partner_tag, // nsend = # of my datums to send // one datum for every off-processor partner - + int nsend = 0; for (i = 0; i < nlocal; i++) { for (j = 0; j < npartner[i]; j++) { @@ -1231,7 +1231,7 @@ void FixShake::nshake_info(int *npartner, tagint **partner_tag, int *proclist; memory->create(proclist,nsend,"special:proclist"); - NShakeInfo *inbuf = (NShakeInfo *) + NShakeInfo *inbuf = (NShakeInfo *) memory->smalloc((bigint) nsend*sizeof(NShakeInfo),"special:inbuf"); // set partner_nshake for all partner atoms I own @@ -1270,7 +1270,7 @@ void FixShake::nshake_info(int *npartner, tagint **partner_tag, rendezvous_nshake,0,buf,sizeof(NShakeInfo), (void *) this); NShakeInfo *outbuf = (NShakeInfo *) buf; - + memory->destroy(proclist); memory->sfree(inbuf); @@ -1299,7 +1299,7 @@ void FixShake::shake_info(int *npartner, tagint **partner_tag, // nsend = # of my datums to send // one datum for every off-processor partner - + int nsend = 0; for (i = 0; i < nlocal; i++) { for (j = 0; j < npartner[i]; j++) { @@ -1310,7 +1310,7 @@ void FixShake::shake_info(int *npartner, tagint **partner_tag, int *proclist; memory->create(proclist,nsend,"special:proclist"); - ShakeInfo *inbuf = (ShakeInfo *) + ShakeInfo *inbuf = (ShakeInfo *) memory->smalloc((bigint) nsend*sizeof(ShakeInfo),"special:inbuf"); // set 3 shake arrays for all partner atoms I own @@ -1326,7 +1326,7 @@ void FixShake::shake_info(int *npartner, tagint **partner_tag, for (j = 0; j < npartner[i]; j++) { if (partner_shake[i][j] == 0) continue; m = atom->map(partner_tag[i][j]); - + if (m >= 0 && m < nlocal) { shake_flag[m] = shake_flag[i]; shake_atom[m][0] = shake_atom[i][0]; @@ -1363,7 +1363,7 @@ void FixShake::shake_info(int *npartner, tagint **partner_tag, rendezvous_shake,0,buf,sizeof(ShakeInfo), (void *) this); ShakeInfo *outbuf = (ShakeInfo *) buf; - + memory->destroy(proclist); memory->sfree(inbuf); @@ -1399,10 +1399,10 @@ int FixShake::rendezvous_ids(int n, char *inbuf, tagint *atomIDs; int *procowner; - + memory->create(atomIDs,n,"special:atomIDs"); memory->create(procowner,n,"special:procowner"); - + IDRvous *in = (IDRvous *) inbuf; for (int i = 0; i < n; i++) { @@ -1411,13 +1411,13 @@ int FixShake::rendezvous_ids(int n, char *inbuf, } // store rendezvous data in FixShake class - + fsptr->nrvous = n; fsptr->atomIDs = atomIDs; fsptr->procowner = procowner; // flag = 0: no second comm needed in rendezvous - + flag = 0; return 0; } @@ -1433,7 +1433,7 @@ int FixShake::rendezvous_partners_info(int n, char *inbuf, void *ptr) { int i,m; - + FixShake *fsptr = (FixShake *) ptr; Atom *atom = fsptr->atom; Memory *memory = fsptr->memory; @@ -1444,7 +1444,7 @@ int FixShake::rendezvous_partners_info(int n, char *inbuf, atom->map_clear(); // hash atom IDs stored in rendezvous decomposition - + int nrvous = fsptr->nrvous; tagint *atomIDs = fsptr->atomIDs; @@ -1453,7 +1453,7 @@ int FixShake::rendezvous_partners_info(int n, char *inbuf, // proclist = owner of atomID in caller decomposition // outbuf = info about owned atomID = 4 values - + PartnerInfo *in = (PartnerInfo *) inbuf; int *procowner = fsptr->procowner; memory->create(proclist,n,"shake:proclist"); @@ -1467,7 +1467,7 @@ int FixShake::rendezvous_partners_info(int n, char *inbuf, } outbuf = inbuf; - + // re-create atom map atom->map_init(0); @@ -1475,7 +1475,7 @@ int FixShake::rendezvous_partners_info(int n, char *inbuf, atom->map_set(); // flag = 1: outbuf = inbuf - + flag = 1; return n; } @@ -1491,7 +1491,7 @@ int FixShake::rendezvous_nshake(int n, char *inbuf, void *ptr) { int i,j,m; - + FixShake *fsptr = (FixShake *) ptr; Atom *atom = fsptr->atom; Memory *memory = fsptr->memory; @@ -1502,7 +1502,7 @@ int FixShake::rendezvous_nshake(int n, char *inbuf, atom->map_clear(); // hash atom IDs stored in rendezvous decomposition - + int nrvous = fsptr->nrvous; tagint *atomIDs = fsptr->atomIDs; @@ -1511,18 +1511,18 @@ int FixShake::rendezvous_nshake(int n, char *inbuf, // proclist = owner of atomID in caller decomposition // outbuf = info about owned atomID - + NShakeInfo *in = (NShakeInfo *) inbuf; int *procowner = fsptr->procowner; memory->create(proclist,n,"shake:proclist"); - + for (i = 0; i < n; i++) { m = atom->map(in[i].atomID); proclist[i] = procowner[m]; } outbuf = inbuf; - + // re-create atom map atom->map_init(0); @@ -1530,7 +1530,7 @@ int FixShake::rendezvous_nshake(int n, char *inbuf, atom->map_set(); // flag = 1: outbuf = inbuf - + flag = 1; return n; } @@ -1545,7 +1545,7 @@ int FixShake::rendezvous_shake(int n, char *inbuf, void *ptr) { int i,j,m; - + FixShake *fsptr = (FixShake *) ptr; Atom *atom = fsptr->atom; Memory *memory = fsptr->memory; @@ -1556,7 +1556,7 @@ int FixShake::rendezvous_shake(int n, char *inbuf, atom->map_clear(); // hash atom IDs stored in rendezvous decomposition - + int nrvous = fsptr->nrvous; tagint *atomIDs = fsptr->atomIDs; @@ -1565,7 +1565,7 @@ int FixShake::rendezvous_shake(int n, char *inbuf, // proclist = owner of atomID in caller decomposition // outbuf = info about owned atomID - + ShakeInfo *in = (ShakeInfo *) inbuf; int *procowner = fsptr->procowner; memory->create(proclist,n,"shake:proclist"); @@ -1576,7 +1576,7 @@ int FixShake::rendezvous_shake(int n, char *inbuf, } outbuf = inbuf; - + // re-create atom map atom->map_init(0); @@ -1584,7 +1584,7 @@ int FixShake::rendezvous_shake(int n, char *inbuf, atom->map_set(); // flag = 1: outbuf = inbuf; - + flag = 1; return n; } diff --git a/src/RIGID/fix_shake.h b/src/RIGID/fix_shake.h index b99a35f958..ee9f520fea 100644 --- a/src/RIGID/fix_shake.h +++ b/src/RIGID/fix_shake.h @@ -124,7 +124,7 @@ class FixShake : public Fix { void partner_info(int *, tagint **, int **, int **, int **, int **); void nshake_info(int *, tagint **, int **); void shake_info(int *, tagint **, int **); - + int masscheck(double); void unconstrained_update(); void unconstrained_update_respa(int); diff --git a/src/comm.cpp b/src/comm.cpp index 729f96581a..dc117d2631 100644 --- a/src/comm.cpp +++ b/src/comm.cpp @@ -738,7 +738,7 @@ void Comm::ring(int n, int nper, void *inbuf, int messtag, inbuf = vector of input datums insize = byte size of each input datum inorder = 0 for inbuf in random proc order, 1 for datums ordered by proc - procs: inorder 0 = proc to send each datum to, 1 = # of datums/proc, + procs: inorder 0 = proc to send each datum to, 1 = # of datums/proc, callback = caller function to invoke in rendezvous decomposition takes input datums, returns output datums outorder = same as inorder, but for datums returned by callback() @@ -781,11 +781,11 @@ rendezvous(int which, int n, char *inbuf, int insize, int Comm:: rendezvous_irregular(int n, char *inbuf, int insize, int inorder, int *procs, int (*callback)(int, char *, int &, int *&, char *&, void *), - int outorder, char *&outbuf, + int outorder, char *&outbuf, int outsize, void *ptr, int statflag) { // irregular comm of inbuf from caller decomp to rendezvous decomp - + Irregular *irregular = new Irregular(lmp); int nrvous; @@ -812,7 +812,7 @@ rendezvous_irregular(int n, char *inbuf, int insize, int inorder, int *procs, if (flag != 1) memory->sfree(inbuf_rvous); // outbuf_rvous = inbuf_vous if (flag == 0) { if (statflag) rendezvous_stats(n,0,nrvous,nrvous_out,insize,outsize, - (bigint) nrvous_out*sizeof(int) + + (bigint) nrvous_out*sizeof(int) + irregular1_bytes); return 0; // all nout_rvous are 0, no 2nd comm stage } @@ -821,9 +821,9 @@ rendezvous_irregular(int n, char *inbuf, int insize, int inorder, int *procs, // caller will free outbuf irregular = new Irregular(lmp); - + int nout; - if (outorder) + if (outorder) nout = irregular->create_data_grouped(nrvous_out,procs_rvous); else nout = irregular->create_data(nrvous_out,procs_rvous); @@ -842,7 +842,7 @@ rendezvous_irregular(int n, char *inbuf, int insize, int inorder, int *procs, // last arg to stats() = memory for procs_rvous + irregular comm if (statflag) rendezvous_stats(n,nout,nrvous,nrvous_out,insize,outsize, - (bigint) nrvous_out*sizeof(int) + + (bigint) nrvous_out*sizeof(int) + MAX(irregular1_bytes,irregular2_bytes)); return nout; } @@ -863,7 +863,7 @@ rendezvous_all2all(int n, char *inbuf, int insize, int inorder, int *procs, char *inbuf_a2a,*outbuf_a2a; // create procs and inbuf for All2all if necesary - + if (!inorder) { memory->create(procs_a2a,nprocs,"rendezvous:procs"); inbuf_a2a = (char *) memory->smalloc((bigint) n*insize, @@ -894,10 +894,10 @@ rendezvous_all2all(int n, char *inbuf, int insize, int inorder, int *procs, } // create args for MPI_Alltoallv() on input data - + memory->create(sendcount,nprocs,"rendezvous:sendcount"); memcpy(sendcount,procs_a2a,nprocs*sizeof(int)); - + memory->create(recvcount,nprocs,"rendezvous:recvcount"); MPI_Alltoall(sendcount,1,MPI_INT,recvcount,1,MPI_INT,world); @@ -912,14 +912,14 @@ rendezvous_all2all(int n, char *inbuf, int insize, int inorder, int *procs, // test for overflow of input data due to imbalance or insize // means that individual sdispls or rdispls values overflow - + int overflow = 0; if ((bigint) n*insize > MAXSMALLINT) overflow = 1; if ((bigint) nrvous*insize > MAXSMALLINT) overflow = 1; int overflowall; MPI_Allreduce(&overflow,&overflowall,1,MPI_INT,MPI_MAX,world); if (overflowall) error->all(FLERR,"Overflow input size in rendezvous_a2a"); - + for (int i = 0; i < nprocs; i++) { sendcount[i] *= insize; sdispls[i] *= insize; @@ -958,7 +958,7 @@ rendezvous_all2all(int n, char *inbuf, int insize, int inorder, int *procs, memory->destroy(sdispls); memory->destroy(rdispls); if (statflag) rendezvous_stats(n,0,nrvous,nrvous_out,insize,outsize, - (bigint) nrvous_out*sizeof(int) + + (bigint) nrvous_out*sizeof(int) + 4*nprocs*sizeof(int) + all2all1_bytes); return 0; // all nout_rvous are 0, no 2nd irregular } @@ -969,7 +969,7 @@ rendezvous_all2all(int n, char *inbuf, int insize, int inorder, int *procs, // create procs and outbuf for All2all if necesary - + if (!outorder) { memory->create(procs_a2a,nprocs,"rendezvous_a2a:procs"); @@ -991,8 +991,8 @@ rendezvous_all2all(int n, char *inbuf, int insize, int inorder, int *procs, offsets[iproc] += outsize; offset += outsize; } - - all2all2_bytes = nprocs*sizeof(int) + nprocs*sizeof(bigint) + + + all2all2_bytes = nprocs*sizeof(int) + nprocs*sizeof(bigint) + nrvous_out*outsize; } else { @@ -1004,9 +1004,9 @@ rendezvous_all2all(int n, char *inbuf, int insize, int inorder, int *procs, // comm outbuf from rendezvous decomposition back to caller memcpy(sendcount,procs_a2a,nprocs*sizeof(int)); - + MPI_Alltoall(sendcount,1,MPI_INT,recvcount,1,MPI_INT,world); - + sdispls[0] = rdispls[0] = 0; for (int i = 1; i < nprocs; i++) { sdispls[i] = sdispls[i-1] + sendcount[i-1]; @@ -1016,13 +1016,13 @@ rendezvous_all2all(int n, char *inbuf, int insize, int inorder, int *procs, // test for overflow of outbuf due to imbalance or outsize // means that individual sdispls or rdispls values overflow - + overflow = 0; if ((bigint) nrvous*outsize > MAXSMALLINT) overflow = 1; if ((bigint) nout*outsize > MAXSMALLINT) overflow = 1; MPI_Allreduce(&overflow,&overflowall,1,MPI_INT,MPI_MAX,world); if (overflowall) error->all(FLERR,"Overflow output in rendezvous_a2a"); - + for (int i = 0; i < nprocs; i++) { sendcount[i] *= outsize; sdispls[i] *= outsize; @@ -1058,8 +1058,8 @@ rendezvous_all2all(int n, char *inbuf, int insize, int inorder, int *procs, // last arg to stats() = mem for procs_rvous + per-proc vecs + reordering ops if (statflag) rendezvous_stats(n,nout,nrvous,nrvous_out,insize,outsize, - (bigint) nrvous_out*sizeof(int) + - 4*nprocs*sizeof(int) + + (bigint) nrvous_out*sizeof(int) + + 4*nprocs*sizeof(int) + MAX(all2all1_bytes,all2all2_bytes)); return nout; } @@ -1120,7 +1120,7 @@ void Comm::rendezvous_stats(int n, int nout, int nrvous, int nrvous_out, BIGINT_FORMAT " %g " BIGINT_FORMAT " " BIGINT_FORMAT "\n", size_out_all/outsize,1.0*size_out_all/nprocs/outsize, size_out_max/outsize,size_out_min/outsize); - else + else fprintf(screen," output datum count: " BIGINT_FORMAT " %g " BIGINT_FORMAT " " BIGINT_FORMAT "\n", 0,0.0,0,0); diff --git a/src/comm.h b/src/comm.h index 9c0112b4c4..30360b1059 100644 --- a/src/comm.h +++ b/src/comm.h @@ -109,8 +109,8 @@ class Comm : protected Pointers { void ring(int, int, void *, int, void (*)(int, char *, void *), void *, void *, int self = 1); - int rendezvous(int, int, char *, int, int, int *, - int (*)(int, char *, int &, int *&, char *&, void *), + int rendezvous(int, int, char *, int, int, int *, + int (*)(int, char *, int &, int *&, char *&, void *), int, char *&, int, void *, int statflag=0); int read_lines_from_file(FILE *, int, int, char *); @@ -147,11 +147,11 @@ class Comm : protected Pointers { int coregrid[3]; // 3d grid of cores within a node int user_coregrid[3]; // user request for cores in each dim - int rendezvous_irregular(int, char *, int, int, int *, - int (*)(int, char *, int &, int *&, char *&, void *), + int rendezvous_irregular(int, char *, int, int, int *, + int (*)(int, char *, int &, int *&, char *&, void *), int, char *&, int, void *, int); - int rendezvous_all2all(int, char *, int, int, int *, - int (*)(int, char *, int &, int *&, char *&, void *), + int rendezvous_all2all(int, char *, int, int, int *, + int (*)(int, char *, int &, int *&, char *&, void *), int, char *&, int, void *, int); void rendezvous_stats(int, int, int, int, int, int, bigint); diff --git a/src/hashlittle.cpp b/src/hashlittle.cpp index f1d4e61142..b6932efa8d 100644 --- a/src/hashlittle.cpp +++ b/src/hashlittle.cpp @@ -43,7 +43,7 @@ This was tested for: the output delta to a Gray code (a^(a>>1)) so a string of 1's (as is commonly produced by subtraction) look like a single 1-bit difference. -* the base values were pseudorandom, all zero but one bit set, or +* the base values were pseudorandom, all zero but one bit set, or all zero plus a counter that starts at zero. Some k values for my "a-=c; a^=rot(c,k); c+=b;" arrangement that @@ -53,7 +53,7 @@ satisfy this are 14 9 3 7 17 3 Well, "9 15 3 18 27 15" didn't quite get 32 bits diffing for "differ" defined as + with a one-bit base and a two-bit delta. I -used http://burtleburtle.net/bob/hash/avalanche.html to choose +used http://burtleburtle.net/bob/hash/avalanche.html to choose the operations, constants, and arrangements of the variables. This does not achieve avalanche. There are input bits of (a,b,c) @@ -92,7 +92,7 @@ produce values of c that look totally different. This was tested for the output delta to a Gray code (a^(a>>1)) so a string of 1's (as is commonly produced by subtraction) look like a single 1-bit difference. -* the base values were pseudorandom, all zero but one bit set, or +* the base values were pseudorandom, all zero but one bit set, or all zero plus a counter that starts at zero. These constants passed: @@ -169,7 +169,7 @@ uint32_t hashlittle( const void *key, size_t length, uint32_t initval) } /*----------------------------- handle the last (probably partial) block */ - /* + /* * "k[2]&0xffffff" actually reads beyond the end of the string, but * then masks off the part it's not allowed to read. Because the * string is aligned, the masked-off tail is in the same word as the @@ -314,9 +314,9 @@ uint32_t hashlittle( const void *key, size_t length, uint32_t initval) #else /* PURIFY_HATES_HASHLITTLE */ /* I don't know what it is about Jenkins' hashlittle function, but - * it drives purify insane, even with VALGRIND defined. It makes + * it drives purify insane, even with VALGRIND defined. It makes * purify unusable!! The code execution doesn't even make sense. - * Below is a (probably) weaker hash function that at least allows + * Below is a (probably) weaker hash function that at least allows * testing with purify. */ #define MAXINT_DIV_PHI 11400714819323198485U diff --git a/src/irregular.cpp b/src/irregular.cpp index c27a8c8e18..848d853f2a 100644 --- a/src/irregular.cpp +++ b/src/irregular.cpp @@ -761,7 +761,7 @@ int Irregular::create_data_grouped(int n, int *procs, int sortflag) #ifdef LAMMPS_RS_ALLREDUCE_INPLACE MPI_Allreduce(MPI_IN_PLACE,work1,nprocs,MPI_INT,MPI_SUM,world); nrecv_proc = work1[me]; -#else +#else #ifdef LAMMPS_RS_ALLREDUCE MPI_Allreduce(work1,work2,nprocs,MPI_INT,MPI_SUM,world); nrecv_proc = work2[me]; diff --git a/src/special.cpp b/src/special.cpp index b9287df472..076697084d 100644 --- a/src/special.cpp +++ b/src/special.cpp @@ -171,7 +171,7 @@ void Special::atom_owners() int *proclist; memory->create(proclist,nlocal,"special:proclist"); - IDRvous *idbuf = (IDRvous *) + IDRvous *idbuf = (IDRvous *) memory->smalloc((bigint) nlocal*sizeof(IDRvous),"special:idbuf"); // setup input buf for rendezvous comm @@ -185,7 +185,7 @@ void Special::atom_owners() } // perform rendezvous operation - + char *buf; comm->rendezvous(RVOUS,nlocal,(char *) idbuf,sizeof(IDRvous),0,proclist, rendezvous_ids,0,buf,0,(void *) this); @@ -210,7 +210,7 @@ void Special::onetwo_build_newton() int nlocal = atom->nlocal; // nsend = # of my datums to send - + int nsend = 0; for (i = 0; i < nlocal; i++) { for (j = 0; j < num_bond[i]; j++) { @@ -221,7 +221,7 @@ void Special::onetwo_build_newton() int *proclist; memory->create(proclist,nsend,"special:proclist"); - PairRvous *inbuf = (PairRvous *) + PairRvous *inbuf = (PairRvous *) memory->smalloc((bigint) nsend*sizeof(PairRvous),"special:inbuf"); // setup input buf to rendezvous comm @@ -239,7 +239,7 @@ void Special::onetwo_build_newton() nsend++; } } - + // perform rendezvous operation char *buf; @@ -248,7 +248,7 @@ void Special::onetwo_build_newton() rendezvous_pairs,0,buf,sizeof(PairRvous), (void *) this); PairRvous *outbuf = (PairRvous *) buf; - + memory->destroy(proclist); memory->sfree(inbuf); @@ -268,14 +268,14 @@ void Special::onetwo_build_newton() i = atom->map(outbuf[m].atomID); nspecial[i][0]++; } - + int max = 0; for (i = 0; i < nlocal; i++) max = MAX(max,nspecial[i][0]); - + MPI_Allreduce(&max,&maxall,1,MPI_INT,MPI_MAX,world); memory->create(onetwo,nlocal,maxall,"special:onetwo"); - + for (i = 0; i < nlocal; i++) nspecial[i][0] = 0; for (i = 0; i < nlocal; i++) { @@ -290,7 +290,7 @@ void Special::onetwo_build_newton() i = atom->map(outbuf[m].atomID); onetwo[i][nspecial[i][0]++] = outbuf[m].partnerID; } - + memory->sfree(outbuf); } @@ -311,13 +311,13 @@ void Special::onetwo_build_newton_off() int max = 0; for (i = 0; i < nlocal; i++) max = MAX(max,num_bond[i]); - + MPI_Allreduce(&max,&maxall,1,MPI_INT,MPI_MAX,world); memory->create(onetwo,nlocal,maxall,"special:onetwo"); - + // nsend = # of my datums to send // include nlocal datums with owner of each atom - + for (i = 0; i < nlocal; i++) { nspecial[i][0] = num_bond[i]; for (j = 0; j < num_bond[i]; j++) @@ -350,7 +350,7 @@ void Special::onethree_build() int *proclist; memory->create(proclist,nsend,"special:proclist"); - PairRvous *inbuf = (PairRvous *) + PairRvous *inbuf = (PairRvous *) memory->smalloc((bigint) nsend*sizeof(PairRvous),"special:inbuf"); // setup input buf to rendezvous comm @@ -402,11 +402,11 @@ void Special::onethree_build() i = atom->map(outbuf[m].atomID); nspecial[i][1]++; } - + int max = 0; for (i = 0; i < nlocal; i++) max = MAX(max,nspecial[i][1]); - + MPI_Allreduce(&max,&maxall,1,MPI_INT,MPI_MAX,world); memory->create(onethree,nlocal,maxall,"special:onethree"); @@ -456,7 +456,7 @@ void Special::onefour_build() int *proclist; memory->create(proclist,nsend,"special:proclist"); - PairRvous *inbuf = (PairRvous *) + PairRvous *inbuf = (PairRvous *) memory->smalloc((bigint) nsend*sizeof(PairRvous),"special:inbuf"); // setup input buf to rendezvous comm @@ -507,11 +507,11 @@ void Special::onefour_build() i = atom->map(outbuf[m].atomID); nspecial[i][2]++; } - + int max = 0; for (i = 0; i < nlocal; i++) max = MAX(max,nspecial[i][2]); - + MPI_Allreduce(&max,&maxall,1,MPI_INT,MPI_MAX,world); memory->create(onefour,nlocal,maxall,"special:onefour"); @@ -843,7 +843,7 @@ void Special::angle_trim() int *proclist; memory->create(proclist,nsend,"special:proclist"); - PairRvous *inbuf = (PairRvous *) + PairRvous *inbuf = (PairRvous *) memory->smalloc((bigint) nsend*sizeof(PairRvous),"special:inbuf"); // setup input buf to rendezvous comm @@ -904,7 +904,7 @@ void Special::angle_trim() } // perform rendezvous operation - + char *buf; int nreturn = comm->rendezvous(RVOUS,nsend,(char *) inbuf,sizeof(PairRvous), 0,proclist, @@ -921,18 +921,18 @@ void Special::angle_trim() for (i = 0; i < nlocal; i++) max = MAX(max,nspecial[i][1]); MPI_Allreduce(&max,&maxall,1,MPI_INT,MPI_MAX,world); - + int **flag; memory->create(flag,nlocal,maxall,"special:flag"); for (i = 0; i < nlocal; i++) for (j = 0; j < nspecial[i][1]; j++) flag[i][j] = 0; - + // reset nspecial[1] and onethree for all owned atoms based on output info // based on owned info plus rendezvous output info // output datums = pairs of atoms that are 1-3 neighbors - + for (i = 0; i < nlocal; i++) { for (j = 0; j < num_angle[i]; j++) { if (tag[i] != angle_atom2[i][j]) continue; @@ -1011,7 +1011,7 @@ void Special::angle_trim() } else j++; } } - + memory->destroy(flag); // if no angles or dihedrals are defined, delete all 1-3 neighs @@ -1089,9 +1089,9 @@ void Special::dihedral_trim() int *proclist; memory->create(proclist,nsend,"special:proclist"); - PairRvous *inbuf = (PairRvous *) + PairRvous *inbuf = (PairRvous *) memory->smalloc((bigint) nsend*sizeof(PairRvous),"special:inbuf"); - + // setup input buf to rendezvous comm // datums = pairs of onefour atom IDs in a dihedral defined for my atoms // only dihedrals where I own atom2 (in case newton_bond off) @@ -1123,7 +1123,7 @@ void Special::dihedral_trim() } // perform rendezvous operation - + char *buf; int nreturn = comm->rendezvous(RVOUS,nsend,(char *) inbuf,sizeof(PairRvous), 0,proclist, @@ -1140,14 +1140,14 @@ void Special::dihedral_trim() for (i = 0; i < nlocal; i++) max = MAX(max,nspecial[i][2]); MPI_Allreduce(&max,&maxall,1,MPI_INT,MPI_MAX,world); - + int **flag; memory->create(flag,nlocal,maxall,"special:flag"); for (i = 0; i < nlocal; i++) for (j = 0; j < nspecial[i][2]; j++) flag[i][j] = 0; - + for (i = 0; i < nlocal; i++) { for (j = 0; j < num_dihedral[i]; j++) { if (tag[i] != dihedral_atom2[i][j]) continue; @@ -1195,9 +1195,9 @@ void Special::dihedral_trim() } else j++; } } - + memory->destroy(flag); - + // if no dihedrals are defined, delete all 1-4 neighs } else { @@ -1235,10 +1235,10 @@ int Special::rendezvous_ids(int n, char *inbuf, int *procowner; tagint *atomIDs; - + memory->create(procowner,n,"special:procowner"); memory->create(atomIDs,n,"special:atomIDs"); - + IDRvous *in = (IDRvous *) inbuf; for (int i = 0; i < n; i++) { @@ -1247,17 +1247,17 @@ int Special::rendezvous_ids(int n, char *inbuf, } // store rendezvous data in Special class - + sptr->nrvous = n; sptr->procowner = procowner; sptr->atomIDs = atomIDs; // flag = 0: no second comm needed in rendezvous - + flag = 0; return 0; } - + /* ---------------------------------------------------------------------- process data for atoms assigned to me in rendezvous decomposition @@ -1279,7 +1279,7 @@ int Special::rendezvous_pairs(int n, char *inbuf, atom->map_clear(); // hash atom IDs stored in rendezvous decomposition - + int nrvous = sptr->nrvous; tagint *atomIDs = sptr->atomIDs; @@ -1287,7 +1287,7 @@ int Special::rendezvous_pairs(int n, char *inbuf, atom->map_one(atomIDs[i],i); // proclist = owner of atomID in caller decomposition - + PairRvous *in = (PairRvous *) inbuf; int *procowner = sptr->procowner; memory->create(proclist,n,"special:proclist"); @@ -1299,7 +1299,7 @@ int Special::rendezvous_pairs(int n, char *inbuf, } outbuf = inbuf; - + // re-create atom map atom->map_init(0); @@ -1307,7 +1307,7 @@ int Special::rendezvous_pairs(int n, char *inbuf, atom->map_set(); // flag = 1: outbuf = inbuf - + flag = 1; return n; } diff --git a/src/special.h b/src/special.h index d02a8522f6..10d2609536 100644 --- a/src/special.h +++ b/src/special.h @@ -45,7 +45,7 @@ class Special : protected Pointers { }; // private methods - + void atom_owners(); void onetwo_build_newton(); void onetwo_build_newton_off();