Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
cosmetics (use xbt_fifo_foreach where relevant)
authormquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Tue, 23 Jun 2009 15:07:53 +0000 (15:07 +0000)
committermquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Tue, 23 Jun 2009 15:07:53 +0000 (15:07 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@6337 48e7efb5-ca39-0410-a469-dd3cf9ba447f

src/smpi/smpi_mpi.c
src/smpi/smpi_receiver.c

index 4a939a1..4853744 100644 (file)
@@ -18,7 +18,7 @@ int SMPI_MPI_Finalize()
 }
 
 // right now this just exits the current node, should send abort signal to all
-// hosts in the communicator;
+// hosts in the communicator (TODO)
 int SMPI_MPI_Abort(MPI_Comm comm, int errorcode)
 {
   smpi_exit(errorcode);
index be02907..a8eeea9 100644 (file)
@@ -32,14 +32,9 @@ int smpi_receiver(int argc, char **argv)
 
     // FIXME: better algorithm, maybe some kind of balanced tree? or a heap?
 
-    for (request_item = xbt_fifo_get_first_item(request_queue);
-         NULL != request_item;
-         request_item = xbt_fifo_get_next_item(request_item)) {
-      request = xbt_fifo_get_item_content(request_item);
-      for (message_item = xbt_fifo_get_first_item(message_queue);
-           NULL != message_item;
-           message_item = xbt_fifo_get_next_item(message_item)) {
-        message = xbt_fifo_get_item_content(message_item);
+       xbt_fifo_foreach(request_queue,request_item,request,smpi_mpi_request_t){
+         xbt_fifo_foreach(message_queue,message_item,message, smpi_received_message_t) {
+
         if (request->comm == message->comm &&
             (MPI_ANY_SOURCE == request->src || request->src == message->src)
             && (MPI_ANY_TAG == request->tag || request->tag == message->tag)) {