avoid integer overflow and remove unused function argument causing it
This commit is contained in:
@ -936,7 +936,7 @@ int Balance::shift()
|
|||||||
// stop at this point in bstr if imbalance factor < threshold
|
// stop at this point in bstr if imbalance factor < threshold
|
||||||
// this is a true 3d test of particle count per processor
|
// this is a true 3d test of particle count per processor
|
||||||
|
|
||||||
double imbfactor = imbalance_splits(max);
|
double imbfactor = imbalance_splits();
|
||||||
if (imbfactor <= stopthresh) break;
|
if (imbfactor <= stopthresh) break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1047,11 +1047,10 @@ int Balance::adjust(int n, double *split)
|
|||||||
calculate imbalance based on processor splits in 3 dims
|
calculate imbalance based on processor splits in 3 dims
|
||||||
atoms must be in lamda coords (0-1) before called
|
atoms must be in lamda coords (0-1) before called
|
||||||
map particles to 3d grid of procs
|
map particles to 3d grid of procs
|
||||||
return maxcost = max load per proc
|
|
||||||
return imbalance factor = max load per proc / ave load per proc
|
return imbalance factor = max load per proc / ave load per proc
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
double Balance::imbalance_splits(int &maxcost)
|
double Balance::imbalance_splits()
|
||||||
{
|
{
|
||||||
double *xsplit = comm->xsplit;
|
double *xsplit = comm->xsplit;
|
||||||
double *ysplit = comm->ysplit;
|
double *ysplit = comm->ysplit;
|
||||||
@ -1088,7 +1087,7 @@ double Balance::imbalance_splits(int &maxcost)
|
|||||||
|
|
||||||
MPI_Allreduce(proccost,allproccost,nprocs,MPI_DOUBLE,MPI_SUM,world);
|
MPI_Allreduce(proccost,allproccost,nprocs,MPI_DOUBLE,MPI_SUM,world);
|
||||||
|
|
||||||
maxcost = 0.0;
|
double maxcost = 0.0;
|
||||||
double totalcost = 0.0;
|
double totalcost = 0.0;
|
||||||
for (int i = 0; i < nprocs; i++) {
|
for (int i = 0; i < nprocs; i++) {
|
||||||
maxcost = MAX(maxcost,allproccost[i]);
|
maxcost = MAX(maxcost,allproccost[i]);
|
||||||
|
|||||||
@ -81,7 +81,7 @@ class Balance : protected Pointers {
|
|||||||
FILE *fp; // balance output file
|
FILE *fp; // balance output file
|
||||||
int firststep;
|
int firststep;
|
||||||
|
|
||||||
double imbalance_splits(int &);
|
double imbalance_splits();
|
||||||
void shift_setup_static(char *);
|
void shift_setup_static(char *);
|
||||||
void tally(int, int, double *);
|
void tally(int, int, double *);
|
||||||
int adjust(int, double *);
|
int adjust(int, double *);
|
||||||
|
|||||||
Reference in New Issue
Block a user