From b1867c04911ca6ca2e39b960a9a44b8d20be2e2b Mon Sep 17 00:00:00 2001 From: Christian Heinrich Date: Thu, 7 Dec 2017 10:24:37 +0100 Subject: [PATCH 1/1] [SMPI] Use variable instead of 3 calls to the same function --- src/smpi/internals/smpi_process.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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. */ -- 2.20.1