Skip to content

Commit

Permalink
#1009 add serialize method for theLBManager component
Browse files Browse the repository at this point in the history
problematic types (see members not serialized):
- LBType (ambiguous call)
- LoadModel (pure abstract interface)
  • Loading branch information
cz4rs committed Sep 11, 2020
1 parent 1d5dddc commit e80cfe9
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/vt/objgroup/proxy/proxy_objgroup.h
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,11 @@ struct Proxy {
*/
ProxyElm<ObjT> operator()(NodeType node) const;

template <typename Serializer>
void serialize(Serializer& s) {
s | proxy_;
}

private:
ObjGroupProxyType proxy_ = no_obj_group; /**< The raw proxy ID bits */
};
Expand Down
16 changes: 16 additions & 0 deletions src/vt/vrt/collection/balance/lb_invoke/lb_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,22 @@ struct LBManager : runtime::component::Component<LBManager> {
*/
std::shared_ptr<LoadModel> getLoadModel() { return model_; }

template <typename Serializer>
void serialize(Serializer& s) {
s | num_invocations_
| num_release_
| cached_phase_
// ambiguous: hasNoninSerialize, isEnum
//| cached_lb_
| destroy_lb_
| synced_in_lb_
| listeners_
| proxy_;
// LoadModel is pure abstract interface
// | base_model_
// | model_;
}

protected:
/**
* \internal \brief Collectively construct a new load balancer
Expand Down
9 changes: 9 additions & 0 deletions tests/unit/runtime/test_memory_footprint.nompi.cc
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
#include <checkpoint/checkpoint.h>
#include "vt/configs/arguments/args.h"
#include "vt/timetrigger/time_trigger_manager.h"
#include "vt/vrt/collection/balance/lb_invoke/lb_manager.h"

#include "test_harness.h"

Expand All @@ -71,4 +72,12 @@ TEST_F(TestMemoryFootprinting, test_time_trigger_manager) {
fmt::print("getMemoryFootprint: {}\n", size);
}

TEST_F(TestMemoryFootprinting, test_lb_manager) {
vt::vrt::collection::balance::LBManager lb_manager;
fmt::print("sizeof instance: {}\n", sizeof(lb_manager));

auto size = checkpoint::getMemoryFootprint<vt::vrt::collection::balance::LBManager>(lb_manager);
fmt::print("getMemoryFootprint: {}\n", size);
}

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

0 comments on commit e80cfe9

Please sign in to comment.