Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add a smpi/grow-injected-times option.
[simgrid.git] / src / smpi / smpi_comm.cpp
index 6d3f9a9..99625ce 100644 (file)
@@ -5,14 +5,18 @@
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include <stdlib.h>
+#include <limits.h>
+
+#include <xbt/dict.h>
+#include <xbt/ex.h>
+#include <xbt/ex.hpp>
+
+#include <simgrid/s4u/host.hpp>
 
 #include "private.h"
-#include "xbt/dict.h"
 #include "smpi_mpi_dt_private.h"
-#include "limits.h"
 #include "src/simix/smx_private.h"
 #include "colls/colls.h"
-#include "xbt/ex.h"
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_comm, smpi, "Logging specific to SMPI (comm)");
 
@@ -107,6 +111,7 @@ int smpi_comm_dup(MPI_Comm comm, MPI_Comm* newcomm){
           if(ret!=MPI_SUCCESS){
             smpi_comm_destroy(*newcomm);
             *newcomm=MPI_COMM_NULL;
+            xbt_dict_cursor_free(&cursor);
             return ret;
           }
           if(flag)
@@ -369,9 +374,9 @@ void smpi_comm_init_smp(MPI_Comm comm){
   int intra_comm_size = 0;
   int i =0;
   int min_index=INT_MAX;//the minimum index will be the leader
-  smx_process_t process = nullptr;
+  smx_actor_t process = nullptr;
   xbt_swag_foreach(process, process_list) {
-    int index = SIMIX_process_get_PID(process) -1;
+    int index = process->pid -1;
 
     if(smpi_group_rank(smpi_comm_group(comm),  index)!=MPI_UNDEFINED){
         intra_comm_size++;
@@ -386,7 +391,7 @@ void smpi_comm_init_smp(MPI_Comm comm){
   i=0;
   process = nullptr;
   xbt_swag_foreach(process, process_list) {
-    int index = SIMIX_process_get_PID(process) -1;
+    int index = process->pid -1;
     if(smpi_group_rank(smpi_comm_group(comm),  index)!=MPI_UNDEFINED){
       smpi_group_set_mapping(group_intra, index, i);
       i++;