-/* Copyright (c) 2007-2014. The SimGrid Team.
+/* Copyright (c) 2007-2015. The SimGrid Team.
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
proc->context->cleanup_func=SIMIX_process_cleanup;
char* instance_id = (*argv)[1];
int rank = atoi((*argv)[2]);
- index = smpi_process_index_of_smx_process(proc);
+ /* Now using segment index of the process */
+ index = proc->segment_index;
if(!index_to_process_data){
index_to_process_data=(int*)xbt_malloc(SIMIX_process_count()*sizeof(int));
}
+
+ if(smpi_privatize_global_variables){
+ /* Done at the process's creation */
+ SMPI_switch_data_segment(index);
+ }
+
MPI_Comm* temp_comm_world;
xbt_bar_t temp_bar;
smpi_deployment_register_process(instance_id, rank, index, &temp_comm_world ,&temp_bar);
simcall_rdv_set_receiver(data->mailbox_small, proc);
XBT_DEBUG("<%d> New process in the game: %p", index, proc);
- if(smpi_privatize_global_variables){
- smpi_switch_data_segment(index);
- }
-
}
if (smpi_process_data() == NULL)
xbt_die("smpi_process_data() returned NULL. You probably gave a NULL parameter to MPI_Init. Although it's required by MPI-2, this is currently not supported by SMPI.");
TRACE_add_end_function(TRACE_smpi_release);
SIMIX_global_init(&argc, argv);
+ MSG_init(&argc,argv);
+
+ SMPI_switch_data_segment = smpi_switch_data_segment;
smpi_init_options();
xbt_os_walltimer_stop(global_timer);
if (sg_cfg_get_boolean("smpi/display_timing")){
double global_time = xbt_os_timer_elapsed(global_timer);
- XBT_INFO("Simulated time: %g seconds. \n "
+ XBT_INFO("Simulated time: %g seconds. \n\n"
"The simulation took %g seconds (after parsing and platform setup)\n"
"%g seconds were actual computation of the application"
, SIMIX_get_clock(), global_time , smpi_total_benched_time);