Skip to content

Commit 9e2354d

Browse files
committed
Set exclusive_node_use default to False (for some reason it was True)
and add a test (for slurm only at this time) to ensure that the corresponding parameter is not generated in the submit script.
1 parent acaa162 commit 9e2354d

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

src/psij/resource_spec.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def __init__(self, node_count: Optional[int] = None,
5454
processes_per_node: Optional[int] = None,
5555
cpu_cores_per_process: Optional[int] = None,
5656
gpu_cores_per_process: Optional[int] = None,
57-
exclusive_node_use: bool = True) -> None:
57+
exclusive_node_use: bool = False) -> None:
5858
"""
5959
Some of the properties of this class are constrained. Specifically,
6060
`process_count = node_count * processes_per_node`. Specifying all constrained properties

tests/test_executor.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,3 +224,16 @@ def test_submit_script_generation(exec_name: str) -> None:
224224
lambda k, v: setattr(attrs, k, v))
225225
_check_str_attrs(ex, job, [prefix + '.cust_attr1', prefix + '.cust_attr2'],
226226
lambda k, v: c_attrs.__setitem__(k, v))
227+
228+
229+
def test_resource_generation1() -> None:
230+
res = ResourceSpecV1()
231+
spec = JobSpec('/bin/date', resources=res)
232+
job = Job(spec=spec)
233+
ex = JobExecutor.get_instance('slurm')
234+
with TemporaryFile(mode='w+') as f:
235+
ex.generate_submit_script(job, ex._create_script_context(job), f)
236+
f.seek(0)
237+
contents = f.read()
238+
if contents.find('--exclusive') != -1:
239+
pytest.fail('Spurious exclusive flag')

0 commit comments

Comments
 (0)