Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make slurm jobs respect --match #64

Merged
merged 1 commit into from
Jul 12, 2023
Merged

Make slurm jobs respect --match #64

merged 1 commit into from
Jul 12, 2023

Conversation

JamesWrigley
Copy link
Member

@JamesWrigley JamesWrigley commented Jul 11, 2023

Previously the --match arguments weren't passed to the slurm job, so all variables would be reprocessed.

(cherry-picked from one of my giant branches)

@JamesWrigley JamesWrigley self-assigned this Jul 11, 2023
@JamesWrigley JamesWrigley added the enhancement New feature or request label Jul 11, 2023
@@ -204,6 +204,10 @@ def extract_and_ingest(self, proposal, run, cluster=False,

python_cmd = [sys.executable, '-m', 'damnit.backend.extract_data',
'--cluster-job', str(proposal), str(run), run_data.value]
if len(match) > 0:
for m in match:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should you also check that any of the match is actually a cluster variable and only start the job in this case?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's already done a couple lines above:

        # 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)

This change is only to forward those match arguments to the slurm job.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, thanks for the clarification. LGTM

@@ -204,6 +204,10 @@ def extract_and_ingest(self, proposal, run, cluster=False,

python_cmd = [sys.executable, '-m', 'damnit.backend.extract_data',
'--cluster-job', str(proposal), str(run), run_data.value]
if len(match) > 0:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think you need this condition - if m is empty, the loop won't do anything anyway. 🙂

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah true, removed in abf6e13.

@takluyver
Copy link
Member

LGTM too

Previously the --match arguments weren't passed to the slurm job, so all
variables would be reprocessed.
@JamesWrigley JamesWrigley merged commit 57c5c9e into master Jul 12, 2023
1 check passed
@JamesWrigley JamesWrigley deleted the slurm-match branch July 12, 2023 11:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants