Skip to content

Commit

Permalink
#501: factor rank memory into memory constraint
Browse files Browse the repository at this point in the history
  • Loading branch information
cwschilly committed Feb 27, 2024
1 parent 0a2238c commit 8c4ee14
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion config/work-stealing.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ algorithm:
discretion_interval: 0.010
steal_time: 0.2
num_experiments: 10
max_memory_usage: 5.0e+9
max_memory_usage: 8.0e+9

# Specify output
output_dir: ../output
Expand Down
8 changes: 4 additions & 4 deletions src/lbaf/Execution/lbsWorkStealingAlgorithm.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,21 +48,21 @@ def __init__(self, env, rank_id, algorithm, lgr: Logger):
self.running = True

# Initialize memory
self.rank_memory = 0.
self.rank_memory = self.rank.get_size()

# Initialize current cluster (if a rank is currently working through a cluster)
self.current_cluster = None
self.new_clusters = False

# Output initial information
self.__logger.info(f" Rank {self.rank_id} Initial Info: work={self.__get_total_work()}, n_tasks={self.rank.get_number_of_objects()}, n_clusters={self.rank.get_number_of_shared_blocks()}")
self.__logger.info(f" Rank {self.rank_id} Initial Info: work={self.__get_total_work()}, memory={self.rank_memory}, n_tasks={self.rank.get_number_of_objects()}, n_clusters={self.rank.get_number_of_shared_blocks()}")

def run(self):
"""Defines the process that will run within the simpy environment."""
# Continue if the rank has clusters left. If stealing is on, also continue if any other ranks have stealable clusters.
# Continue if the rank has work and memory left
while self.__continue_condition():

# Check if rank is currently executing a cluster
# Check if rank has a cluster lined up
if self.current_cluster is not None:

# Execute all tasks on the cluster
Expand Down

0 comments on commit 8c4ee14

Please sign in to comment.