From bdaa135f5f4c27c592daf1483894bcbb0eeb9aa9 Mon Sep 17 00:00:00 2001 From: Christian Heinrich Date: Wed, 17 Jan 2018 21:16:05 +0100 Subject: [PATCH] [SIMIX] Remove SMPI-specific segment_index notion from the Actor class Privatization is now done via the process id and attached to the SMPI process. --- src/simix/ActorImpl.cpp | 24 ++---------------------- src/simix/ActorImpl.hpp | 1 - src/smpi/internals/smpi_process.cpp | 1 - 3 files changed, 2 insertions(+), 24 deletions(-) diff --git a/src/simix/ActorImpl.cpp b/src/simix/ActorImpl.cpp index 94dfdaffa4..63bef0510e 100644 --- a/src/simix/ActorImpl.cpp +++ b/src/simix/ActorImpl.cpp @@ -325,16 +325,6 @@ smx_actor_t SIMIX_process_create(const char* name, std::function code, v 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; @@ -398,16 +388,6 @@ smx_actor_t SIMIX_process_attach(const char* name, void* data, const char* hostn 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 */ @@ -783,8 +763,8 @@ void SIMIX_process_yield(smx_actor_t self) 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); } } diff --git a/src/simix/ActorImpl.hpp b/src/simix/ActorImpl.hpp index 0b4c9e6d46..28409f3180 100644 --- a/src/simix/ActorImpl.hpp +++ b/src/simix/ActorImpl.hpp @@ -76,7 +76,6 @@ public: std::function 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: diff --git a/src/smpi/internals/smpi_process.cpp b/src/smpi/internals/smpi_process.cpp index 1001023d98..ebd9468e31 100644 --- a/src/smpi/internals/smpi_process.cpp +++ b/src/smpi/internals/smpi_process.cpp @@ -292,7 +292,6 @@ void Process::init(int *argc, char ***argv){ 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); -- 2.20.1