From 57aa3486864bcda85b123dc546e51f5bd0fb02e9 Mon Sep 17 00:00:00 2001 From: Jonathan Lifflander Date: Mon, 11 Jan 2021 18:06:53 -0800 Subject: [PATCH] #1052: epoch: make changes to support memory footprinting --- src/vt/epoch/epoch_manip.h | 7 +++++++ src/vt/epoch/epoch_window.h | 5 ++++- src/vt/runtime/runtime.cc | 4 ++++ src/vt/termination/termination.h | 2 -- tests/unit/runtime/test_memory_footprint.cc | 4 ++++ 5 files changed, 19 insertions(+), 3 deletions(-) diff --git a/src/vt/epoch/epoch_manip.h b/src/vt/epoch/epoch_manip.h index d0324a394e..eb9b485483 100644 --- a/src/vt/epoch/epoch_manip.h +++ b/src/vt/epoch/epoch_manip.h @@ -300,6 +300,13 @@ struct EpochManip : runtime::component::Component { */ EpochType getArchetype(EpochType epoch) const; + template + void serialize(SerializerT& s) { + s | live_scopes_ + | terminated_epochs_ + | terminated_collective_epochs_; + } + private: /** * \internal \brief Destroy an eopch scope by removing it diff --git a/src/vt/epoch/epoch_window.h b/src/vt/epoch/epoch_window.h index 8a39b694ed..1a53e37750 100644 --- a/src/vt/epoch/epoch_window.h +++ b/src/vt/epoch/epoch_window.h @@ -134,7 +134,9 @@ struct EpochWindow { template void serialize(Serializer& s) { s | archetype_epoch_ - | terminated_epochs_; + | terminated_epochs_ + | next_epoch_ + | total_terminated_; } /** @@ -147,6 +149,7 @@ struct EpochWindow { private: /// The archetypical epoch for this window container (category,rooted,user,..) EpochType archetype_epoch_ = no_epoch; + /// The set of epochs terminated vt::IntegralSet terminated_epochs_; diff --git a/src/vt/runtime/runtime.cc b/src/vt/runtime/runtime.cc index 2d5d3ad272..42ae671496 100644 --- a/src/vt/runtime/runtime.cc +++ b/src/vt/runtime/runtime.cc @@ -1157,6 +1157,10 @@ void Runtime::printMemoryFootprint() const { printComponentFootprint( static_cast(base) ); + } else if (name == "EpochManip") { + printComponentFootprint( + static_cast(base) + ); #if vt_check_enabled(trace_enabled) } else if (name == "Trace") { printComponentFootprint( diff --git a/src/vt/termination/termination.h b/src/vt/termination/termination.h index dd3667eebd..a71d235b8e 100644 --- a/src/vt/termination/termination.h +++ b/src/vt/termination/termination.h @@ -642,8 +642,6 @@ struct TerminationDetector : s | any_epoch_state_ | hang_ | epoch_state_ - | epoch_arch_ - | epoch_coll_ | epoch_ready_ | epoch_wait_status_ | has_printed_epoch_graph; diff --git a/tests/unit/runtime/test_memory_footprint.cc b/tests/unit/runtime/test_memory_footprint.cc index f5b31a555c..6beb2f5634 100644 --- a/tests/unit/runtime/test_memory_footprint.cc +++ b/tests/unit/runtime/test_memory_footprint.cc @@ -210,6 +210,10 @@ TEST_F(TestMemoryFootprinting, test_stats_reader) { printMemoryFootprint(theStatsReader()); } +TEST_F(TestMemoryFootprinting, test_epoch) { + printMemoryFootprint(theEpoch()); +} + #if vt_check_enabled(trace_enabled) TEST_F(TestMemoryFootprinting, test_trace) { printMemoryFootprint(theTrace());