-
Notifications
You must be signed in to change notification settings - Fork 117
[feat] Add ability to specify number of nodes for slurm scheduler #2693
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
Conversation
|
Can I test this patch? |
|
I'd appreciate some guidance on how to cleanly introduce this feature into ReFrame, as it stands, my needs are met by this small change, but I'm happy to keep working on it until many other people are satisfied. |
Fix my poorformatting
|
Wouldn't setting If you use that option, note that in 4.0 all the scheduler-specific options will be moved inside the partition definition (see also issue #2669). |
This is very close to what I want, it adds the --nodes line to the job script, but then only allows me to allocate a fixed number of mpi tasks per node. I'd like that to be automatically filled in by the scheduler, which slurm will do as long as you leave --ntasks out of your script. Allowing Slurm to come up with the number of tasks, means that I can run the test on a new cluster without having to specify how many tasks will be required to fill the node (assuming 1 cpu per task). For example with this PR: class hpcg(rfm.RegressionTest):
sourcepath="hpcg-3.1"
num_cpus_per_task=1
num_tasks=None
exclusive_access=True
num_nodes=4Generates: #!/bin/bash
#SBATCH --job-name="rfm_job"
#SBATCH --cpus-per-task=1
#SBATCH --nodes=4
#SBATCH --output=rfm_job.out
#SBATCH --error=rfm_job.err
#SBATCH --time=1:0:0
#SBATCH --exclusive
srun --cpus-per-task=1 hpcg-3.1/bin/xhpcg
Which in turn allocates 28 tasks per node for a total of 96 tasks on my system. |
|
You are right, I wasn't aware of this capability of the
My concern regarding the implementation is that Introducing simply a |
|
It seems to me that Slurm is already given special treatment with many options as shown by the table here. While adding another is definitely not the cleanest way to deal with this looking to the future it certainly wouldn't be out of place with the current state of things. I agree and I'm on board with finding a more long term solution to all those other examples too though. In this case, my requirements depends on the omission of I think having the option of being explicit within the frontend about exactly how the job is run by the scheduler behind the scenes would be desirable to many people. They might prefer to set I think |
|
What about the following? If class my_test(...):
num_tasks = None
@run_before('run') # or anywhere after setup
def setup_job(self):
self.job.options = [f'--nodes={N}']Setting |
|
Yep, that makes sense to me. Would definitely give me the control that I need over the job script. |
|
@ethanjjjjjjj I will close and reopen this against the |
I believe that being able to explicitly ask for a number of nodes would be a useful feature, especially where the same set of tests are reused between clusters and partitions. This should give the ability to request full nodes from the Slurm scheduler without having to be explicit about how many tasks to run with, or how many cores the node has.
Helps solve some of the issues mentioned in #2093