Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Kill another useless synchronization source: no one will interupt you in simulation
authormquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Tue, 23 Jun 2009 15:07:27 +0000 (15:07 +0000)
committermquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Tue, 23 Jun 2009 15:07:27 +0000 (15:07 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@6335 48e7efb5-ca39-0410-a469-dd3cf9ba447f

src/smpi/private.h
src/smpi/smpi_base.c
src/smpi/smpi_global.c
src/smpi/smpi_receiver.c
src/smpi/smpi_sender.c

index 5f731a5..f3e8515 100644 (file)
@@ -98,7 +98,6 @@ typedef struct smpi_global_t {
   smx_process_t *receiver_processes;
 
   int running_hosts_count;
   smx_process_t *receiver_processes;
 
   int running_hosts_count;
-  smx_mutex_t running_hosts_count_mutex;
 
   xbt_os_timer_t timer;
   smx_mutex_t timer_mutex;
 
   xbt_os_timer_t timer;
   smx_mutex_t timer_mutex;
index 8378556..8137545 100644 (file)
@@ -52,9 +52,7 @@ void smpi_init_process()
   int i;
   smpi_host_data_t hdata;
 
   int i;
   smpi_host_data_t hdata;
 
-  SIMIX_mutex_lock(smpi_global->running_hosts_count_mutex);
   smpi_global->running_hosts_count++;
   smpi_global->running_hosts_count++;
-  SIMIX_mutex_unlock(smpi_global->running_hosts_count_mutex);
 
   // initialize some local variables
   host = SIMIX_host_self();
 
   // initialize some local variables
   host = SIMIX_host_self();
@@ -76,9 +74,7 @@ void smpi_mpi_finalize()
 {
   int i;
 
 {
   int i;
 
-  SIMIX_mutex_lock(smpi_global->running_hosts_count_mutex);
   i = --smpi_global->running_hosts_count;
   i = --smpi_global->running_hosts_count;
-  SIMIX_mutex_unlock(smpi_global->running_hosts_count_mutex);
 
   SIMIX_mutex_destroy(smpi_host_mutex());
   SIMIX_cond_destroy(smpi_host_cond());
 
   SIMIX_mutex_destroy(smpi_host_mutex());
   SIMIX_cond_destroy(smpi_host_cond());
index 7d52216..91287da 100644 (file)
@@ -153,7 +153,6 @@ void smpi_global_init()
   smpi_global->host_count = 0;
 
   // running hosts
   smpi_global->host_count = 0;
 
   // running hosts
-  smpi_global->running_hosts_count_mutex = SIMIX_mutex_init();
   smpi_global->running_hosts_count = 0;
 
   // mallocators
   smpi_global->running_hosts_count = 0;
 
   // mallocators
@@ -236,9 +235,6 @@ void smpi_global_destroy()
   xbt_free(smpi_global->sender_processes);
   xbt_free(smpi_global->receiver_processes);
 
   xbt_free(smpi_global->sender_processes);
   xbt_free(smpi_global->receiver_processes);
 
-  // running hosts
-  SIMIX_mutex_destroy(smpi_global->running_hosts_count_mutex);
-
   // mallocators
   xbt_mallocator_free(smpi_global->request_mallocator);
   xbt_mallocator_free(smpi_global->message_mallocator);
   // mallocators
   xbt_mallocator_free(smpi_global->request_mallocator);
   xbt_mallocator_free(smpi_global->message_mallocator);
index 5797911..be02907 100644 (file)
@@ -83,9 +83,7 @@ int smpi_receiver(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);
 
index 0d2c433..f8f9aa9 100644 (file)
@@ -101,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);