Skip to content

Commit

Permalink
PbsproScheduler: Replace deprecated ppn tag with ncpus (#5910)
Browse files Browse the repository at this point in the history
The `PbsproScheduler` was using the tag `ppn` to define the number of
cores per machine to request. This notation was deprecated at least as
of v13 of PBSPro and has recently been removed entirely. It is removed
in favor of `ncpus`.
  • Loading branch information
TurboKyle authored Mar 9, 2023
1 parent 68cc062 commit 059ab66
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion aiida/schedulers/plugins/pbspro.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def _get_resource_lines(
if num_mpiprocs_per_machine:
select_string += f':mpiprocs={num_mpiprocs_per_machine}'
if num_cores_per_machine:
select_string += f':ppn={num_cores_per_machine}'
select_string += f':ncpus={num_cores_per_machine}'

if max_wallclock_seconds is not None:
try:
Expand Down
4 changes: 2 additions & 2 deletions tests/schedulers/test_pbspro.py
Original file line number Diff line number Diff line change
Expand Up @@ -1008,7 +1008,7 @@ def test_submit_script_with_num_cores_per_mpiproc(self):
self.assertTrue('#PBS -r n' in submit_script_text)
self.assertTrue(submit_script_text.startswith('#!/bin/bash'))

self.assertTrue('#PBS -l select=1:mpiprocs=1:ppn=24' in submit_script_text)
self.assertTrue('#PBS -l select=1:mpiprocs=1:ncpus=24' in submit_script_text)
# Note: here 'num_cores_per_machine' should NOT override the mpiprocs

self.assertTrue("'mpirun' '-np' '23' 'pw.x' '-npool' '1' < 'aiida.in'" in submit_script_text)
Expand Down Expand Up @@ -1042,7 +1042,7 @@ def test_submit_script_with_num_cores_per_machine_and_mpiproc1(self):

self.assertTrue('#PBS -r n' in submit_script_text)
self.assertTrue(submit_script_text.startswith('#!/bin/bash'))
self.assertTrue('#PBS -l select=1:mpiprocs=1:ppn=24' in submit_script_text)
self.assertTrue('#PBS -l select=1:mpiprocs=1:ncpus=24' in submit_script_text)
# Note: here 'num_cores_per_machine' should NOT override the mpiprocs

self.assertTrue("'mpirun' '-np' '23' 'pw.x' '-npool' '1' < 'aiida.in'" in submit_script_text)
Expand Down

0 comments on commit 059ab66

Please sign in to comment.