From: Christian Heinrich Date: Thu, 7 Dec 2017 09:24:37 +0000 (+0100) Subject: [SMPI] Use variable instead of 3 calls to the same function X-Git-Tag: v3.19~356 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/b1867c04911ca6ca2e39b960a9a44b8d20be2e2b?ds=sidebyside [SMPI] Use variable instead of 3 calls to the same function --- diff --git a/src/smpi/internals/smpi_process.cpp b/src/smpi/internals/smpi_process.cpp index f47b42d35c..d341b28f72 100644 --- a/src/smpi/internals/smpi_process.cpp +++ b/src/smpi/internals/smpi_process.cpp @@ -73,7 +73,8 @@ void Process::set_data(int index, int* argc, char*** argv) instance_id_ = instance_id; index_ = index; - static_cast(SIMIX_process_self()->userdata)->data = this; + process_ = SIMIX_process_self(); + static_cast(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. */