Users should call xbt_ex_free() themselves.
SMPI:
- * Cleanup the initialization process
- * Improve smpirun to accept -platform and -hostfile arguments
- * Kill a whole bunch of unneeded synchronization: processes run in
- exclusive manner within the simulator
+ * Massive internal cleanups:
+ - Cleanup the initialization/finalization process
+ - Kill a whole bunch of unneeded synchronization:
+ processes run in exclusive manner within the simulator
+ - Move queues from global tables to process data fields
+ * Improve smpirun:
+ - now accept -platform and -hostfile arguments
+ - Pass the right rank value to processes according on hostfile
Build Chain:
* Do not require doxygen in maintainer mode
// state vars
- smx_host_t *hosts; //FIXME:killme
int host_count;
xbt_mallocator_t request_mallocator;
xbt_mallocator_t message_mallocator;
typedef struct smpi_host_data_t *smpi_host_data_t;
// function prototypes
-void smpi_process_init(void);
+void smpi_process_init(int *argc,char ***argv);
void smpi_process_finalize(void);
int smpi_mpi_comm_rank(smpi_mpi_communicator_t comm);
return comm->index_to_rank_map[smpi_host_index()];
}
-void smpi_process_init()
+void smpi_process_init(int *argc, char***argv)
{
smx_host_t host;
- int i;
smpi_host_data_t hdata;
// initialize some local variables
SIMIX_host_set_data(host, hdata);
SIMIX_process_set_data(SIMIX_process_self(),hdata);
- for (i = 0; i < smpi_global->host_count && host != smpi_global->hosts[i]; i++);
+ /* get rank from command line, and remove it from argv */
+ hdata->index = atoi( (*argv)[1] );
+ if (*argc>2) {
+ memmove((*argv)[1],(*argv)[2], sizeof(char*)* (*argc-2));
+ (*argv)[ (*argc)-1] = NULL;
+ }
+ (*argc)--;
- hdata->index = i;
hdata->mutex = SIMIX_mutex_init();
hdata->cond = SIMIX_cond_init();
hdata->finalize = 0;
// host info blank until sim starts
// FIXME: is this okay?
- smpi_global->hosts = NULL;
smpi_global->host_count = 0;
// mallocators
smpi_global->do_once_duration = NULL;
smpi_global->do_once_mutex = SIMIX_mutex_init();
- smpi_global->hosts = SIMIX_host_get_table();
smpi_global->host_count = SIMIX_host_get_number();
smpi_mpi_global = xbt_new(s_smpi_mpi_global_t, 1);
int SMPI_MPI_Init(int *argc, char ***argv)
{
- smpi_process_init();
+ smpi_process_init(argc,argv);
smpi_bench_begin();
return MPI_SUCCESS;
}
##-------------------------------- DEFAULT or SPECIFIED PLATFORM --------------------------------------
if [ -z "${PLATFORM}" ]; then
PLATFORMTMP="$(mktemp tmpXXXXXX)"
- #PLATFORMTMP="pla.xml"
cat > ${PLATFORMTMP} <<PLATFORMHEAD
<?xml version='1.0'?>
host="${hostnames[$j]}"
fi
echo " <process host=\"${host}\" function=\"smpi_simulated_main\">" >> ${APPLICATIONTMP}
+ echo " <argument value=\"$j\"/> <!-- rank -->" >> ${APPLICATIONTMP}
for ARG in $*; do
echo " <argument value=\"${ARG}\"/>" >> ${APPLICATIONTMP}
done