X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/c4c63e5e576a782073b292ee963a9a4240dac0c8..f62c1bb030ea67ea9b49e0a49fbeeaf1198a2e03:/src/smpi/smpi_pmpi.c diff --git a/src/smpi/smpi_pmpi.c b/src/smpi/smpi_pmpi.c index 0c38666cf1..09bb17c9a7 100644 --- a/src/smpi/smpi_pmpi.c +++ b/src/smpi/smpi_pmpi.c @@ -84,7 +84,7 @@ int PMPI_Get_library_version (char *version,int *len){ int PMPI_Init_thread(int *argc, char ***argv, int required, int *provided) { if (provided != NULL) { - *provided = MPI_THREAD_MULTIPLE; + *provided = MPI_THREAD_SINGLE; } return MPI_Init(argc, argv); } @@ -96,7 +96,7 @@ int PMPI_Query_thread(int *provided) if (provided == NULL) { retval = MPI_ERR_ARG; } else { - *provided = MPI_THREAD_MULTIPLE; + *provided = MPI_THREAD_SINGLE; retval = MPI_SUCCESS; } return retval; @@ -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) @@ -2407,9 +2410,9 @@ int PMPI_Get_processor_name(char *name, int *resultlen) { int retval = MPI_SUCCESS; - strncpy(name, SIMIX_host_get_name(SIMIX_host_self()), - strlen(SIMIX_host_get_name(SIMIX_host_self())) < MPI_MAX_PROCESSOR_NAME - 1 ? - strlen(SIMIX_host_get_name(SIMIX_host_self())) +1 : + strncpy(name, sg_host_get_name(SIMIX_host_self()), + strlen(sg_host_get_name(SIMIX_host_self())) < MPI_MAX_PROCESSOR_NAME - 1 ? + strlen(sg_host_get_name(SIMIX_host_self())) +1 : MPI_MAX_PROCESSOR_NAME - 1 ); *resultlen = strlen(name) >