+ 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);
+
+ // global communicator
+ smpi_mpi_global->mpi_comm_world = xbt_new(s_smpi_mpi_communicator_t, 1);
+ smpi_mpi_global->mpi_comm_world->size = smpi_global->host_count;
+ smpi_mpi_global->mpi_comm_world->barrier_count = 0;
+ smpi_mpi_global->mpi_comm_world->barrier_mutex = SIMIX_mutex_init();
+ smpi_mpi_global->mpi_comm_world->barrier_cond = SIMIX_cond_init();
+ smpi_mpi_global->mpi_comm_world->rank_to_index_map =
+ xbt_new(int, smpi_global->host_count);
+ smpi_mpi_global->mpi_comm_world->index_to_rank_map =
+ xbt_new(int, smpi_global->host_count);
+ for (i = 0; i < smpi_global->host_count; i++) {
+ smpi_mpi_global->mpi_comm_world->rank_to_index_map[i] = i;
+ smpi_mpi_global->mpi_comm_world->index_to_rank_map[i] = i;
+ }
+
+ // mpi datatypes
+ smpi_mpi_global->mpi_byte = xbt_new(s_smpi_mpi_datatype_t, 1);
+ smpi_mpi_global->mpi_byte->size = (size_t) 1;
+ smpi_mpi_global->mpi_int = xbt_new(s_smpi_mpi_datatype_t, 1);
+ smpi_mpi_global->mpi_int->size = sizeof(int);
+ smpi_mpi_global->mpi_double = xbt_new(s_smpi_mpi_datatype_t, 1);
+ smpi_mpi_global->mpi_double->size = sizeof(double);
+
+ // mpi operations
+ smpi_mpi_global->mpi_land = xbt_new(s_smpi_mpi_op_t, 1);
+ smpi_mpi_global->mpi_land->func = smpi_mpi_land_func;
+ smpi_mpi_global->mpi_sum = xbt_new(s_smpi_mpi_op_t, 1);
+ smpi_mpi_global->mpi_sum->func = smpi_mpi_sum_func;
+