@@ -57,8 +57,11 @@ using BytesType = double;
5757struct ClusterInfo {
5858 LoadType load = 0 ;
5959 BytesType bytes = 0 ;
60+ SharedIDType shared_id = -1 ;
6061 double intra_send_vol = 0 , intra_recv_vol = 0 ;
61- std::unordered_map<NodeType, double > inter_send_vol, inter_recv_vol;
62+ std::unordered_map<SharedIDType, double > inter_cluster_send_vol,
63+ inter_cluster_recv_vol;
64+ std::unordered_map<elm::ElementIDStruct, double > obj_send_vol, obj_recv_vol;
6265 NodeType home_node = uninitialized_destination;
6366 BytesType edge_weight = 0 ;
6467 BytesType max_object_working_bytes = 0 ;
@@ -67,10 +70,35 @@ struct ClusterInfo {
6770 BytesType max_object_serialized_bytes_outside = 0 ;
6871 BytesType cluster_footprint = 0 ;
6972
73+ void addInterClusterEdge (bool is_send, SharedIDType id, double volume) {
74+ if (is_send) {
75+ inter_cluster_send_vol[id] += volume;
76+ } else {
77+ inter_cluster_recv_vol[id] += volume;
78+ }
79+ }
80+
81+ void addIntraVolume (bool is_send, double volume) {
82+ if (is_send) {
83+ intra_send_vol += volume;
84+ } else {
85+ intra_recv_vol += volume;
86+ }
87+ }
88+
89+ void addObjEdge (bool is_send, elm::ElementIDStruct obj, double volume) {
90+ if (is_send) {
91+ obj_send_vol[obj] += volume;
92+ } else {
93+ obj_recv_vol[obj] += volume;
94+ }
95+ }
96+
7097 template <typename SerializerT>
7198 void serialize (SerializerT& s) {
72- s | load | bytes | intra_send_vol | intra_recv_vol;
73- s | inter_send_vol | inter_recv_vol;
99+ s | load | shared_id | bytes | intra_send_vol | intra_recv_vol;
100+ s | inter_cluster_send_vol | inter_cluster_recv_vol;
101+ s | obj_send_vol | obj_recv_vol;
74102 s | home_node | edge_weight;
75103 s | max_object_working_bytes;
76104 s | max_object_working_bytes_outside;
@@ -86,13 +114,17 @@ struct NodeInfo {
86114 double inter_send_vol = 0 , inter_recv_vol = 0 ;
87115 double intra_send_vol = 0 , intra_recv_vol = 0 ;
88116 double shared_vol = 0 ;
117+ std::set<SharedIDType> shared_ids;
118+ std::set<elm::ElementIDStruct> non_cluster_objs;
89119
90120 template <typename SerializerT>
91121 void serialize (SerializerT& s) {
92122 s | load | work;
93123 s | inter_send_vol | inter_recv_vol;
94124 s | intra_send_vol | intra_recv_vol;
95125 s | shared_vol;
126+ s | shared_ids;
127+ s | non_cluster_objs;
96128 }
97129};
98130
0 commit comments