Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
SMPI does not need to have its own userdata pointer anymore
authorMartin Quinson <martin.quinson@loria.fr>
Sat, 14 Jul 2018 17:39:39 +0000 (19:39 +0200)
committerMartin Quinson <martin.quinson@loria.fr>
Sat, 14 Jul 2018 17:39:43 +0000 (19:39 +0200)
Before, the field of actors were used to store the SMPI data directly,
but now it's free.

With a bit of luck, this change will help StarPU
which fails since a few days, possibly because it tries to get the
userdata from an actor using smpi_process_get_userdata while that
actor is not from SMPI (I'm not sure, that's just a wild guess).

If my guess is right, retriving the userdata from the s4u::Actor will
certainly help. If it's wrong, the change shouldn't harm anything and
it will improve by a tiny bit our memory footprint.

src/smpi/include/smpi_actor.hpp
src/smpi/internals/smpi_actor.cpp
src/smpi/internals/smpi_global.cpp

index 73e9e6e..e5ca136 100644 (file)
@@ -26,7 +26,6 @@ private:
   MPI_Comm comm_self_   = MPI_COMM_NULL;
   MPI_Comm comm_intra_  = MPI_COMM_NULL;
   MPI_Comm* comm_world_ = nullptr;
   MPI_Comm comm_self_   = MPI_COMM_NULL;
   MPI_Comm comm_intra_  = MPI_COMM_NULL;
   MPI_Comm* comm_world_ = nullptr;
-  void* data_           = nullptr; /* user data */
   SmpiProcessState state_;
   int sampling_ = 0; /* inside an SMPI_SAMPLE_ block? */
   std::string instance_id_;
   SmpiProcessState state_;
   int sampling_ = 0; /* inside an SMPI_SAMPLE_ block? */
   std::string instance_id_;
@@ -51,8 +50,6 @@ public:
   void mark_as_initialized();
   void set_replaying(bool value);
   bool replaying();
   void mark_as_initialized();
   void set_replaying(bool value);
   bool replaying();
-  void set_user_data(void* data);
-  void* get_user_data();
   smpi_trace_call_location_t* call_location();
   void set_privatized_region(smpi_privatization_region_t region);
   smpi_privatization_region_t privatized_region();
   smpi_trace_call_location_t* call_location();
   void set_privatized_region(smpi_privatization_region_t region);
   smpi_privatization_region_t privatized_region();
index 8eb4088..b7bf6e6 100644 (file)
@@ -127,16 +127,6 @@ bool ActorExt::replaying()
   return replaying_;
 }
 
   return replaying_;
 }
 
-void ActorExt::set_user_data(void* data)
-{
-  data_ = data;
-}
-
-void* ActorExt::get_user_data()
-{
-  return data_;
-}
-
 ActorPtr ActorExt::get_actor()
 {
   return actor_;
 ActorPtr ActorExt::get_actor()
 {
   return actor_;
index e8e29ab..c28af0c 100644 (file)
@@ -124,11 +124,11 @@ int smpi_process_index(){
 }
 
 void * smpi_process_get_user_data(){
 }
 
 void * smpi_process_get_user_data(){
-  return smpi_process()->get_user_data();
+  return Actor::self()->get_impl()->get_user_data();
 }
 
 void smpi_process_set_user_data(void *data){
 }
 
 void smpi_process_set_user_data(void *data){
-  return smpi_process()->set_user_data(data);
+  Actor::self()->get_impl()->set_user_data(data);
 }
 
 
 }