X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/87ce1949f86d4ce73e1456f5219dbc222544aab5..7f4f03348bd07609e258eb3b545bdafc2c881847:/src/smpi/smpi_pmpi.c diff --git a/src/smpi/smpi_pmpi.c b/src/smpi/smpi_pmpi.c index 0c38666cf1..0583cfb8c1 100644 --- a/src/smpi/smpi_pmpi.c +++ b/src/smpi/smpi_pmpi.c @@ -1825,10 +1825,11 @@ int PMPI_Gatherv(void *sendbuf, int sendcount, MPI_Datatype sendtype, int dt_size_recv = 1; if(!known) dt_size_recv = smpi_datatype_size(recvtype); + if((smpi_comm_rank(comm)==root)){ extra->recvcounts= xbt_malloc(size*sizeof(int)); for(i=0; i< size; i++)//copy data to avoid bad free extra->recvcounts[i] = recvcounts[i]*dt_size_recv; - + } TRACE_smpi_collective_in(rank, root_traced, __FUNCTION__,extra); smpi_mpi_gatherv(sendtmpbuf, sendtmpcount, sendtmptype, recvbuf, recvcounts, @@ -2028,9 +2029,11 @@ int PMPI_Scatterv(void *sendbuf, int *sendcounts, int *displs, int dt_size_send = 1; if(!known) dt_size_send = smpi_datatype_size(sendtype); + if((smpi_comm_rank(comm)==root)){ extra->sendcounts= xbt_malloc(size*sizeof(int)); for(i=0; i< size; i++)//copy data to avoid bad free extra->sendcounts[i] = sendcounts[i]*dt_size_send; + } extra->datatype2 = encode_datatype(recvtype, &known); int dt_size_recv = 1; if(!known)