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

[feat] Allow ReFrame to pass the access options in command line instead of the script for Slurm #3156

Open
wants to merge 11 commits into
base: develop
Choose a base branch
from

Conversation

ekouts
Copy link
Contributor

@ekouts ekouts commented Apr 11, 2024

Right now I am only changing this for Slurm. I leave these options in the slurm script, mostly to remind whoever might be checking the script that the options are not ignored. Do you think I should remove them from the script?

Closes #2970 .

@ekouts ekouts added this to the ReFrame 4.6 milestone Apr 11, 2024
@ekouts ekouts self-assigned this Apr 11, 2024
@pep8speaks
Copy link

pep8speaks commented Apr 11, 2024

Hello @ekouts, Thank you for updating!

Cheers! There are no PEP8 issues in this Pull Request!Do see the ReFrame Coding Style Guide

Comment last updated at 2024-04-19 16:22:53 UTC

@ekouts ekouts changed the title Add access_on_submission_command sched config option Allow ReFrame to pass the access options in command line instead of the script for Slurm Apr 11, 2024
Copy link
Contributor

@vkarak vkarak left a comment

Choose a reason for hiding this comment

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

I would suggest to (a) extend this to all the schedulers and (b) do not emit the options in the job script.

Also I don't know how would be able to test this fully, but at least we need unit tests that set this option and verify that the sched_access options are not passed in the script if this configuration option is set.

reframe/schemas/config.json Outdated Show resolved Hide resolved
docs/config_reference.rst Outdated Show resolved Hide resolved
reframe/core/schedulers/lsf.py Outdated Show resolved Hide resolved
reframe/core/schedulers/oar.py Outdated Show resolved Hide resolved
reframe/core/schedulers/pbs.py Outdated Show resolved Hide resolved
job.sched_access
)
if parsed_options.constraint:
constraints.append(parsed_options.constraint.strip())
Copy link
Contributor

Choose a reason for hiding this comment

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

I think that we should do the same thing with constraints in both cases.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

But in the case the -C c1 is passed in with sbatchand then they are joined in the script -C c1&c2 the option in the script will probably be ignored completely, right?
So are you suggesting that we join them in the submission command as well? Then the behaviour would be that we only add the constraint options from the test in the job, while passing the rest in the script?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think additional constraints should be combined with sched_access and passed from the command line in this case, because this is the equivalent of what we are doing now.

Copy link
Contributor

Choose a reason for hiding this comment

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

The logic becomes a bit complicated to properly support this, so I suggest postponing this to 4.7 to properly test. Maybe we should change the logic and stop treating constraints specially and pass the responsibility of combining the constraints to the test.

' '.join(job.sched_access) if self._sched_access_in_submit
else ''
)
cmd = f'sbatch {cmd_opts} {job.script_filename}'
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd use the cmd_parts pattern again.

ekouts and others added 2 commits April 19, 2024 17:35
Co-authored-by: Vasileios Karakasis <vkarak@gmail.com>
Co-authored-by: Vasileios Karakasis <vkarak@gmail.com>
Copy link

codecov bot commented Apr 19, 2024

Codecov Report

Attention: Patch coverage is 47.61905% with 22 lines in your changes are missing coverage. Please review.

Project coverage is 86.56%. Comparing base (2d1eca4) to head (f084223).
Report is 21 commits behind head on develop.

Files Patch % Lines
reframe/core/schedulers/lsf.py 33.33% 6 Missing ⚠️
reframe/core/schedulers/pbs.py 40.00% 6 Missing ⚠️
reframe/core/schedulers/oar.py 44.44% 5 Missing ⚠️
reframe/core/schedulers/slurm.py 61.53% 5 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #3156      +/-   ##
===========================================
- Coverage    86.66%   86.56%   -0.11%     
===========================================
  Files           61       61              
  Lines        12134    12167      +33     
===========================================
+ Hits         10516    10532      +16     
- Misses        1618     1635      +17     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@vkarak vkarak modified the milestones: ReFrame 4.6, ReFrame 4.7 Apr 19, 2024
@vkarak vkarak changed the title Allow ReFrame to pass the access options in command line instead of the script for Slurm [feat] Allow ReFrame to pass the access options in command line instead of the script for Slurm May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

Allow users to pass extra options to the job submission command in the partition config
3 participants