git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@12252 f3b2605a-c512-4ea7-a41b-209d697bcdaa

This commit is contained in:
sjplimp 2014-08-05 23:56:57 +00:00
parent cb9c3fbd11
commit a9495cb7f0
3 changed files with 470 additions and 190 deletions

View File

@ -1285,17 +1285,17 @@ void CommBrick::reverse_comm_dump(Dump *dump)
}
/* ----------------------------------------------------------------------
forward communication of N values in array
forward communication of N values in per-atom array
------------------------------------------------------------------------- */
void CommBrick::forward_comm_array(int n, double **array)
void CommBrick::forward_comm_array(int nsize, double **array)
{
int i,j,k,m,iswap,last;
double *buf;
MPI_Request request;
MPI_Status status;
// NOTE: check that buf_send and buf_recv are big enough
// NOTE: should check that buf_send and buf_recv are big enough
for (iswap = 0; iswap < nswap; iswap++) {
@ -1304,7 +1304,7 @@ void CommBrick::forward_comm_array(int n, double **array)
m = 0;
for (i = 0; i < sendnum[iswap]; i++) {
j = sendlist[iswap][i];
for (k = 0; k < n; k++)
for (k = 0; k < nsize; k++)
buf_send[m++] = array[j][k];
}
@ -1313,10 +1313,11 @@ void CommBrick::forward_comm_array(int n, double **array)
if (sendproc[iswap] != me) {
if (recvnum[iswap])
MPI_Irecv(buf_recv,n*recvnum[iswap],MPI_DOUBLE,recvproc[iswap],0,
MPI_Irecv(buf_recv,nsize*recvnum[iswap],MPI_DOUBLE,recvproc[iswap],0,
world,&request);
if (sendnum[iswap])
MPI_Send(buf_send,n*sendnum[iswap],MPI_DOUBLE,sendproc[iswap],0,world);
MPI_Send(buf_send,nsize*sendnum[iswap],MPI_DOUBLE,
sendproc[iswap],0,world);
if (recvnum[iswap]) MPI_Wait(&request,&status);
buf = buf_recv;
} else buf = buf_send;
@ -1326,7 +1327,7 @@ void CommBrick::forward_comm_array(int n, double **array)
m = 0;
last = firstrecv[iswap] + recvnum[iswap];
for (i = firstrecv[iswap]; i < last; i++)
for (k = 0; k < n; k++)
for (k = 0; k < nsize; k++)
array[i][k] = buf[m++];
}
}

File diff suppressed because it is too large Load Diff

View File

@ -57,10 +57,10 @@ class CommTiled : public Comm {
// forward/reverse comm info, proc lists include self
int *nsendproc,*nrecvproc; // # of procs to send/recv to/from in each swap
int *sendother; // 1 if send to any other proc in each swap
int *sendself; // 1 if send to self in each swap
int *nprocmax; // current max # of send procs for each swap
int *nsendproc,*nrecvproc; // # of procs to send/recv to/from per swap
int *sendother,*recvother; // 1 if send/recv to/from other proc per swap
int *sendself; // 1 if send to self per swap
int *nprocmax; // current max # of send procs per swap
int **sendproc,**recvproc; // procs to send/recv to/from per swap
int **sendnum,**recvnum; // # of atoms to send/recv per swap/proc
int **size_forward_recv; // # of values to recv in each forward swap/proc
@ -100,7 +100,7 @@ class CommTiled : public Comm {
struct RCBinfo {
double mysplit[3][2]; // fractional RCB bounding box for one proc
double cut; // position of cut this proc owns
double cutfrac; // fractional position of cut this proc owns
int dim; // dimension = 0/1/2 of cut
};
@ -113,6 +113,7 @@ class CommTiled : public Comm {
double *prd; // local ptrs to Domain attributes
double *boxlo,*boxhi;
double *sublo,*subhi;
int dimension;
void init_buffers();
@ -147,6 +148,12 @@ class CommTiled : public Comm {
void grow_swap_send(int, int, int); // grow swap arrays for send and recv
void grow_swap_recv(int, int);
void deallocate_swap(int); // deallocate swap arrays
// DEBUG
void bounds(double, double, double, double, double, double,
int &,int &,int &,int &,int &,int &);
};
}