- 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;
- }
-
- /* Process data for auto-restart */
- process->auto_restart = auto_restart;
- process->code = code;
-
- XBT_VERB("Create context %s", process->name.c_str());
- process->context = SIMIX_context_new(
- std::move(code),
- simix_global->cleanup_process_function, process);
-
- /* Add properties */
- process->properties = properties;
-
- /* Add the process to it's host process list */
- xbt_swag_insert(process, sg_host_simix(host)->process_list);
-
- XBT_DEBUG("Start context '%s'", process->name.c_str());
-
- /* Now insert it in the global process list and in the process to run list */
- xbt_swag_insert(process, simix_global->process_list);
- XBT_DEBUG("Inserting %s(%s) in the to_run list",
- process->name.c_str(), sg_host_get_name(host));
- xbt_dynar_push_as(simix_global->process_to_run, smx_process_t, process);
-
- if (kill_time > SIMIX_get_clock() && simix_global->kill_process_function) {
- XBT_DEBUG("Process %s(%s) will be kill at time %f",
- process->name.c_str(), sg_host_get_name(process->host), kill_time);
- process->kill_timer = SIMIX_timer_set(kill_time, [=]() {
- simix_global->kill_process_function(process);
- });
+ if (smpi_privatize_global_variables == SMPI_PRIVATIZE_MMAP) {
+ if (parent_process->pid != 0) {
+ SIMIX_segment_index_set(process, parent_process->segment_index);
+ } else {
+ SIMIX_segment_index_set(process, process->pid - 1);
+ }