Skip to content

Commit

Permalink
#558: memory: add option to disable sub-clustering
Browse files Browse the repository at this point in the history
  • Loading branch information
lifflander committed Oct 22, 2024
1 parent c824fa3 commit 597d260
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/lbaf/Execution/lbsClusteringTransferStrategy.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ def __init__(self, criterion, parameters: dict, lgr: Logger):

# Determine whether subclustering is performed immediately after swapping
self.__separate_subclustering = parameters.get("separate_subclustering", False)
self.__disable_subclustering = parameters.get("subclustering_disabled", False)
self._logger.info(
f"Enter subclustering immediately after cluster swapping: {self.__separate_subclustering}")

Expand Down Expand Up @@ -279,15 +280,16 @@ def execute(self, known_peers, phase: Phase, ave_load: float, max_load: float):
self.__n_sub_skipped += 1
continue

# Perform feasible subcluster swaps from given rank to possible targets
self.__transfer_subclusters(phase, r_src, targets, ave_load, max_load)
if not self.__disable_subclustering:
# Perform feasible subcluster swaps from given rank to possible targets
self.__transfer_subclusters(phase, r_src, targets, ave_load, max_load)

# Report on new load and exit from rank
self._logger.debug(
f"Rank {r_src.get_id()} load: {r_src.get_load()} after {self._n_transfers} object transfers")

# Perform subclustering when it was not previously done
if self.__separate_subclustering:
if self.__separate_subclustering and not self.__disable_subclustering:
# In non-deterministic case skip subclustering when swaps passed
if self.__n_swaps and not self._deterministic_transfer:
self.__n_sub_skipped += len(rank_targets)
Expand Down
1 change: 1 addition & 0 deletions src/lbaf/IO/lbsConfigurationValidator.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ def __init__(self, config_to_validate: dict, logger: Logger):
str,
lambda e: e in ALLOWED_TRANSFER_STRATEGIES,
error=f"{get_error_message(ALLOWED_TRANSFER_STRATEGIES)} must be chosen"),
Optional("subclustering_disabled"): bool,
Optional("subclustering_threshold"): And(
float,
lambda x: x >= 0.0,
Expand Down

0 comments on commit 597d260

Please sign in to comment.