From 6f71d5a09ede8e6293a4e9154f90c570a273d491 Mon Sep 17 00:00:00 2001 From: Kevin Huck Date: Sun, 17 Nov 2019 20:56:49 -0800 Subject: [PATCH] Fixing boneheaded implementation of aliasing --- src/apex/apex.cpp | 2 +- src/apex/task_wrapper.hpp | 18 ++++++------------ 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/src/apex/apex.cpp b/src/apex/apex.cpp index 73906889..5839f0b0 100644 --- a/src/apex/apex.cpp +++ b/src/apex/apex.cpp @@ -1115,7 +1115,7 @@ std::shared_ptr update_task( APEX_ASSERT(wrapper != nullptr); task_identifier * id = task_identifier::get_task_id(timer_name); if (id != wrapper->get_task_id()) { - wrapper->aliases.insert(id); + wrapper->alias = id; /* printf("New alias: %s to %s\n", wrapper->task_id->get_name().c_str(), timer_name.c_str()); */ } diff --git a/src/apex/task_wrapper.hpp b/src/apex/task_wrapper.hpp index 70e64c50..24609f36 100644 --- a/src/apex/task_wrapper.hpp +++ b/src/apex/task_wrapper.hpp @@ -56,11 +56,11 @@ struct task_wrapper { */ std::vector data_ptr; /** - \brief An unordered set of other names for this task. If the task changes names + \brief If the task changes names after creation (due to the application of an annotation) then the alias becomes the new task_identifier for the task. */ - std::unordered_set aliases; + task_identifier* alias; /** \brief Constructor. */ @@ -69,22 +69,16 @@ struct task_wrapper { prof(nullptr), guid(0ull), parent_guid(0ull), - parent(nullptr) + parent(nullptr), + alias(nullptr) { } /** \brief Get the task_identifier for this task_wrapper. \returns A pointer to the task_identifier */ inline task_identifier * get_task_id(void) { - if (!aliases.empty()) { - task_identifier * id = nullptr; - // find the first alias that isn't the same as the original name - for (auto tmp : aliases) { - if (tmp != id) { - id = tmp; - return id; - } - } + if (alias != nullptr) { + return alias; } return task_id; }