smpi_global->start_stop_mutex = SIMIX_mutex_init();
smpi_global->start_stop_cond = SIMIX_cond_init();
- // processes
- smpi_global->sender_processes = xbt_new(smx_process_t, size);
- smpi_global->receiver_processes = xbt_new(smx_process_t, size);
+ // host info blank until sim starts
+ // FIXME: is this okay?
+ smpi_global->hosts = NULL;
+ smpi_global->host_count = 0;
// running hosts
smpi_global->running_hosts_count_mutex = SIMIX_mutex_init();
smpi_global->received_message_queues = xbt_new(xbt_fifo_t, size);
smpi_global->received_message_queues_mutexes = xbt_new(smx_mutex_t, size);
+ // sender/receiver processes
+ smpi_global->sender_processes = xbt_new(smx_process_t, size);
+ smpi_global->receiver_processes = xbt_new(smx_process_t, size);
+
// timers
smpi_global->timers = xbt_new(xbt_os_timer_t, size);
smpi_global->timers_mutexes = xbt_new(smx_mutex_t, size);
smpi_global = NULL;
}
+int smpi_host_index()
+{
+ smx_host_t host = SIMIX_host_self();
+ smpi_host_data_t hdata = (smpi_host_data_t)SIMIX_host_get_data(host);
+
+ return hdata->index;
+}
+
int smpi_run_simulation(int argc, char **argv)
{
xbt_fifo_item_t cond_item = NULL;