From: mquinson Date: Thu, 25 Jun 2009 09:16:39 +0000 (+0000) Subject: SMPI: Use the amount of processes to malloc the process list, not the amount of hosts X-Git-Tag: SVN~1289 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/abacf1fc86b15392727e4fedb38da442167fd51d?hp=1e356ccf3f40973c033d35177172838dd5b7854f SMPI: Use the amount of processes to malloc the process list, not the amount of hosts git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@6351 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- diff --git a/ChangeLog b/ChangeLog index f461518e41..e79c503304 100644 --- 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 diff --git a/src/smpi/smpi_base.c b/src/smpi/smpi_base.c index 1fbeabea80..1d619ba9de 100644 --- a/src/smpi/smpi_base.c +++ b/src/smpi/smpi_base.c @@ -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; diff --git a/src/smpi/smpi_global.c b/src/smpi/smpi_global.c index 1578d7a74d..fc9d793303 100644 --- a/src/smpi/smpi_global.c +++ b/src/smpi/smpi_global.c @@ -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);