Updated check if nodes per job is applicable
@@ -859,9 +859,14 @@ def main(args=None):
# Setup the providers
# Determine the maximum number of blocks
- if settings.common.max_workers % settings.common.nodes_per_job != 0:
- raise ValueError(f"Maximum number of workers needs to be a multiple of the number of nodes per job.")
- max_blocks = settings.common.max_workers // settings.common.nodes_per_job
+ # TODO (wardlt): Assumes that user does not set aside a compute node for the adapter
+ max_nodes = settings.common.max_workers * settings.common.nodes_per_task
+ if max_nodes % settings.common.nodes_per_job != 0:
+ raise ValueError("Maximum number of nodes (maximum number of workers times nodes per task) "
+ "needs to be a multiple of the number of nodes per job")
+ if settings.common.nodes_per_job % settings.common.nodes_per_task != 0:
+ raise ValueError("Number of nodes per job needs to be a multiple of the number of nodes per task")
+ max_blocks = max_nodes // settings.common.nodes_per_job
# Create one construct to quickly merge dicts with a final check
common_parsl_provider_construct = {
