-
- if (comm == MPI_COMM_NULL) {
- retval = MPI_ERR_COMM;
- } else if ((sendbuf == nullptr && sendcount > 0) || (recvbuf == nullptr)){
- retval = MPI_ERR_BUFFER;
- } else if ((( sendbuf != MPI_IN_PLACE) && (sendtype == MPI_DATATYPE_NULL)) ||
- (recvtype == MPI_DATATYPE_NULL)){
- retval = MPI_ERR_TYPE;
- } else if ((( sendbuf != MPI_IN_PLACE) && (sendcount <0)) ||
- (recvcount <0)){
- retval = MPI_ERR_COUNT;
- } else if (request == nullptr){
- retval = MPI_ERR_ARG;
- } else {
- if(sendbuf == MPI_IN_PLACE) {
- sendbuf=static_cast<char*>(recvbuf)+recvtype->get_extent()*recvcount*comm->rank();
- sendcount=recvcount;
- sendtype=recvtype;
- }
- int rank = simgrid::s4u::this_actor::get_pid();
-
- TRACE_smpi_comm_in(rank, request==MPI_REQUEST_IGNORED?"PMPI_Allgather":"PMPI_Iallggather",
- new simgrid::instr::CollTIData(
- request==MPI_REQUEST_IGNORED ? "allgather" : "iallgather", -1, -1.0, sendtype->is_replayable() ? sendcount : sendcount * sendtype->size(),
- recvtype->is_replayable() ? recvcount : recvcount * recvtype->size(),
- simgrid::smpi::Datatype::encode(sendtype), simgrid::smpi::Datatype::encode(recvtype)));
- if(request == MPI_REQUEST_IGNORED)
- simgrid::smpi::Colls::allgather(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm);
- else
- simgrid::smpi::Colls::iallgather(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm, request);
- TRACE_smpi_comm_out(rank);