Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[simix] Fix SMPI+MSG
authorGabriel Corona <gabriel.corona@loria.fr>
Mon, 7 Dec 2015 14:58:27 +0000 (15:58 +0100)
committerGabriel Corona <gabriel.corona@loria.fr>
Mon, 7 Dec 2015 15:12:22 +0000 (16:12 +0100)
include/simgrid/simix.hpp
src/simix/Context.cpp
src/simix/smx_private.h
src/smpi/smpi_global.c

index 8888fb8..99f476f 100644 (file)
@@ -71,6 +71,10 @@ public:
   {
     return this->process_;
   }
+  void set_cleanup(void_pfn_smxprocess_t cleanup)
+  {
+    cleanup_func_ = cleanup;
+  }
 
   // Virtual methods
   virtual ~Context();
index 4f65be7..fbfffc9 100644 (file)
 
 #include <src/simix/smx_private.h>
 
+void SIMIX_process_set_cleanup_function(
+  smx_process_t process, void_pfn_smxprocess_t cleanup)
+{
+  process->context->set_cleanup(cleanup);
+}
+
 namespace simgrid {
 namespace simix {
 
index 4ce0289..f161b9a 100644 (file)
@@ -242,6 +242,10 @@ XBT_PUBLIC(int) SIMIX_process_get_maxpid(void);
 
 XBT_PRIVATE void SIMIX_post_create_environment(void);
 
+// FIXME, Dirty hack for SMPI+MSG
+XBT_PRIVATE void SIMIX_process_set_cleanup_function(
+  smx_process_t process, void_pfn_smxprocess_t cleanup);
+
 SG_END_DECL()
 
 #endif
index 23b1826..4001323 100644 (file)
@@ -79,7 +79,7 @@ void smpi_process_init(int *argc, char ***argv)
   if (argc && argv) {
     proc = SIMIX_process_self();
     //FIXME: dirty cleanup method to avoid using msg cleanup functions on these processes when using MSG+SMPI
-    // proc->context->cleanup_func=SIMIX_process_cleanup;
+    SIMIX_process_set_cleanup_function(proc, SIMIX_process_cleanup);
     char* instance_id = (*argv)[1];
     int rank = atoi((*argv)[2]);
     index = smpi_process_index_of_smx_process(proc);