From: Martin Quinson Date: Sat, 14 Jul 2018 17:39:39 +0000 (+0200) Subject: SMPI does not need to have its own userdata pointer anymore X-Git-Tag: v3_21~437 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/b9b0ba08f86e11674ff24a6b7389e7dec2984af3?ds=sidebyside SMPI does not need to have its own userdata pointer anymore 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. --- diff --git a/src/smpi/include/smpi_actor.hpp b/src/smpi/include/smpi_actor.hpp index 73e9e6ea1b..e5ca136237 100644 --- a/src/smpi/include/smpi_actor.hpp +++ b/src/smpi/include/smpi_actor.hpp @@ -26,7 +26,6 @@ private: 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_; @@ -51,8 +50,6 @@ public: 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(); diff --git a/src/smpi/internals/smpi_actor.cpp b/src/smpi/internals/smpi_actor.cpp index 8eb40883a3..b7bf6e6036 100644 --- a/src/smpi/internals/smpi_actor.cpp +++ b/src/smpi/internals/smpi_actor.cpp @@ -127,16 +127,6 @@ bool ActorExt::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_; diff --git a/src/smpi/internals/smpi_global.cpp b/src/smpi/internals/smpi_global.cpp index e8e29abd47..c28af0c90c 100644 --- a/src/smpi/internals/smpi_global.cpp +++ b/src/smpi/internals/smpi_global.cpp @@ -124,11 +124,11 @@ int smpi_process_index(){ } 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){ - return smpi_process()->set_user_data(data); + Actor::self()->get_impl()->set_user_data(data); }