remove some more trailing whitespace
This commit is contained in:
@ -51,7 +51,7 @@ ComputeReduceChunk::ComputeReduceChunk(LAMMPS *lmp, int narg, char **arg) :
|
||||
init_chunk();
|
||||
|
||||
// mode
|
||||
|
||||
|
||||
if (strcmp(arg[4],"sum") == 0) mode = SUM;
|
||||
else if (strcmp(arg[4],"min") == 0) mode = MINN;
|
||||
else if (strcmp(arg[4],"max") == 0) mode = MAXX;
|
||||
@ -118,7 +118,7 @@ ComputeReduceChunk::ComputeReduceChunk(LAMMPS *lmp, int narg, char **arg) :
|
||||
}
|
||||
|
||||
// error check
|
||||
|
||||
|
||||
for (int i = 0; i < nvalues; i++) {
|
||||
if (which[i] == COMPUTE) {
|
||||
int icompute = modify->find_compute(ids[i]);
|
||||
@ -134,11 +134,11 @@ ComputeReduceChunk::ComputeReduceChunk(LAMMPS *lmp, int narg, char **arg) :
|
||||
if (argindex[i] && modify->compute[icompute]->size_peratom_cols == 0)
|
||||
error->all(FLERR,"Compute reduce/chunk compute does not "
|
||||
"calculate a per-atom array");
|
||||
if (argindex[i] &&
|
||||
if (argindex[i] &&
|
||||
argindex[i] > modify->compute[icompute]->size_peratom_cols)
|
||||
error->all(FLERR,
|
||||
"Compute reduce/chunk compute array is accessed out-of-range");
|
||||
|
||||
|
||||
} else if (which[i] == FIX) {
|
||||
int ifix = modify->find_fix(ids[i]);
|
||||
if (ifix < 0)
|
||||
@ -156,7 +156,7 @@ ComputeReduceChunk::ComputeReduceChunk(LAMMPS *lmp, int narg, char **arg) :
|
||||
if (argindex[i] && argindex[i] > modify->fix[ifix]->size_peratom_cols)
|
||||
error->all(FLERR,"Compute reduce/chunk fix array is "
|
||||
"accessed out-of-range");
|
||||
|
||||
|
||||
} else if (which[i] == VARIABLE) {
|
||||
int ivariable = input->variable->find(ids[i]);
|
||||
if (ivariable < 0)
|
||||
@ -181,7 +181,7 @@ ComputeReduceChunk::ComputeReduceChunk(LAMMPS *lmp, int narg, char **arg) :
|
||||
}
|
||||
|
||||
// setup
|
||||
|
||||
|
||||
if (mode == SUM) initvalue = 0.0;
|
||||
else if (mode == MINN) initvalue = BIG;
|
||||
else if (mode == MAXX) initvalue = -BIG;
|
||||
@ -199,7 +199,7 @@ ComputeReduceChunk::ComputeReduceChunk(LAMMPS *lmp, int narg, char **arg) :
|
||||
ComputeReduceChunk::~ComputeReduceChunk()
|
||||
{
|
||||
delete [] idchunk;
|
||||
|
||||
|
||||
delete [] which;
|
||||
delete [] argindex;
|
||||
for (int m = 0; m < nvalues; m++) delete [] ids[m];
|
||||
@ -210,7 +210,7 @@ ComputeReduceChunk::~ComputeReduceChunk()
|
||||
memory->destroy(vglobal);
|
||||
memory->destroy(alocal);
|
||||
memory->destroy(aglobal);
|
||||
|
||||
|
||||
memory->destroy(varatom);
|
||||
}
|
||||
|
||||
@ -284,11 +284,11 @@ void ComputeReduceChunk::compute_vector()
|
||||
}
|
||||
|
||||
// perform local reduction of single peratom value
|
||||
|
||||
|
||||
compute_one(0,vlocal,1);
|
||||
|
||||
|
||||
// reduce the per-chunk values across all procs
|
||||
|
||||
|
||||
if (mode == SUM)
|
||||
MPI_Allreduce(vlocal,vglobal,nchunk,MPI_DOUBLE,MPI_SUM,world);
|
||||
else if (mode == MINN)
|
||||
@ -296,7 +296,7 @@ void ComputeReduceChunk::compute_vector()
|
||||
else if (mode == MAXX)
|
||||
MPI_Allreduce(vlocal,vglobal,nchunk,MPI_DOUBLE,MPI_MAX,world);
|
||||
}
|
||||
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
void ComputeReduceChunk::compute_array()
|
||||
@ -324,11 +324,11 @@ void ComputeReduceChunk::compute_array()
|
||||
}
|
||||
|
||||
// perform local reduction of all peratom values
|
||||
|
||||
|
||||
for (int m = 0; m < nvalues; m++) compute_one(m,&alocal[0][m],nvalues);
|
||||
|
||||
// reduce the per-chunk values across all procs
|
||||
|
||||
|
||||
if (mode == SUM)
|
||||
MPI_Allreduce(&alocal[0][0],&aglobal[0][0],nchunk*nvalues,
|
||||
MPI_DOUBLE,MPI_SUM,world);
|
||||
@ -339,13 +339,13 @@ void ComputeReduceChunk::compute_array()
|
||||
MPI_Allreduce(&alocal[0][0],&aglobal[0][0],nchunk*nvalues,
|
||||
MPI_DOUBLE,MPI_MAX,world);
|
||||
}
|
||||
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
void ComputeReduceChunk::compute_one(int m, double *vchunk, int nstride)
|
||||
{
|
||||
// initialize per-chunk values in accumulation vector
|
||||
|
||||
|
||||
for (int i = 0; i < nchunk; i += nstride) vchunk[i] = initvalue;
|
||||
|
||||
// loop over my atoms
|
||||
@ -382,7 +382,7 @@ void ComputeReduceChunk::compute_one(int m, double *vchunk, int nstride)
|
||||
combine(vchunk[index*nstride],acompute[i][argindexm1]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// access fix fields, check if fix frequency is a match
|
||||
|
||||
} else if (which[m] == FIX) {
|
||||
|
||||
Reference in New Issue
Block a user