Skip to content

Commit

Permalink
#1009 add serialize method for theNodeStats component
Browse files Browse the repository at this point in the history
  • Loading branch information
cz4rs committed Sep 11, 2020
1 parent 950ce1e commit b3f87dd
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/vt/vrt/collection/balance/node_stats.h
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,22 @@ struct NodeStats : runtime::component::Component<NodeStats> {
*/
VirtualProxyType getCollectionProxyForElement(ElementIDType temp_id) const;


template <typename Serializer>
void serialize(Serializer& s) {
s | proxy_
| node_data_
| node_subphase_data_
| node_migrate_
| node_temp_to_perm_
| node_perm_to_temp_
| node_collection_lookup_
| node_comm_
| next_elm_
| stats_file_
| created_dir_;
}

private:
/**
* \internal \brief Create the stats file
Expand Down
6 changes: 6 additions & 0 deletions tests/unit/runtime/test_memory_footprint.nompi.cc
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
#include "vt/timetrigger/time_trigger_manager.h"
#include "vt/vrt/collection/balance/lb_invoke/lb_manager.h"
#include "vt/vrt/collection/balance/stats_restart_reader.h"
#include "vt/vrt/collection/balance/node_stats.h"

#include "test_harness.h"

Expand Down Expand Up @@ -84,4 +85,9 @@ TEST_F(TestMemoryFootprinting, test_stats_restart_reader) {
printMemoryFootprint(reader);
}

TEST_F(TestMemoryFootprinting, test_node_stats) {
vt::vrt::collection::balance::NodeStats stats;
printMemoryFootprint(stats);
}

}}} /* end namespace vt::tests::unit */

0 comments on commit b3f87dd

Please sign in to comment.