-
- 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);
- XBT_LOG_CONNECT(smpi_bench, smpi);
- XBT_LOG_CONNECT(smpi_kernel, smpi);
- XBT_LOG_CONNECT(smpi_mpi, smpi);
- XBT_LOG_CONNECT(smpi_receiver, smpi);
- XBT_LOG_CONNECT(smpi_sender, smpi);
- XBT_LOG_CONNECT(smpi_util, smpi);
-#endif
-
- smpi_global = xbt_new(s_smpi_global_t, 1);
- // config variable
- smpi_global->reference_speed = SMPI_DEFAULT_SPEED;
-
- // host info blank until sim starts
- // FIXME: is this okay?
- smpi_global->hosts = NULL;
- smpi_global->host_count = 0;
-
- // mallocators
- smpi_global->request_mallocator =
- xbt_mallocator_new(SMPI_REQUEST_MALLOCATOR_SIZE, smpi_request_new,
- smpi_request_free, smpi_request_reset);
- smpi_global->message_mallocator =
- xbt_mallocator_new(SMPI_MESSAGE_MALLOCATOR_SIZE, smpi_message_new,
- smpi_message_free, smpi_message_reset);
-
- // queues
- smpi_global->received_message_queues = xbt_new(xbt_fifo_t, size);
-
- // sender/receiver processes
- smpi_global->main_processes = xbt_new(smx_process_t, size);
-
- // timers
- smpi_global->timer = xbt_os_timer_new();
- smpi_global->timer_mutex = SIMIX_mutex_init();
- smpi_global->timer_cond = SIMIX_cond_init();
-
- smpi_global->do_once_duration_nodes = NULL;
- smpi_global->do_once_duration = NULL;
- smpi_global->do_once_mutex = SIMIX_mutex_init();
-
- for (i = 0; i < size; i++) {
- smpi_global->received_message_queues[i] = xbt_fifo_new();
+ MPI_Group group;
+
+ SIMIX_network_set_copy_data_callback(&SIMIX_network_copy_buffer_callback);
+ process_count = SIMIX_process_count();
+ process_data = xbt_new(smpi_process_data_t, process_count);
+ for(i = 0; i < process_count; i++) {
+ process_data[i] = xbt_new(s_smpi_process_data_t, 1);
+ process_data[i]->index = i;
+ process_data[i]->pending_sent = xbt_fifo_new();
+ process_data[i]->pending_recv = xbt_fifo_new();
+ process_data[i]->timer = xbt_os_timer_new();
+ group = smpi_group_new(1);
+ process_data[i]->comm_self = smpi_comm_new(group);
+ smpi_group_set_mapping(group, i, 0);