Skip to content

Commit

Permalink
#1009: memory footprinting: show components' footprint on startup and…
Browse files Browse the repository at this point in the history
… shutdown
  • Loading branch information
cz4rs committed Nov 21, 2020
1 parent 2141c8f commit ac089a7
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
17 changes: 15 additions & 2 deletions src/vt/runtime/runtime.cc
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,8 @@ bool Runtime::finalize(bool const force_now, bool const disable_sig) {
}
# endif

printMemoryFootprint();

auto const& num_units = theTerm->getNumUnits();
auto const coll_epochs = theTerm->getNumTerminatedCollectiveEpochs();
MPI_Barrier(comm);
Expand Down Expand Up @@ -1007,14 +1009,25 @@ template<typename T>
void printComponentFootprint(T* component) {
if (component != nullptr) {
fmt::print(
"Memory footprint for component {}:\t{}\n",
"{}{}\tMemory footprint for {}:\t{}{}{}\n",
debug::vtPre(),
debug::reset(),
component->name(),
checkpoint::getMemoryFootprint(*component)
debug::magenta(),
checkpoint::getMemoryFootprint(*component),
debug::reset()
);
}
}

void Runtime::printMemoryFootprint() const {
fmt::print(
"{}{}Printing memory footprint for live components:{}\n",
debug::vtPre(),
debug::green(),
debug::reset()
);

p_->foreach([&](component::BaseComponent* base) {
auto name = base->name();
if (name == "ArgConfig")
Expand Down
2 changes: 2 additions & 0 deletions src/vt/runtime/runtime_banner.cc
Original file line number Diff line number Diff line change
Expand Up @@ -855,6 +855,8 @@ void Runtime::printStartupBanner() {
}
}

printMemoryFootprint();

//fmt::print("{}\n", reset);
fmt::print(reset);

Expand Down

0 comments on commit ac089a7

Please sign in to comment.