Skip to content

Commit

Permalink
Change max concurrent default from 10 to 25 concurrent omicron and po…
Browse files Browse the repository at this point in the history
…st processing jobs. Also implement that the "right" way instead of my hacky paren-child model.

Verify we work with dqsegdb 1.2.1
  • Loading branch information
Joseph Areeda committed Sep 30, 2023
1 parent 2d1cbfa commit ed442fb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 20 deletions.
24 changes: 5 additions & 19 deletions omicron/cli/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ def create_parser():
'condor job (default: %(default)s)',
)
# max concurrent omicron jobs
procg.add_argument('--max-concurrent', default=10, type=int,
procg.add_argument('--max-concurrent', default=25, type=int,
help='Max omicron jobs at one time [%(default)s]')
procg.add_argument(
'-x',
Expand Down Expand Up @@ -476,6 +476,7 @@ def main(args=None):
log_file.parent.mkdir(mode=0o755, exist_ok=True, parents=True)
logger.add_file_handler(log_file)

logger.debug(f'Running {__file__} - {__version__} ')

Check warning on line 479 in omicron/cli/process.py

View check run for this annotation

Codecov / codecov/patch

omicron/cli/process.py#L479

Added line #L479 was not covered by tests
logger.debug("Command line args:")
for arg in vars(args):
logger.debug(f' {arg} = {str(getattr(args, arg))}')

Check warning on line 482 in omicron/cli/process.py

View check run for this annotation

Codecov / codecov/patch

omicron/cli/process.py#L482

Added line #L482 was not covered by tests
Expand Down Expand Up @@ -1242,24 +1243,9 @@ def main(args=None):
print('\n'.join(operations), file=f)
if newdag:
script.chmod(0o755)
parent_jobs = list()
child_jobs = list()
maxcon = args.max_concurrent
for j in omicron_nodes:
if len(parent_jobs) < maxcon:
parent_jobs.append(j)
elif len(child_jobs) < maxcon:
child_jobs.append(j)
else:
for pj in parent_jobs:
for cj in child_jobs:
cj.add_parent(pj)
parent_jobs = child_jobs
child_jobs = [j]
if len(child_jobs) > 0 and len(parent_jobs) > 0:
for pj in parent_jobs:
for cj in child_jobs:
cj.add_parent(pj)
maxcon: int = args.max_concurrent
dag.add_maxjobs_category('omicron', maxcon)
dag.add_maxjobs_category('postprocessing', maxcon)

Check warning on line 1248 in omicron/cli/process.py

View check run for this annotation

Codecov / codecov/patch

omicron/cli/process.py#L1246-L1248

Added lines #L1246 - L1248 were not covered by tests

# set 'strict' option for Omicron
# this is done after the nodes are written so that 'strict' is last in
Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[build-system]
requires = [
"setuptools>=42",
"setuptools>=60",
"setuptools_scm[toml]>=3.4",
"wheel",
]
Expand All @@ -11,3 +11,4 @@ write_to = "omicron/_version.py"

[tool.pytest.ini_options]
addopts = "-r a"

0 comments on commit ed442fb

Please sign in to comment.