Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Kill another useless synchronization source: no one will interupt you in simulation
[simgrid.git] / src / smpi / smpi_sender.c
index 76b43e8..f8f9aa9 100644 (file)
@@ -11,7 +11,6 @@ int smpi_sender(int argc, char **argv)
   int index;
 
   xbt_fifo_t request_queue;
   int index;
 
   xbt_fifo_t request_queue;
-  smx_mutex_t request_queue_mutex;
 
   int running_hosts_count;
 
 
   int running_hosts_count;
 
@@ -32,39 +31,15 @@ int smpi_sender(int argc, char **argv)
   self = SIMIX_process_self();
   shost = SIMIX_host_self();
 
   self = SIMIX_process_self();
   shost = SIMIX_host_self();
 
-  // make sure root is done before own initialization
-  SIMIX_mutex_lock(smpi_global->start_stop_mutex);
-  while (!smpi_global->root_ready) {
-    SIMIX_cond_wait(smpi_global->start_stop_cond,
-                    smpi_global->start_stop_mutex);
-  }
-  SIMIX_mutex_unlock(smpi_global->start_stop_mutex);
-
   index = smpi_host_index();
 
   request_queue = smpi_global->pending_send_request_queues[index];
   index = smpi_host_index();
 
   request_queue = smpi_global->pending_send_request_queues[index];
-  request_queue_mutex =
-    smpi_global->pending_send_request_queues_mutexes[index];
 
   smpi_global->sender_processes[index] = self;
 
 
   smpi_global->sender_processes[index] = self;
 
-  // wait for all nodes to signal initializatin complete
-  SIMIX_mutex_lock(smpi_global->start_stop_mutex);
-  smpi_global->ready_process_count++;
-  if (smpi_global->ready_process_count >= 3 * smpi_global->host_count) {
-    SIMIX_cond_broadcast(smpi_global->start_stop_cond);
-  }
-  while (smpi_global->ready_process_count < 3 * smpi_global->host_count) {
-    SIMIX_cond_wait(smpi_global->start_stop_cond,
-                    smpi_global->start_stop_mutex);
-  }
-  SIMIX_mutex_unlock(smpi_global->start_stop_mutex);
-
   do {
 
   do {
 
-    SIMIX_mutex_lock(request_queue_mutex);
     request = xbt_fifo_shift(request_queue);
     request = xbt_fifo_shift(request_queue);
-    SIMIX_mutex_unlock(request_queue_mutex);
 
     if (NULL == request) {
       SIMIX_process_suspend(self);
 
     if (NULL == request) {
       SIMIX_process_suspend(self);
@@ -91,9 +66,7 @@ int smpi_sender(int argc, char **argv)
       if (0 < request->forward) {
         request->dst =
           (request->dst + message->forward + 1) % request->comm->size;
       if (0 < request->forward) {
         request->dst =
           (request->dst + message->forward + 1) % request->comm->size;
-        SIMIX_mutex_lock(request_queue_mutex);
         xbt_fifo_push(request_queue, request);
         xbt_fifo_push(request_queue, request);
-        SIMIX_mutex_unlock(request_queue_mutex);
       } else {
         request->completed = 1;
       }
       } else {
         request->completed = 1;
       }
@@ -113,10 +86,7 @@ int smpi_sender(int argc, char **argv)
         SIMIX_cond_wait(request->cond, request->mutex);
       }
 
         SIMIX_cond_wait(request->cond, request->mutex);
       }
 
-      SIMIX_mutex_lock(smpi_global->received_message_queues_mutexes[dindex]);
       xbt_fifo_push(smpi_global->received_message_queues[dindex], message);
       xbt_fifo_push(smpi_global->received_message_queues[dindex], message);
-      SIMIX_mutex_unlock(smpi_global->received_message_queues_mutexes
-                         [dindex]);
 
       SIMIX_unregister_action_to_condition(action, request->cond);
       SIMIX_action_destroy(action);
 
       SIMIX_unregister_action_to_condition(action, request->cond);
       SIMIX_action_destroy(action);
@@ -131,9 +101,7 @@ int smpi_sender(int argc, char **argv)
 
     }
 
 
     }
 
-    SIMIX_mutex_lock(smpi_global->running_hosts_count_mutex);
     running_hosts_count = smpi_global->running_hosts_count;
     running_hosts_count = smpi_global->running_hosts_count;
-    SIMIX_mutex_unlock(smpi_global->running_hosts_count_mutex);
 
   } while (0 < running_hosts_count);
 
 
   } while (0 < running_hosts_count);