Skip to content

Commit

Permalink
Fix passing through --var options to cluster job
Browse files Browse the repository at this point in the history
  • Loading branch information
takluyver committed Aug 22, 2024
1 parent a8359b7 commit 555e626
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions damnit/backend/extract_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,14 +232,18 @@ def extract_and_ingest(self, proposal, run, cluster=False,
log.info("Sent Kafka updates to topic %r", self.db.kafka_topic)

# Launch a Slurm job if there are any 'cluster' variables to evaluate
ctx = self.ctx_whole.filter(run_data=run_data, name_matches=match, cluster=cluster)
ctx_slurm = self.ctx_whole.filter(run_data=run_data, name_matches=match, cluster=True)
if set(ctx_slurm.vars) > set(ctx.vars):
submitter = ExtractionSubmitter(Path.cwd(), self.db)
cluster_req = ExtractionRequest(
run, proposal, run_data, cluster=True, match=match, mock=mock
if not cluster:
ctx_slurm = self.ctx_whole.filter(
run_data=run_data, name_matches=match, variables=variables, cluster=True
)
submitter.submit(cluster_req)
ctx_no_slurm = ctx_slurm.filter(cluster=False)
if set(ctx_slurm.vars) > set(ctx_no_slurm.vars):
submitter = ExtractionSubmitter(Path.cwd(), self.db)
cluster_req = ExtractionRequest(
run, proposal, mock=mock,
run_data=run_data, cluster=True, match=match, variables=variables
)
submitter.submit(cluster_req)


def main(argv=None):
Expand Down

0 comments on commit 555e626

Please sign in to comment.