From: pini Date: Wed, 20 Jan 2010 14:45:42 +0000 (+0000) Subject: In smpi_mpi.c: X-Git-Tag: SVN~710 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/d188d7e6c38de029024a5c9a2aaffb144f241447 In smpi_mpi.c: * Fixed source/destination ranks in requests * Added missing timing functions In smpi_global.c: * Setting default reference_speed value git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@7021 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- diff --git a/src/smpi/smpi_global.c b/src/smpi/smpi_global.c index bef49b1db8..aef451ddb5 100644 --- a/src/smpi/smpi_global.c +++ b/src/smpi/smpi_global.c @@ -153,6 +153,10 @@ void smpi_global_init() smpi_global = xbt_new(s_smpi_global_t, 1); + // config vars + smpi_global->reference_speed = + xbt_cfg_get_double(_surf_cfg_set, "reference_speed"); + // mallocators smpi_global->request_mallocator = xbt_mallocator_new(SMPI_REQUEST_MALLOCATOR_SIZE, smpi_request_new, diff --git a/src/smpi/smpi_mpi.c b/src/smpi/smpi_mpi.c index 22f9ae52d8..9914838ceb 100644 --- a/src/smpi/smpi_mpi.c +++ b/src/smpi/smpi_mpi.c @@ -113,10 +113,11 @@ int SMPI_MPI_Irecv(void *buf, int count, MPI_Datatype datatype, int src, int tag, MPI_Comm comm, MPI_Request * request) { int retval = MPI_SUCCESS; + int rank; smpi_bench_end(); - - retval = smpi_create_request(buf, count, datatype, src, 0, tag, comm, + rank = smpi_mpi_comm_rank(comm); + retval = smpi_create_request(buf, count, datatype, src, rank, tag, comm, request); if (NULL != *request && MPI_SUCCESS == retval) { retval = smpi_mpi_irecv(*request); @@ -131,11 +132,13 @@ int SMPI_MPI_Recv(void *buf, int count, MPI_Datatype datatype, int src, int tag, MPI_Comm comm, MPI_Status * status) { int retval = MPI_SUCCESS; + int rank; smpi_mpi_request_t request; smpi_bench_end(); - retval = smpi_create_request(buf, count, datatype, src, 0, tag, comm, + rank = smpi_mpi_comm_rank(comm); + retval = smpi_create_request(buf, count, datatype, src, rank, tag, comm, &request); if (NULL != request && MPI_SUCCESS == retval) { retval = smpi_mpi_irecv(request); @@ -154,10 +157,12 @@ int SMPI_MPI_Isend(void *buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm, MPI_Request * request) { int retval = MPI_SUCCESS; + int rank; smpi_bench_end(); - retval = smpi_create_request(buf, count, datatype, 0, dst, tag, comm, + rank = smpi_mpi_comm_rank(comm); + retval = smpi_create_request(buf, count, datatype, rank, dst, tag, comm, request); if (NULL != *request && MPI_SUCCESS == retval) { retval = smpi_mpi_isend(*request); @@ -175,11 +180,13 @@ int SMPI_MPI_Send(void *buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm) { int retval = MPI_SUCCESS; + int rank; smpi_mpi_request_t request; smpi_bench_end(); - retval = smpi_create_request(buf, count, datatype, 0, dst, tag, comm, + rank = smpi_mpi_comm_rank(comm); + retval = smpi_create_request(buf, count, datatype, rank, dst, tag, comm, &request); if (NULL != request && MPI_SUCCESS == retval) { retval = smpi_mpi_isend(request); @@ -253,18 +260,33 @@ int retval = MPI_SUCCESS; **/ int SMPI_MPI_Wait(MPI_Request * request, MPI_Status * status) { - return smpi_mpi_wait(*request, status); + int retval; + + smpi_bench_end(); + retval = smpi_mpi_wait(*request, status); + smpi_bench_begin(); + return retval; } int SMPI_MPI_Waitall(int count, MPI_Request requests[], MPI_Status status[]) { - return smpi_mpi_waitall(count, requests, status); + int retval; + + smpi_bench_end(); + retval = smpi_mpi_waitall(count, requests, status); + smpi_bench_begin(); + return retval; } int SMPI_MPI_Waitany(int count, MPI_Request requests[], int *index, MPI_Status status[]) { - return smpi_mpi_waitany(count, requests, index, status); + int retval; + + smpi_bench_end(); + retval = smpi_mpi_waitany(count, requests, index, status); + smpi_bench_begin(); + return retval; } /**