if (parent_process != nullptr) {
process->ppid = parent_process->pid;
-/* SMPI process have their own data segment and each other inherit from their father */
-#if HAVE_SMPI
- if (smpi_privatize_global_variables == SMPI_PRIVATIZE_MMAP) {
- if (parent_process->pid != 0) {
- process->segment_index = parent_process->segment_index;
- } else {
- process->segment_index = process->pid - 1;
- }
- }
-#endif
}
process->code = code;
if (parent_process != nullptr) {
process->ppid = parent_process->pid;
- /* SMPI process have their own data segment and each other inherit from their father */
-#if HAVE_SMPI
- if (smpi_privatize_global_variables == SMPI_PRIVATIZE_MMAP) {
- if (parent_process->pid != 0) {
- process->segment_index = parent_process->segment_index;
- } else {
- process->segment_index = process->pid - 1;
- }
- }
-#endif
}
/* Process data for auto-restart */
std::rethrow_exception(std::move(exception));
}
- if(SMPI_switch_data_segment && self->segment_index != -1){
- SMPI_switch_data_segment(self->segment_index);
+ if(SMPI_switch_data_segment){
+ SMPI_switch_data_segment(self->pid);
}
}
std::function<void()> code;
smx_timer_t kill_timer = nullptr;
- int segment_index = -1; /* Reference to an SMPI process' data segment. Default value is -1 if not in SMPI context*/
/* Refcounting */
private:
int my_proc_id = proc->getPid();
if(smpi_privatize_global_variables == SMPI_PRIVATIZE_MMAP){
/* Now using the segment index of this process */
- my_proc_id = proc->getImpl()->segment_index;
process->set_privatized_region(smpi_init_global_memory_segment_process());
/* Done at the process's creation */
SMPI_switch_data_segment(my_proc_id);