Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Move pending_recv_request_queues into host_data (ie, wanna be process_data)
[simgrid.git] / src / smpi / smpi_receiver.c
index a8eeea9..ff6d1d8 100644 (file)
@@ -3,10 +3,11 @@
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_receiver, smpi,
                                 "Logging specific to SMPI (receiver)");
 
-int smpi_receiver(int argc, char **argv)
+int smpi_receiver(int argc, char*argv[])
 {
+       smpi_host_data_t mydata = SIMIX_process_get_data(SIMIX_process_self());
   smx_process_t self;
-  int index;
+  int index = mydata->index;
 
   xbt_fifo_t request_queue;
   xbt_fifo_t message_queue;
@@ -21,9 +22,7 @@ int smpi_receiver(int argc, char **argv)
 
   self = SIMIX_process_self();
 
-  index = smpi_host_index();
-
-  request_queue = smpi_global->pending_recv_request_queues[index];
+  request_queue = mydata->pending_recv_request_queue;
   message_queue = smpi_global->received_message_queues[index];
 
   smpi_global->receiver_processes[index] = self;