Skip to content

Commit

Permalink
Fixed default jobs_limit
Browse files Browse the repository at this point in the history
  • Loading branch information
pagrubel committed Feb 12, 2025
1 parent 1d73fc9 commit 49743c3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion beeflow/common/config_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ def filepath_completion_input(*pargs, **kwargs):
# Task manager
VALIDATOR.section('task_manager',
info='Task manager configuration and config of container to use.')
VALIDATOR.option('task_manager', 'jobs_limit', default=2, prompt=True,
VALIDATOR.option('task_manager', 'jobs_limit', default='', prompt=True,
info='The number of jobs that can be in the job queue.')
VALIDATOR.option('task_manager', 'container_runtime', default='Charliecloud',
choices=('Charliecloud', 'Singularity'), prompt=False,
Expand Down
13 changes: 11 additions & 2 deletions beeflow/task_manager/background.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,18 @@
from beeflow.common.build_interfaces import build_main
from beeflow.common.worker import WorkerError


JOBS_MAX = 1000
log = bee_logging.setup(__name__)
jobs_limit = int(bc.get('task_manager', 'jobs_limit'))
jobs_limit = bc.get('task_manager', 'jobs_limit')
if not jobs_limit:
jobs_limit = JOBS_MAX
else:
try:
jobs_limit = int(bc.get('task_manager', 'jobs_limit'))
except ValueError:
log.info(f'Value for jobs_limit in bee.conf not an integer, setting it to {JOBS_MAX}')
jobs_limit = JOBS_MAX
log.info(f'The number of jobs queued will be limited to {jobs_limit}.')

# States are based on https://slurm.schedmd.com/squeue.html#SECTION_JOB-STATE-CODES
COMPLETED_STATES = {'UNKNOWN', 'COMPLETED', 'CANCELLED', 'FAILED', 'TIMEOUT', 'TIMELIMIT'}
Expand Down

0 comments on commit 49743c3

Please sign in to comment.