diff --git a/lib/communicator/Communicator_mpi3.cc b/lib/communicator/Communicator_mpi3.cc index 1a36e610..240aa09e 100644 --- a/lib/communicator/Communicator_mpi3.cc +++ b/lib/communicator/Communicator_mpi3.cc @@ -196,10 +196,12 @@ CartesianCommunicator::CartesianCommunicator(const std::vector &processors) } ShmCommBufs.resize(ShmSize); + ShmStencilBufs.resize(ShmSize); for(int r=0;r &lis int from, int bytes) { +#undef SHM_USE_BCOPY MPI_Request xrq; MPI_Request rrq; + static int sequence; + int rank = _processor; int ierr; int tag; - int small = (bytes>2; + assert(((size_t)bytes &0x3)==0); + assert(((size_t)xmit &0x3)==0); + assert(((size_t)recv &0x3)==0); +#endif + assert(gme == ShmRank); if ( small && (dest !=MPI_UNDEFINED) ) { - char *ptr = (char *)ShmCommBufs[gdest]; assert(gme != gdest); - GridThread::bcopy(xmit,ptr,bytes); - bcopy(&_processor,&ptr[bytes],sizeof(_processor)); - bcopy(& sequence,&ptr[bytes+4],sizeof(sequence)); + float *ip = (float *)xmit; + float *op = (float *)to_ptr; + +#ifdef SHM_USE_BCOPY + bcopy(ip,op,bytes); +#else + PARALLEL_FOR_LOOP + for(int w=0;w &lis MPI_Win_sync (ShmWindow); if (small && (from !=MPI_UNDEFINED) ) { - char *ptr = (char *)ShmCommBufs[ShmRank]; - GridThread::bcopy(ptr,recv,bytes); - bcopy(&ptr[bytes] ,&tag ,sizeof(tag)); - bcopy(&ptr[bytes+4],&check,sizeof(check)); + float *ip = (float *)from_ptr; + float *op = (float *)recv; +#ifdef SHM_USE_BCOPY + bcopy(ip,op,bytes); +#else + PARALLEL_FOR_LOOP + for(int w=0;w