- smpi_mpi_gatherv(sendbuf, sendcount, sendtype, recvbuf, recvcounts,
+ char* sendtmpbuf = (char*) sendbuf;
+ int sendtmpcount = sendcount;
+ MPI_Datatype sendtmptype = sendtype;
+ if( (smpi_comm_rank(comm) == root) && (sendbuf == MPI_IN_PLACE )) {
+ sendtmpcount=0;
+ sendtmptype=recvtype;
+ }
+
+#ifdef HAVE_TRACING
+ int rank = comm != MPI_COMM_NULL ? smpi_process_index() : -1;
+ int root_traced = smpi_group_index(smpi_comm_group(comm), root);
+ int i=0;
+ int size = smpi_comm_size(comm);
+ instr_extra_data extra = xbt_new0(s_instr_extra_data_t,1);
+ extra->type = TRACING_GATHERV;
+ extra->send_size = sendtmpcount;
+ extra->recvcounts= xbt_malloc(size*sizeof(int));
+ for(i=0; i< size; i++)//copy data to avoid bad free
+ extra->recvcounts[i] = recvcounts[i];
+ extra->num_processes = size;
+ extra->root = root_traced;
+ extra->datatype1 = encode_datatype(sendtmptype);
+ extra->datatype2 = encode_datatype(recvtype);
+
+ TRACE_smpi_collective_in(rank, root_traced, __FUNCTION__,extra);
+#endif
+ smpi_mpi_gatherv(sendtmpbuf, sendtmpcount, sendtmptype, recvbuf, recvcounts,