Skip to content

Conversation

@ekouts
Copy link
Contributor

@ekouts ekouts commented Nov 15, 2022

For Slurm version >= 22.05 we pass explicitly --cpus-per-task to srun if num_cpus_per_task is set. For older versions we simply emit the srun command. If we cannot get the version of Slurm we also pass the option since it shouldn't hurt in theory for older versions.

Fixes #2655 .

@ekouts ekouts requested review from rsarm, victorusu and vkarak November 15, 2022 08:55
@ekouts ekouts self-assigned this Nov 15, 2022
@ekouts ekouts changed the title Set explicitely cpus-per-task in srun launcher [bugfix] Set explicitely cpus-per-task in srun launcher Nov 15, 2022
@vkarak vkarak changed the title [bugfix] Set explicitely cpus-per-task in srun launcher [bugfix] Set explicitly cpus-per-task in srun launcher Nov 15, 2022
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.

You have the job so you can set the --cpus-per-task based on the job's value, from job.num_cpus_per_task. If it's None, you simply don't add the option. Also, I would also suggest to check the srun --version during the initialization of the launcher and emit this option only if it is greater than 22.05.

@ekouts
Copy link
Contributor Author

ekouts commented Nov 16, 2022

You have the job so you can set the --cpus-per-task based on the job's value, from job.num_cpus_per_task. If it's None, you simply don't add the option.

I thought about this but I think it wouldn't work if the user is setting the option from the cli with -Jcpus-per-task, right? Or if it's part of the partition options in the configuration. I will try it to make sure

@vkarak vkarak changed the title [bugfix] Set explicitly cpus-per-task in srun launcher [bugfix] Pass explicitly the --cpus-per-task option to srun for Slurm >= 22.05 Nov 18, 2022
@vkarak vkarak merged commit 4d842c8 into reframe-hpc:master Nov 18, 2022
@ekouts ekouts deleted the slurm_cpus_per_task_bugfix branch December 7, 2022 11:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Change of behaviour in Slurm version 22.05

2 participants