From 7a3c869cdc67d995ccd20dc8669a96bd49bb06ae Mon Sep 17 00:00:00 2001 From: Arkadiusz Szczepkowicz Date: Thu, 13 Jun 2024 11:03:59 +0200 Subject: [PATCH] #2074: Support early call to vtAbort when tracing is enabled --- src/vt/collective/collective_ops.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/vt/collective/collective_ops.cc b/src/vt/collective/collective_ops.cc index b69d7d1122..022b457de8 100644 --- a/src/vt/collective/collective_ops.cc +++ b/src/vt/collective/collective_ops.cc @@ -293,8 +293,10 @@ void CollectiveAnyOps::abort( auto myrt = tls_rt ? tls_rt : ::vt::rt; if (myrt) { #if vt_check_enabled(trace_enabled) - //--- Try to flush most of the traces before aborting - myrt->theTrace->cleanupTracesFile(); + if (myrt->theTrace) { + //--- Try to flush most of the traces before aborting + myrt->theTrace->cleanupTracesFile(); + } #endif myrt->abort(str, code); } else if (vt::debug::preConfig()->vt_throw_on_abort) {