From 1509477d13523a4a4dfd9be4a2411acadb26e294 Mon Sep 17 00:00:00 2001 From: Kevin Huck Date: Mon, 17 Jun 2024 15:46:47 -0700 Subject: [PATCH] Fixing multi-parent OTF2 bug --- src/apex/otf2_listener.cpp | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/src/apex/otf2_listener.cpp b/src/apex/otf2_listener.cpp index 5a5874ce..fa403a7e 100644 --- a/src/apex/otf2_listener.cpp +++ b/src/apex/otf2_listener.cpp @@ -1228,11 +1228,9 @@ namespace apex { OTF2_AttributeList * al = OTF2_AttributeList_New(); // create an attribute OTF2_AttributeList_AddUint64( al, 0, tt_ptr->guid ); - std::vector pguids = {}; for (auto& parent : tt_ptr->parents) { - pguids.push_back(parent->guid); + OTF2_AttributeList_AddUint64( al, 1, parent->guid ); } - OTF2_AttributeList_AddUint64( al, pguids.size(), pguids.data() ); uint64_t idx = get_region_index(id); uint64_t stamp = 0L; if (thread_instance::get_id() == 0) { @@ -1287,11 +1285,9 @@ namespace apex { OTF2_AttributeList * al = OTF2_AttributeList_New(); // create an attribute OTF2_AttributeList_AddUint64( al, 0, p->tt_ptr->guid ); - std::vector pguids = {}; - for (auto& parent : tt_ptr->parents) { - pguids.push_back(parent->guid); + for (auto& parent : p->tt_ptr->parents) { + OTF2_AttributeList_AddUint64( al, 1, parent->guid ); } - OTF2_AttributeList_AddUint64( al, pguids.size(), pguids.data() ); // unfortunately, we can't use the timestamp from the // profiler object. bummer. it has to be taken after // the lock is acquired, so that events happen on @@ -2752,11 +2748,9 @@ namespace apex { OTF2_AttributeList * al = OTF2_AttributeList_New(); // create an attribute OTF2_AttributeList_AddUint64( al, 0, p->tt_ptr->guid ); - std::vector pguids = {}; - for (auto& parent : tt_ptr->parents) { - pguids.push_back(parent->guid); + for (auto& parent : p->tt_ptr->parents) { + OTF2_AttributeList_AddUint64( al, 1, parent->guid ); } - OTF2_AttributeList_AddUint64( al, pguids.size(), pguids.data() ); OTF2_EC(OTF2_EvtWriter_Enter( local_evt_writer, al, stamp, idx /* region */ )); stamp = p->get_stop_ns() - globalOffset;