Simplifying RHEO compute comm calls
This commit is contained in:
@ -290,8 +290,7 @@ void ComputeRHEOGrad::compute_peratom()
|
|||||||
void ComputeRHEOGrad::forward_gradients()
|
void ComputeRHEOGrad::forward_gradients()
|
||||||
{
|
{
|
||||||
comm_stage = COMMGRAD;
|
comm_stage = COMMGRAD;
|
||||||
comm_forward = ncomm_grad;
|
comm->forward_comm(this, ncomm_grad);
|
||||||
comm->forward_comm(this);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
@ -299,8 +298,7 @@ void ComputeRHEOGrad::forward_gradients()
|
|||||||
void ComputeRHEOGrad::forward_fields()
|
void ComputeRHEOGrad::forward_fields()
|
||||||
{
|
{
|
||||||
comm_stage = COMMFIELD;
|
comm_stage = COMMFIELD;
|
||||||
comm_forward = ncomm_field;
|
comm->forward_comm(this, ncomm_field);
|
||||||
comm->forward_comm(this);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|||||||
@ -218,8 +218,7 @@ void ComputeRHEOInterface::compute_peratom()
|
|||||||
}
|
}
|
||||||
|
|
||||||
comm_stage = 1;
|
comm_stage = 1;
|
||||||
comm_forward = 2;
|
comm->forward_comm(this, 2);
|
||||||
comm->forward_comm(this);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
@ -369,9 +368,8 @@ void ComputeRHEOInterface::store_forces()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Forward comm forces
|
// Forward comm forces
|
||||||
comm_forward = 3;
|
|
||||||
comm_stage = 0;
|
comm_stage = 0;
|
||||||
comm->forward_comm(this);
|
comm->forward_comm(this, 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ----------------------------------------------------------------------
|
/* ----------------------------------------------------------------------
|
||||||
|
|||||||
@ -90,7 +90,6 @@ ComputeRHEOKernel::ComputeRHEOKernel(LAMMPS *lmp, int narg, char **arg) :
|
|||||||
comm_forward = ncor * Mdim;
|
comm_forward = ncor * Mdim;
|
||||||
}
|
}
|
||||||
|
|
||||||
comm_forward_save = comm_forward;
|
|
||||||
corrections_calculated = 0;
|
corrections_calculated = 0;
|
||||||
lapack_error_flag = 0;
|
lapack_error_flag = 0;
|
||||||
}
|
}
|
||||||
@ -778,7 +777,6 @@ void ComputeRHEOKernel::compute_peratom()
|
|||||||
|
|
||||||
// communicate calculated quantities
|
// communicate calculated quantities
|
||||||
comm_stage = 1;
|
comm_stage = 1;
|
||||||
comm_forward = comm_forward_save;
|
|
||||||
comm->forward_comm(this);
|
comm->forward_comm(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -826,8 +824,7 @@ void ComputeRHEOKernel::compute_coordination()
|
|||||||
|
|
||||||
// communicate calculated quantities
|
// communicate calculated quantities
|
||||||
comm_stage = 0;
|
comm_stage = 0;
|
||||||
comm_forward = 1;
|
comm->forward_comm(this, 1);
|
||||||
comm->forward_comm(this);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|||||||
@ -52,7 +52,7 @@ class ComputeRHEOKernel : public Compute {
|
|||||||
class FixRHEO *fix_rheo;
|
class FixRHEO *fix_rheo;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int comm_stage, comm_forward_save;
|
int comm_stage;
|
||||||
int interface_flag;
|
int interface_flag;
|
||||||
int lapack_error_flag;
|
int lapack_error_flag;
|
||||||
std::unordered_set<tagint> lapack_error_tags;
|
std::unordered_set<tagint> lapack_error_tags;
|
||||||
|
|||||||
@ -199,10 +199,8 @@ void ComputeRHEOSurface::compute_peratom()
|
|||||||
|
|
||||||
// reverse gradC and divr, forward divr
|
// reverse gradC and divr, forward divr
|
||||||
comm_stage = 0;
|
comm_stage = 0;
|
||||||
comm_reverse = dim * dim + 1;
|
if (newton) comm->reverse_comm(this, dim * dim + 1);
|
||||||
comm_forward = 1;
|
comm->forward_comm(this, 1);
|
||||||
if (newton) comm->reverse_comm(this);
|
|
||||||
comm->forward_comm(this);
|
|
||||||
|
|
||||||
// calculate nsurface for local atoms
|
// calculate nsurface for local atoms
|
||||||
// Note, this isn't forwarded to ghosts
|
// Note, this isn't forwarded to ghosts
|
||||||
@ -299,10 +297,8 @@ void ComputeRHEOSurface::compute_peratom()
|
|||||||
|
|
||||||
// forward/reverse status and rsurface
|
// forward/reverse status and rsurface
|
||||||
comm_stage = 1;
|
comm_stage = 1;
|
||||||
comm_reverse = 2;
|
if (newton) comm->reverse_comm(this, 2);
|
||||||
comm_forward = 2;
|
comm->forward_comm(this, 2);
|
||||||
if (newton) comm->reverse_comm(this);
|
|
||||||
comm->forward_comm(this);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|||||||
Reference in New Issue
Block a user