Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
In smpi_mpi.c:
authorpini <pini@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Wed, 20 Jan 2010 14:45:42 +0000 (14:45 +0000)
committerpini <pini@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Wed, 20 Jan 2010 14:45:42 +0000 (14:45 +0000)
  * 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

src/smpi/smpi_global.c
src/smpi/smpi_mpi.c

index bef49b1..aef451d 100644 (file)
@@ -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,
index 22f9ae5..9914838 100644 (file)
@@ -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;
 }
 
 /**