Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[SMPI] Use variable instead of 3 calls to the same function
authorChristian Heinrich <franz-christian.heinrich@inria.fr>
Thu, 7 Dec 2017 09:24:37 +0000 (10:24 +0100)
committerChristian Heinrich <franz-christian.heinrich@inria.fr>
Fri, 12 Jan 2018 00:08:32 +0000 (01:08 +0100)
src/smpi/internals/smpi_process.cpp

index f47b42d..d341b28 100644 (file)
@@ -73,7 +73,8 @@ void Process::set_data(int index, int* argc, char*** argv)
     instance_id_ = instance_id;
     index_       = index;
 
-    static_cast<simgrid::msg::ActorExt*>(SIMIX_process_self()->userdata)->data = this;
+    process_                                                       = SIMIX_process_self();
+    static_cast<simgrid::msg::ActorExt*>(process_->userdata)->data = this;
 
     if (*argc > 3) {
       memmove(&(*argv)[0], &(*argv)[2], sizeof(char *) * (*argc - 2));
@@ -85,8 +86,7 @@ void Process::set_data(int index, int* argc, char*** argv)
     argv_ = argv;
     // set the process attached to the mailbox
     mailbox_small_->setReceiver(simgrid::s4u::Actor::self());
-    process_ = SIMIX_process_self();
-    XBT_DEBUG("<%d> New process in the game: %p", index_, SIMIX_process_self());
+    XBT_DEBUG("<%d> New process in the game: %p", index_, process_);
 }
 
 /** @brief Prepares the current process for termination. */