Init pointers, etc.
This commit is contained in:
@ -36,7 +36,6 @@ static constexpr int BUFEXTRA = 1000;
|
|||||||
|
|
||||||
CommTiledKokkos::CommTiledKokkos(LAMMPS *_lmp) : CommTiled(_lmp)
|
CommTiledKokkos::CommTiledKokkos(LAMMPS *_lmp) : CommTiled(_lmp)
|
||||||
{
|
{
|
||||||
sendlist = nullptr;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
@ -48,7 +47,6 @@ CommTiledKokkos::CommTiledKokkos(LAMMPS *_lmp) : CommTiled(_lmp)
|
|||||||
|
|
||||||
CommTiledKokkos::CommTiledKokkos(LAMMPS *_lmp, Comm *oldcomm) : CommTiled(_lmp,oldcomm)
|
CommTiledKokkos::CommTiledKokkos(LAMMPS *_lmp, Comm *oldcomm) : CommTiled(_lmp,oldcomm)
|
||||||
{
|
{
|
||||||
sendlist = nullptr;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
@ -59,6 +57,7 @@ CommTiledKokkos::~CommTiledKokkos()
|
|||||||
sendlist = nullptr;
|
sendlist = nullptr;
|
||||||
buf_send = nullptr;
|
buf_send = nullptr;
|
||||||
buf_recv = nullptr;
|
buf_recv = nullptr;
|
||||||
|
maxswap = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|||||||
@ -47,14 +47,9 @@ CommTiled::CommTiled(LAMMPS *lmp) : Comm(lmp)
|
|||||||
{
|
{
|
||||||
style = Comm::TILED;
|
style = Comm::TILED;
|
||||||
layout = Comm::LAYOUT_UNIFORM;
|
layout = Comm::LAYOUT_UNIFORM;
|
||||||
pbc_flag = nullptr;
|
init_pointers();
|
||||||
buf_send = nullptr;
|
init_buffers_flag = 0;
|
||||||
buf_recv = nullptr;
|
maxswap = 0;
|
||||||
overlap = nullptr;
|
|
||||||
rcbinfo = nullptr;
|
|
||||||
cutghostmulti = nullptr;
|
|
||||||
cutghostmultiold = nullptr;
|
|
||||||
init_buffers_flag = 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
@ -69,7 +64,9 @@ CommTiled::CommTiled(LAMMPS * /*lmp*/, Comm *oldcomm) : Comm(*oldcomm)
|
|||||||
style = Comm::TILED;
|
style = Comm::TILED;
|
||||||
layout = oldcomm->layout;
|
layout = oldcomm->layout;
|
||||||
Comm::copy_arrays(oldcomm);
|
Comm::copy_arrays(oldcomm);
|
||||||
init_buffers_flag = 1;
|
init_pointers();
|
||||||
|
init_buffers_flag = 0;
|
||||||
|
maxswap = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
@ -85,24 +82,59 @@ CommTiled::~CommTiled()
|
|||||||
memory->destroy(cutghostmultiold);
|
memory->destroy(cutghostmultiold);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* ----------------------------------------------------------------------
|
||||||
|
initialize comm pointers to nullptr
|
||||||
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
void CommTiled::init_pointers()
|
||||||
|
{
|
||||||
|
buf_send = buf_recv = nullptr;
|
||||||
|
overlap = nullptr;
|
||||||
|
rcbinfo = nullptr;
|
||||||
|
cutghostmulti = nullptr;
|
||||||
|
cutghostmultiold = nullptr;
|
||||||
|
|
||||||
|
nsendproc = nullptr;
|
||||||
|
nrecvproc = nullptr;
|
||||||
|
sendother = nullptr;
|
||||||
|
recvother = nullptr;
|
||||||
|
sendself = nullptr;
|
||||||
|
sendproc = nullptr;
|
||||||
|
recvproc = nullptr;
|
||||||
|
sendnum = nullptr;
|
||||||
|
recvnum = nullptr;
|
||||||
|
size_forward_recv = nullptr;
|
||||||
|
firstrecv = nullptr;
|
||||||
|
size_reverse_send = nullptr;
|
||||||
|
size_reverse_recv = nullptr;
|
||||||
|
forward_recv_offset = nullptr;
|
||||||
|
reverse_recv_offset = nullptr;
|
||||||
|
pbc_flag = nullptr;
|
||||||
|
pbc = nullptr;
|
||||||
|
sendbox = nullptr;
|
||||||
|
sendbox_multi = nullptr;
|
||||||
|
sendbox_multiold = nullptr;
|
||||||
|
maxsendlist = nullptr;
|
||||||
|
sendlist = nullptr;
|
||||||
|
requests = nullptr;
|
||||||
|
nprocmax = nullptr;
|
||||||
|
nexchproc = nullptr;
|
||||||
|
nexchprocmax = nullptr;
|
||||||
|
exchproc = nullptr;
|
||||||
|
exchnum = nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
/* ----------------------------------------------------------------------
|
/* ----------------------------------------------------------------------
|
||||||
initialize comm buffers and other data structs local to CommTiled
|
initialize comm buffers and other data structs local to CommTiled
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
void CommTiled::init_buffers()
|
void CommTiled::init_buffers()
|
||||||
{
|
{
|
||||||
buf_send = buf_recv = nullptr;
|
|
||||||
maxsend = maxrecv = BUFMIN;
|
maxsend = maxrecv = BUFMIN;
|
||||||
grow_send(maxsend,2);
|
grow_send(maxsend,2);
|
||||||
grow_recv(maxrecv,1);
|
grow_recv(maxrecv,1);
|
||||||
|
|
||||||
maxoverlap = 0;
|
maxoverlap = 0;
|
||||||
overlap = nullptr;
|
|
||||||
rcbinfo = nullptr;
|
|
||||||
cutghostmulti = nullptr;
|
|
||||||
cutghostmultiold = nullptr;
|
|
||||||
sendbox_multi = nullptr;
|
|
||||||
sendbox_multiold = nullptr;
|
|
||||||
|
|
||||||
// Note this may skip growing multi arrays, will call again in init()
|
// Note this may skip growing multi arrays, will call again in init()
|
||||||
maxswap = 6;
|
maxswap = 6;
|
||||||
@ -113,9 +145,9 @@ void CommTiled::init_buffers()
|
|||||||
|
|
||||||
void CommTiled::init()
|
void CommTiled::init()
|
||||||
{
|
{
|
||||||
if (init_buffers_flag) {
|
if (!init_buffers_flag) {
|
||||||
init_buffers();
|
init_buffers();
|
||||||
init_buffers_flag = 0;
|
init_buffers_flag = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
Comm::init();
|
Comm::init();
|
||||||
@ -2436,10 +2468,8 @@ void CommTiled::deallocate_swap(int n)
|
|||||||
|
|
||||||
delete [] maxsendlist[i];
|
delete [] maxsendlist[i];
|
||||||
|
|
||||||
if (sendlist && sendlist[i]) {
|
for (int j = 0; j < nprocmax[i]; j++) memory->destroy(sendlist[i][j]);
|
||||||
for (int j = 0; j < nprocmax[i]; j++) memory->destroy(sendlist[i][j]);
|
delete [] sendlist[i];
|
||||||
delete [] sendlist[i];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
delete [] sendproc;
|
delete [] sendproc;
|
||||||
|
|||||||
@ -117,8 +117,9 @@ class CommTiled : public Comm {
|
|||||||
double *sublo, *subhi;
|
double *sublo, *subhi;
|
||||||
int dimension;
|
int dimension;
|
||||||
|
|
||||||
int init_buffers_flag;
|
void init_pointers();
|
||||||
void init_buffers();
|
void init_buffers();
|
||||||
|
int init_buffers_flag;
|
||||||
|
|
||||||
// box drop and other functions
|
// box drop and other functions
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user