Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[SIMIX] Remove SMPI-specific segment_index notion from the Actor class
authorChristian Heinrich <franz-christian.heinrich@inria.fr>
Wed, 17 Jan 2018 20:16:05 +0000 (21:16 +0100)
committerChristian Heinrich <franz-christian.heinrich@inria.fr>
Wed, 24 Jan 2018 14:58:20 +0000 (15:58 +0100)
Privatization is now done via the process id and attached to the SMPI process.

src/simix/ActorImpl.cpp
src/simix/ActorImpl.hpp
src/smpi/internals/smpi_process.cpp

index 94dfdaf..63bef05 100644 (file)
@@ -325,16 +325,6 @@ smx_actor_t SIMIX_process_create(const char* name, std::function<void()> 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);
   }
 }
 
index 0b4c9e6..28409f3 100644 (file)
@@ -76,7 +76,6 @@ public:
 
   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:
index 1001023..ebd9468 100644 (file)
@@ -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);