void dd_bcast(gmx_domdec_t *dd,int nbytes,void *data) { #ifdef GMX_MPI MPI_Bcast(data,nbytes,MPI_BYTE, DDMASTERRANK(dd),dd->mpi_comm_all); #endif }
void dd_scatterv(gmx_domdec_t gmx_unused *dd, int gmx_unused *scounts, int gmx_unused *disps, void *sbuf, int rcount, void *rbuf) { #if GMX_MPI int dum; if (dd->nnodes > 1) { if (rcount == 0) { /* MPI does not allow NULL pointers */ rbuf = &dum; } MPI_Scatterv(sbuf, scounts, disps, MPI_BYTE, rbuf, rcount, MPI_BYTE, DDMASTERRANK(dd), dd->mpi_comm_all); } else #endif { /* 1 rank, either we copy everything, or rbuf=sbuf: nothing to do */ if (rbuf != sbuf) { memcpy(rbuf, sbuf, rcount); } } }
void dd_gather(gmx_domdec_t gmx_unused *dd, int gmx_unused nbytes, void gmx_unused *src, void gmx_unused *dest) { #ifdef GMX_MPI MPI_Gather(src, nbytes, MPI_BYTE, dest, nbytes, MPI_BYTE, DDMASTERRANK(dd), dd->mpi_comm_all); #endif }
void dd_scatter(gmx_domdec_t *dd,int nbytes,void *src,void *dest) { #ifdef GMX_MPI MPI_Scatter(src,nbytes,MPI_BYTE, dest,nbytes,MPI_BYTE, DDMASTERRANK(dd),dd->mpi_comm_all); #endif }
void dd_gather(const gmx_domdec_t gmx_unused *dd, int gmx_unused nbytes, const void gmx_unused *src, void gmx_unused *dest) { #if GMX_MPI /* Some MPI implementions don't specify const */ MPI_Gather(const_cast<void *>(src), nbytes, MPI_BYTE, dest, nbytes, MPI_BYTE, DDMASTERRANK(dd), dd->mpi_comm_all); #endif }
void dd_gatherv(gmx_domdec_t *dd, int scount,void *sbuf, int *rcounts,int *disps,void *rbuf) { #ifdef GMX_MPI MPI_Gatherv(sbuf,scount,MPI_BYTE, rbuf,rcounts,disps,MPI_BYTE, DDMASTERRANK(dd),dd->mpi_comm_all); #endif }
void dd_bcast(gmx_domdec_t gmx_unused *dd, int gmx_unused nbytes, void gmx_unused *data) { #if GMX_MPI if (dd->nnodes > 1) { MPI_Bcast(data, nbytes, MPI_BYTE, DDMASTERRANK(dd), dd->mpi_comm_all); } #endif }
void dd_bcastc(gmx_domdec_t *dd,int nbytes,void *src,void *dest) { if (DDMASTER(dd)) { memcpy(dest,src,nbytes); } #ifdef GMX_MPI MPI_Bcast(dest,nbytes,MPI_BYTE, DDMASTERRANK(dd),dd->mpi_comm_all); #endif }
void dd_bcast(gmx_domdec_t gmx_unused *dd, int gmx_unused nbytes, void gmx_unused *data) { #ifdef GMX_MPI #ifdef GMX_BLUEGENE if (nbytes > 0) { #endif MPI_Bcast(data, nbytes, MPI_BYTE, DDMASTERRANK(dd), dd->mpi_comm_all); #ifdef GMX_BLUEGENE } #endif #endif }
void dd_bcastc(const gmx_domdec_t *dd, int nbytes, void *src, void *dest) { if (DDMASTER(dd) || dd->nnodes == 1) { memcpy(dest, src, nbytes); } #if GMX_MPI if (dd->nnodes > 1) { MPI_Bcast(dest, nbytes, MPI_BYTE, DDMASTERRANK(dd), dd->mpi_comm_all); } #endif }
void dd_gatherv(gmx_domdec_t gmx_unused *dd, int gmx_unused scount, void gmx_unused *sbuf, int gmx_unused *rcounts, int gmx_unused *disps, void gmx_unused *rbuf) { #ifdef GMX_MPI int dum; if (scount == 0) { /* MPI does not allow NULL pointers */ sbuf = &dum; } MPI_Gatherv(sbuf, scount, MPI_BYTE, rbuf, rcounts, disps, MPI_BYTE, DDMASTERRANK(dd), dd->mpi_comm_all); #endif }
void dd_gatherv(const gmx_domdec_t gmx_unused *dd, int gmx_unused scount, const void gmx_unused *sbuf, int gmx_unused *rcounts, int gmx_unused *disps, void gmx_unused *rbuf) { #if GMX_MPI int dum; if (scount == 0) { /* MPI does not allow NULL pointers */ sbuf = &dum; } /* Some MPI implementions don't specify const */ MPI_Gatherv(const_cast<void *>(sbuf), scount, MPI_BYTE, rbuf, rcounts, disps, MPI_BYTE, DDMASTERRANK(dd), dd->mpi_comm_all); #endif }
void dd_scatter(gmx_domdec_t gmx_unused *dd, int gmx_unused nbytes, void gmx_unused *src, void *dest) { #if GMX_MPI if (dd->nnodes > 1) { MPI_Scatter(src, nbytes, MPI_BYTE, dest, nbytes, MPI_BYTE, DDMASTERRANK(dd), dd->mpi_comm_all); } else #endif { /* 1 rank, either we copy everything, or dest=src: nothing to do */ if (dest != src) { memcpy(dest, src, nbytes); } } }
void dd_scatter(const gmx_domdec_t gmx_unused *dd, int gmx_unused nbytes, const void gmx_unused *src, void *dest) { #if GMX_MPI if (dd->nnodes > 1) { /* Some MPI implementions don't specify const */ MPI_Scatter(const_cast<void *>(src), nbytes, MPI_BYTE, dest, nbytes, MPI_BYTE, DDMASTERRANK(dd), dd->mpi_comm_all); } else #endif { /* 1 rank, either we copy everything, or dest=src: nothing to do */ if (dest != src) { memcpy(dest, src, nbytes); } } }