Skip to content

Commit

Permalink
Merge branch 'tickets/DM-31944'
Browse files Browse the repository at this point in the history
  • Loading branch information
MichelleGower committed Sep 29, 2021
2 parents 679a4d4 + 188ff0d commit aaf56d1
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 7 deletions.
1 change: 1 addition & 0 deletions doc/changes/DM-31944.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix single concurrency limit splitting.
1 change: 1 addition & 0 deletions doc/changes/DM-31944.misc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Persist bps DAG attributes across manual restarts.
4 changes: 2 additions & 2 deletions python/lsst/ctrl/bps/generic_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ class GenericWorkflowJob:
throttling jobs within a single workflow).
"""

concurrency_limit: Optional[list]
concurrency_limit: Optional[str]
"""Names of concurrency limits that the WMS plugin can appropriately
translate to limit the number of this job across all running workflows.
"""
Expand Down Expand Up @@ -268,7 +268,7 @@ def __init__(self, name: str):
self.abort_return_value = None
self.priority = None
self.category = None
self.concurrency_limit = []
self.concurrency_limit = None
self.queue = None
self.pre_cmdline = None
self.post_cmdline = None
Expand Down
2 changes: 1 addition & 1 deletion python/lsst/ctrl/bps/wms/htcondor/htcondor_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@ def _translate_job_cmds(config, generic_workflow, gwjob):
# May need to move to special site-specific implementation if sites use
# other mechanisms.
if gwjob.concurrency_limit:
jobcmds["concurrency_limit"] = ",".join(gwjob.concurrency_limit)
jobcmds["concurrency_limit"] = gwjob.concurrency_limit

# Handle command line
if gwjob.executable.transfer_executable:
Expand Down
9 changes: 5 additions & 4 deletions python/lsst/ctrl/bps/wms/htcondor/lssthtc.py
Original file line number Diff line number Diff line change
Expand Up @@ -359,10 +359,6 @@ def htc_submit_dag(htc_dag, submit_options=None):
else:
sub = _htc_submit_dag_old(htc_dag.graph["dag_filename"], submit_options)

# add attributes to dag submission
for key, value in htc_dag.graph["attr"].items():
sub[f"+{key}"] = f'"{htc_escape(value)}"'

# submit DAG to HTCondor's schedd
schedd = htcondor.Schedd()
with schedd.transaction() as txn:
Expand Down Expand Up @@ -684,6 +680,11 @@ def write(self, submit_path, job_subdir=""):
print(f"PARENT {edge[0]} CHILD {edge[1]}", file=fh)
print(f"DOT {self.name}.dot", file=fh)
print(f"NODE_STATUS_FILE {self.name}.node_status", file=fh)

# Add bps attributes to dag submission
for key, value in self.graph["attr"].items():
print(f'SET_JOB_ATTR {key}= "{htc_escape(value)}"', file=fh)

if self.graph["final_job"]:
job = self.graph["final_job"]
job.write_submit_file(submit_path, job_subdir)
Expand Down

0 comments on commit aaf56d1

Please sign in to comment.