Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[SMPI] Next step for dynamic privatization
[simgrid.git] / src / smpi / internals / smpi_deployment.cpp
index d470ebd..7a75f15 100644 (file)
@@ -21,16 +21,18 @@ public:
       : name(name)
       , size(max_no_processes)
       , present_processes(0)
-      , index(process_count)
       , comm_world(comm)
       , finalization_barrier(finalization_barrier)
   {
+    int cur_process_count = smpi_process_count();
+    for (int i = 0; i < max_no_processes; i++) {
+      smpi_add_process(cur_process_count + i);
+    }
   }
 
   const char* name;
   int size;
   int present_processes;
-  int index; // Badly named. This should be "no_processes_when_registering" ;)
   MPI_Comm comm_world;
   msg_bar_t finalization_barrier;
 };
@@ -42,7 +44,6 @@ using simgrid::smpi::app::Instance;
 
 static std::map<std::string, Instance> smpi_instances;
 extern int process_count; // How many processes have been allocated over all instances?
-extern int* index_to_process_data;
 
 /** \ingroup smpi_simulation
  * \brief Registers a running instance of a MPI program.
@@ -78,22 +79,17 @@ void SMPI_app_instance_register(const char *name, xbt_main_func_t code, int num_
   smpi_instances.insert(std::pair<std::string, Instance>(name, instance));
 }
 
-//get the index of the process in the process_data array
 void smpi_deployment_register_process(const char* instance_id, int rank, int index)
 {
-  if (smpi_instances.empty()) { // no instance registered, we probably used smpirun.
-    index_to_process_data[index]=index;
+  if (smpi_instances.empty()) // no instance registered, we probably used smpirun.
     return;
-  }
 
   Instance& instance = smpi_instances.at(instance_id);
 
   instance.present_processes++;
-  index_to_process_data[index] = instance.index + rank;
   instance.comm_world->group()->set_mapping(index, rank);
 }
 
-//get the index of the process in the process_data array
 MPI_Comm* smpi_deployment_comm_world(const char* instance_id)
 {
   if (smpi_instances.empty()) { // no instance registered, we probably used smpirun.