int MPIDO_CSWrapper_gatherv(pami_xfer_t *gatherv, void *comm) { int mpierrno = 0; MPID_Comm *comm_ptr = (MPID_Comm*)comm; MPI_Datatype sendtype, recvtype; void *sbuf; MPIDI_coll_check_in_place(gatherv->cmd.xfer_gatherv_int.sndbuf, &sbuf); int rc = MPIDI_Dtpami_to_dtmpi( gatherv->cmd.xfer_gatherv_int.stype, &sendtype, NULL, NULL); if(rc == -1) return rc; if(gatherv->cmd.xfer_gatherv_int.rtype == PAMI_TYPE_NULL) recvtype = MPI_DATATYPE_NULL; else rc = MPIDI_Dtpami_to_dtmpi( gatherv->cmd.xfer_gatherv_int.rtype, &recvtype, NULL, NULL); if(rc == -1) return rc; rc = MPIR_Gatherv(sbuf, gatherv->cmd.xfer_gatherv_int.stypecount, sendtype, gatherv->cmd.xfer_gatherv_int.rcvbuf, gatherv->cmd.xfer_gatherv_int.rtypecounts, gatherv->cmd.xfer_gatherv_int.rdispls, recvtype, gatherv->cmd.xfer_gatherv_int.root, comm_ptr, &mpierrno); if(gatherv->cb_done && rc == 0) gatherv->cb_done(NULL, gatherv->cookie, PAMI_SUCCESS); return rc; }
int MPIDO_CSWrapper_allgather(pami_xfer_t *allgather, void *comm) { int mpierrno = 0; MPID_Comm *comm_ptr = (MPID_Comm*)comm; MPI_Datatype sendtype, recvtype; void *sbuf; MPIDI_coll_check_in_place(allgather->cmd.xfer_allgather.sndbuf, &sbuf); int rc = MPIDI_Dtpami_to_dtmpi( allgather->cmd.xfer_allgather.stype, &sendtype, NULL, NULL); if(rc == -1) return rc; rc = MPIDI_Dtpami_to_dtmpi( allgather->cmd.xfer_allgather.rtype, &recvtype, NULL, NULL); if(rc == -1) return rc; rc = MPIR_Allgather(sbuf, allgather->cmd.xfer_allgather.stypecount, sendtype, allgather->cmd.xfer_allgather.rcvbuf, allgather->cmd.xfer_allgather.rtypecount, recvtype, comm_ptr, &mpierrno); if(allgather->cb_done && rc == 0) allgather->cb_done(NULL, allgather->cookie, PAMI_SUCCESS); return rc; }
int MPIDO_CSWrapper_scatterv(pami_xfer_t *scatterv, void *comm) { int mpierrno = 0, rc = 0; MPID_Comm *comm_ptr = (MPID_Comm*)comm; MPI_Datatype sendtype, recvtype; void *rbuf; MPIDI_coll_check_in_place(scatterv->cmd.xfer_scatterv_int.rcvbuf, &rbuf); /* Since collective selection in PAMI fixes message size when selecting the algorithm, this wrapper function may be called back from PAMI */ if(PAMI_TYPE_NULL == scatterv->cmd.xfer_scatterv_int.stype) sendtype = MPI_DATATYPE_NULL; else rc = MPIDI_Dtpami_to_dtmpi( scatterv->cmd.xfer_scatterv_int.stype, &sendtype, NULL, NULL); if(rc == -1) return rc; rc = MPIDI_Dtpami_to_dtmpi( scatterv->cmd.xfer_scatterv_int.rtype, &recvtype, NULL, NULL); if(rc == -1) return rc; rc = MPIR_Scatterv(scatterv->cmd.xfer_scatterv_int.sndbuf, scatterv->cmd.xfer_scatterv_int.stypecounts, scatterv->cmd.xfer_scatterv_int.sdispls, sendtype, rbuf, scatterv->cmd.xfer_scatterv_int.rtypecount, recvtype, scatterv->cmd.xfer_scatterv_int.root, comm_ptr, &mpierrno); if(scatterv->cb_done && rc == 0) scatterv->cb_done(NULL, scatterv->cookie, PAMI_SUCCESS); return rc; }
int MPIDO_CSWrapper_bcast(pami_xfer_t *bcast, void *comm) { int mpierrno = 0; MPID_Comm *comm_ptr = (MPID_Comm*)comm; MPI_Datatype type; int rc = MPIDI_Dtpami_to_dtmpi( bcast->cmd.xfer_broadcast.type, &type, NULL, NULL); if(rc == -1) return rc; rc = MPIR_Bcast_intra(bcast->cmd.xfer_broadcast.buf, bcast->cmd.xfer_broadcast.typecount, type, bcast->cmd.xfer_broadcast.root, comm_ptr, &mpierrno); if(bcast->cb_done && rc == 0) bcast->cb_done(NULL, bcast->cookie, PAMI_SUCCESS); return rc; }