Skip to content

Commit

Permalink
#279: modified API to report stats of object loads (and use it)
Browse files Browse the repository at this point in the history
  • Loading branch information
ppebay committed Oct 31, 2022
1 parent 7b83126 commit 0633a44
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/lbaf/Model/lbsObject.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def __init__(
raise TypeError(
f"size: incorrect type {type(size)} or value: {size}")
else:
self.__load = load
self.__size = size

# Rank to which object is currently assigned if defined
if bool(isinstance(r_id, int) or r_id is None) and not isinstance(r_id, bool):
Expand Down Expand Up @@ -83,6 +83,11 @@ def get_load(self) -> float:
"""
return self.__load

def get_size(self) -> float:
""" Return object size
"""
return self.__size

def get_sent(self) -> dict:
""" Return communications sent by object to other objects
"""
Expand Down
1 change: 1 addition & 0 deletions src/lbaf/Model/lbsPhase.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ def populate_from_log(self, t_s, basename):
for p in self.__ranks:
objects = objects.union(p.get_objects())
print_function_statistics(objects, lambda x: x.get_load(), "object loads", self.__logger)
print_function_statistics(objects, lambda x: x.get_size(), "object sizes", self.__logger)

# Set number of read objects
self.__n_objects = len(objects)
Expand Down

0 comments on commit 0633a44

Please sign in to comment.