-
- if (comm == MPI_COMM_NULL) {
- retval = MPI_ERR_COMM;
- } else if ((( sendbuf != MPI_IN_PLACE) && (sendtype == MPI_DATATYPE_NULL)) ||
- ((comm->rank() == root) && (recvtype == MPI_DATATYPE_NULL))){
- retval = MPI_ERR_TYPE;
- } else if ((( sendbuf != MPI_IN_PLACE) && (sendcount <0)) || ((comm->rank() == root) && (recvcount <0))){
- retval = MPI_ERR_COUNT;
- } else {
-
- char* sendtmpbuf = static_cast<char*>(sendbuf);
- int sendtmpcount = sendcount;
- MPI_Datatype sendtmptype = sendtype;
- if( (comm->rank() == root) && (sendbuf == MPI_IN_PLACE )) {
- sendtmpcount=0;
- sendtmptype=recvtype;
- }
- int rank = comm != MPI_COMM_NULL ? smpi_process()->index() : -1;
- int root_traced = comm->group()->index(root);
- instr_extra_data extra = xbt_new0(s_instr_extra_data_t, 1);
- extra->type = TRACING_GATHER;
- extra->root = root_traced;
- int known = 0;
- extra->datatype1 = encode_datatype(sendtmptype, &known);
- int dt_size_send = 1;
- if (known == 0)
- dt_size_send = sendtmptype->size();
- extra->send_size = sendtmpcount * dt_size_send;
- extra->datatype2 = encode_datatype(recvtype, &known);
- int dt_size_recv = 1;
- if ((comm->rank() == root) && known == 0)
- dt_size_recv = recvtype->size();
- extra->recv_size = recvcount * dt_size_recv;
-
- TRACE_smpi_collective_in(rank, __FUNCTION__, extra);
-
- simgrid::smpi::Colls::gather(sendtmpbuf, sendtmpcount, sendtmptype, recvbuf, recvcount, recvtype, root, comm);
-
- retval = MPI_SUCCESS;
- TRACE_smpi_collective_out(rank, __FUNCTION__);
+ char* sendtmpbuf = static_cast<char*>(sendbuf);
+ int sendtmpcount = sendcount;
+ MPI_Datatype sendtmptype = sendtype;
+ if ((comm->rank() == root) && (sendbuf == MPI_IN_PLACE)) {
+ sendtmpcount = 0;
+ sendtmptype = recvtype;