Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
SMPI: Use the amount of processes to malloc the process list, not the amount of hosts
authormquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Thu, 25 Jun 2009 09:16:39 +0000 (09:16 +0000)
committermquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Thu, 25 Jun 2009 09:16:39 +0000 (09:16 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@6351 48e7efb5-ca39-0410-a469-dd3cf9ba447f

ChangeLog
src/smpi/smpi_base.c
src/smpi/smpi_global.c

index f461518..e79c503 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -53,6 +53,9 @@ SimGrid (3.4-svn) unstable; urgency=high
     
  SMPI:
   * Massive internal cleanups:
+    - Store internal structures on processes instead of hosts (allows
+      to have more than one process per host, in addition of being more 
+      logical)
     - Cleanup the initialization/finalization process
     - Kill a whole bunch of unneeded synchronization: 
       processes run in exclusive manner within the simulator
index 1fbeabe..1d619ba 100644 (file)
@@ -58,6 +58,7 @@ void smpi_process_init(int *argc, char***argv)
 
   /* get rank from command line, and remove it from argv */
   pdata->index = atoi( (*argv)[1] );
+  DEBUG1("I'm rank %d",pdata->index);
   if (*argc>2) {
          memmove((*argv)[1],(*argv)[2], sizeof(char*)* (*argc-2));
          (*argv)[ (*argc)-1] = NULL;
index 1578d7a..fc9d793 100644 (file)
@@ -130,8 +130,6 @@ void smpi_global_init()
 {
   int i;
 
-  int size = SIMIX_host_get_number();
-
   /* Connect our log channels: that must be done manually under windows */
 #ifdef XBT_LOG_CONNECT
   XBT_LOG_CONNECT(smpi_base, smpi);
@@ -155,8 +153,11 @@ void smpi_global_init()
     xbt_mallocator_new(SMPI_MESSAGE_MALLOCATOR_SIZE, smpi_message_new,
                        smpi_message_free, smpi_message_reset);
 
+  smpi_global->process_count = SIMIX_process_count();
+  fprintf(stderr,"There is %d processes\n",smpi_global->process_count);
+
   // sender/receiver processes
-  smpi_global->main_processes = xbt_new(smx_process_t, size);
+  smpi_global->main_processes = xbt_new(smx_process_t, smpi_global->process_count);
 
   // timers
   smpi_global->timer = xbt_os_timer_new();
@@ -167,7 +168,6 @@ void smpi_global_init()
   smpi_global->do_once_duration = NULL;
   smpi_global->do_once_mutex = SIMIX_mutex_init();
 
-  smpi_global->process_count = SIMIX_process_count();
 
   smpi_mpi_global = xbt_new(s_smpi_mpi_global_t, 1);