sync with current develop
This commit is contained in:
@ -57,7 +57,7 @@ Special::~Special()
|
||||
void Special::build()
|
||||
{
|
||||
MPI_Barrier(world);
|
||||
double time1 = MPI_Wtime();
|
||||
double time1 = platform::walltime();
|
||||
|
||||
if (me == 0) {
|
||||
const double * const special_lj = force->special_lj;
|
||||
@ -188,8 +188,7 @@ void Special::atom_owners()
|
||||
|
||||
int *proclist;
|
||||
memory->create(proclist,nlocal,"special:proclist");
|
||||
IDRvous *idbuf = (IDRvous *)
|
||||
memory->smalloc((bigint) nlocal*sizeof(IDRvous),"special:idbuf");
|
||||
auto idbuf = (IDRvous *) memory->smalloc((bigint) nlocal*sizeof(IDRvous),"special:idbuf");
|
||||
|
||||
// setup input buf for rendezvous comm
|
||||
// one datum for each owned atom: datum = owning proc, atomID
|
||||
@ -238,8 +237,7 @@ void Special::onetwo_build_newton()
|
||||
|
||||
int *proclist;
|
||||
memory->create(proclist,nsend,"special:proclist");
|
||||
PairRvous *inbuf = (PairRvous *)
|
||||
memory->smalloc((bigint) nsend*sizeof(PairRvous),"special:inbuf");
|
||||
auto inbuf = (PairRvous *) memory->smalloc((bigint) nsend*sizeof(PairRvous),"special:inbuf");
|
||||
|
||||
// setup input buf to rendezvous comm
|
||||
// one datum for each unowned bond partner: bond partner ID, atomID
|
||||
@ -262,7 +260,7 @@ void Special::onetwo_build_newton()
|
||||
char *buf;
|
||||
int nreturn = comm->rendezvous(RVOUS,nsend,(char *) inbuf,sizeof(PairRvous), 0,proclist,
|
||||
rendezvous_pairs,0,buf,sizeof(PairRvous), (void *) this);
|
||||
PairRvous *outbuf = (PairRvous *) buf;
|
||||
auto outbuf = (PairRvous *) buf;
|
||||
|
||||
memory->destroy(proclist);
|
||||
memory->sfree(inbuf);
|
||||
@ -364,8 +362,7 @@ void Special::onethree_build()
|
||||
|
||||
int *proclist;
|
||||
memory->create(proclist,nsend,"special:proclist");
|
||||
PairRvous *inbuf = (PairRvous *)
|
||||
memory->smalloc((bigint) nsend*sizeof(PairRvous),"special:inbuf");
|
||||
auto inbuf = (PairRvous *) memory->smalloc((bigint) nsend*sizeof(PairRvous),"special:inbuf");
|
||||
|
||||
// setup input buf to rendezvous comm
|
||||
// datums = pairs of onetwo partners where either is unknown
|
||||
@ -394,7 +391,7 @@ void Special::onethree_build()
|
||||
char *buf;
|
||||
int nreturn = comm->rendezvous(RVOUS,nsend,(char *) inbuf,sizeof(PairRvous), 0,proclist,
|
||||
rendezvous_pairs,0,buf,sizeof(PairRvous), (void *) this);
|
||||
PairRvous *outbuf = (PairRvous *) buf;
|
||||
auto outbuf = (PairRvous *) buf;
|
||||
|
||||
memory->destroy(proclist);
|
||||
memory->sfree(inbuf);
|
||||
@ -467,8 +464,7 @@ void Special::onefour_build()
|
||||
|
||||
int *proclist;
|
||||
memory->create(proclist,nsend,"special:proclist");
|
||||
PairRvous *inbuf = (PairRvous *)
|
||||
memory->smalloc((bigint) nsend*sizeof(PairRvous),"special:inbuf");
|
||||
auto inbuf = (PairRvous *) memory->smalloc((bigint) nsend*sizeof(PairRvous),"special:inbuf");
|
||||
|
||||
// setup input buf to rendezvous comm
|
||||
// datums = pairs of onethree and onetwo partners where onethree is unknown
|
||||
@ -496,7 +492,7 @@ void Special::onefour_build()
|
||||
char *buf;
|
||||
int nreturn = comm->rendezvous(RVOUS,nsend,(char *) inbuf,sizeof(PairRvous), 0,proclist,
|
||||
rendezvous_pairs,0,buf,sizeof(PairRvous), (void *) this);
|
||||
PairRvous *outbuf = (PairRvous *) buf;
|
||||
auto outbuf = (PairRvous *) buf;
|
||||
|
||||
memory->destroy(proclist);
|
||||
memory->sfree(inbuf);
|
||||
@ -861,10 +857,10 @@ void Special::combine()
|
||||
utils::logmesg(lmp,"{:>6} = max # of special neighbors\n",atom->maxspecial);
|
||||
|
||||
if (lmp->kokkos) {
|
||||
AtomKokkos* atomKK = (AtomKokkos*) atom;
|
||||
auto atomKK = dynamic_cast<AtomKokkos*>( atom);
|
||||
atomKK->modified(Host,SPECIAL_MASK);
|
||||
atomKK->sync(Device,SPECIAL_MASK);
|
||||
MemoryKokkos* memoryKK = (MemoryKokkos*) memory;
|
||||
auto memoryKK = dynamic_cast<MemoryKokkos*>( memory);
|
||||
memoryKK->grow_kokkos(atomKK->k_special,atom->special,
|
||||
atom->nmax,atom->maxspecial,"atom:special");
|
||||
atomKK->modified(Device,SPECIAL_MASK);
|
||||
@ -1023,8 +1019,7 @@ void Special::angle_trim()
|
||||
|
||||
int *proclist;
|
||||
memory->create(proclist,nsend,"special:proclist");
|
||||
PairRvous *inbuf = (PairRvous *)
|
||||
memory->smalloc((bigint) nsend*sizeof(PairRvous),"special:inbuf");
|
||||
auto inbuf = (PairRvous *) memory->smalloc((bigint) nsend*sizeof(PairRvous),"special:inbuf");
|
||||
|
||||
// setup input buf to rendezvous comm
|
||||
// datums = pairs of onetwo partners where either is unknown
|
||||
@ -1092,7 +1087,7 @@ void Special::angle_trim()
|
||||
char *buf;
|
||||
int nreturn = comm->rendezvous(RVOUS,nsend,(char *) inbuf,sizeof(PairRvous), 0,proclist,
|
||||
rendezvous_pairs,0,buf,sizeof(PairRvous), (void *) this);
|
||||
PairRvous *outbuf = (PairRvous *) buf;
|
||||
auto outbuf = (PairRvous *) buf;
|
||||
|
||||
memory->destroy(proclist);
|
||||
memory->sfree(inbuf);
|
||||
@ -1265,8 +1260,7 @@ void Special::dihedral_trim()
|
||||
|
||||
int *proclist;
|
||||
memory->create(proclist,nsend,"special:proclist");
|
||||
PairRvous *inbuf = (PairRvous *)
|
||||
memory->smalloc((bigint) nsend*sizeof(PairRvous),"special:inbuf");
|
||||
auto 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
|
||||
@ -1303,7 +1297,7 @@ void Special::dihedral_trim()
|
||||
char *buf;
|
||||
int nreturn = comm->rendezvous(RVOUS,nsend,(char *) inbuf,sizeof(PairRvous), 0,proclist,
|
||||
rendezvous_pairs,0,buf,sizeof(PairRvous), (void *) this);
|
||||
PairRvous *outbuf = (PairRvous *) buf;
|
||||
auto outbuf = (PairRvous *) buf;
|
||||
|
||||
memory->destroy(proclist);
|
||||
memory->sfree(inbuf);
|
||||
@ -1395,11 +1389,9 @@ void Special::dihedral_trim()
|
||||
no outbuf
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
int Special::rendezvous_ids(int n, char *inbuf,
|
||||
int &flag, int *& /*proclist*/, char *& /*outbuf*/,
|
||||
void *ptr)
|
||||
int Special::rendezvous_ids(int n, char *inbuf, int &flag, int *& /*proclist*/, char *& /*outbuf*/, void *ptr)
|
||||
{
|
||||
Special *sptr = (Special *) ptr;
|
||||
auto sptr = (Special *) ptr;
|
||||
Memory *memory = sptr->memory;
|
||||
|
||||
int *procowner;
|
||||
@ -1408,7 +1400,7 @@ int Special::rendezvous_ids(int n, char *inbuf,
|
||||
memory->create(procowner,n,"special:procowner");
|
||||
memory->create(atomIDs,n,"special:atomIDs");
|
||||
|
||||
IDRvous *in = (IDRvous *) inbuf;
|
||||
auto in = (IDRvous *) inbuf;
|
||||
|
||||
for (int i = 0; i < n; i++) {
|
||||
procowner[i] = in[i].me;
|
||||
@ -1437,7 +1429,7 @@ int Special::rendezvous_ids(int n, char *inbuf,
|
||||
int Special::rendezvous_pairs(int n, char *inbuf, int &flag, int *&proclist,
|
||||
char *&outbuf, void *ptr)
|
||||
{
|
||||
Special *sptr = (Special *) ptr;
|
||||
auto sptr = (Special *) ptr;
|
||||
Atom *atom = sptr->atom;
|
||||
Memory *memory = sptr->memory;
|
||||
|
||||
@ -1456,7 +1448,7 @@ int Special::rendezvous_pairs(int n, char *inbuf, int &flag, int *&proclist,
|
||||
|
||||
// proclist = owner of atomID in caller decomposition
|
||||
|
||||
PairRvous *in = (PairRvous *) inbuf;
|
||||
auto in = (PairRvous *) inbuf;
|
||||
int *procowner = sptr->procowner;
|
||||
memory->create(proclist,n,"special:proclist");
|
||||
|
||||
@ -1488,9 +1480,8 @@ int Special::rendezvous_pairs(int n, char *inbuf, int &flag, int *&proclist,
|
||||
|
||||
void Special::fix_alteration()
|
||||
{
|
||||
for (int ifix = 0; ifix < modify->nfix; ifix++)
|
||||
if (modify->fix[ifix]->special_alter_flag)
|
||||
modify->fix[ifix]->rebuild_special();
|
||||
for (const auto &ifix : modify->get_fix_list())
|
||||
if (ifix->special_alter_flag) ifix->rebuild_special();
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
@ -1501,5 +1492,5 @@ void Special::timer_output(double time1)
|
||||
{
|
||||
if (comm->me == 0)
|
||||
utils::logmesg(lmp," special bonds CPU = {:.3f} seconds\n",
|
||||
MPI_Wtime()-time1);
|
||||
platform::walltime()-time1);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user