Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
using mpi_comm_world to get the global rank
authorschnorr <schnorr@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Thu, 14 Oct 2010 16:14:09 +0000 (16:14 +0000)
committerschnorr <schnorr@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Thu, 14 Oct 2010 16:14:09 +0000 (16:14 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@8428 48e7efb5-ca39-0410-a469-dd3cf9ba447f

src/smpi/smpi_mpi.c

index 0f08ff8..bc4b3cb 100644 (file)
@@ -1085,14 +1085,7 @@ int MPI_Waitany(int count, MPI_Request requests[], int *index,
       xbt_dynar_insert_at(recvs, i, t);
     }
   }
-
-  //search for a suitable request to give the rank of current mpi proc
-  MPI_Request req = NULL;
-  for (i = 0; i < count && req == NULL; i++) {
-    req = requests[i];
-  }
-  MPI_Comm comm = (req)->comm;
-  int rank_traced = smpi_comm_rank(comm);
+  int rank_traced = smpi_comm_rank(MPI_COMM_WORLD);
   TRACE_smpi_ptp_in(rank_traced, -1, -1, __FUNCTION__);
 #endif
   if (index == NULL) {
@@ -1141,14 +1134,7 @@ int MPI_Waitall(int count, MPI_Request requests[], MPI_Status status[])
     xbt_dynar_insert_at(dsts, i, adst);
     xbt_dynar_insert_at(recvs, i, arecv);
   }
-
-//  find my rank inside one of MPI_Comm's of the requests
-  MPI_Request req = NULL;
-  for (i = 0; i < count && req == NULL; i++) {
-    req = requests[i];
-  }
-  MPI_Comm comm = (req)->comm;
-  int rank_traced = smpi_comm_rank(comm);
+  int rank_traced = smpi_comm_rank (MPI_COMM_WORLD);
   TRACE_smpi_ptp_in(rank_traced, -1, -1, __FUNCTION__);
 #endif
   smpi_mpi_waitall(count, requests, status);