#include "mc/mc.h"
#include "src/mc/mc_replay.h"
#include "src/mc/mc_client.h"
+#include "src/simix/smx_private.hpp"
+
+#ifdef HAVE_SMPI
+#include "src/smpi/private.h"
+#endif
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(simix_process, simix,
"Logging specific to SIMIX (process)");
process->data = data;
process->comms = xbt_fifo_new();
process->simcall.issuer = process;
+ /* Initiliaze data segment to default value */
+ SIMIX_segment_index_set(process, -1);
- if (parent_process) {
+ if (parent_process != NULL) {
process->ppid = SIMIX_process_get_PID(parent_process);
+ /* SMPI process have their own data segment and
+ each other inherit from their father */
+#ifdef HAVE_SMPI
+ if(smpi_privatize_global_variables){
+ if( parent_process->pid != 0){
+ SIMIX_segment_index_set(process, parent_process->segment_index);
+ } else {
+ SIMIX_segment_index_set(process, process->pid - 1);
+ }
+ }
+#endif
} else {
process->ppid = -1;
}
return process->host;
}
+xbt_main_func_t SIMIX_process_get_code(void){
+ return SIMIX_process_self()->code;
+}
+
/* needs to be public and without simcall because it is called
by exceptions and logging events */
const char* SIMIX_process_self_get_name(void) {
SMX_THROW();
}
+ if(SMPI_switch_data_segment && self->segment_index != -1){
+ SMPI_switch_data_segment(self->segment_index);
+ }
}
/* callback: context fetching */
}
return new_process;
}
+
+void SIMIX_segment_index_set(smx_process_t proc, int index){
+ proc->segment_index = index;
+}