Skip to content
Snippets Groups Projects

Launch jobs with variable nice value

Merged Philipp Schmidt requested to merge feat/degressive-slurm-priority into master
Files
3
+ 22
0
@@ -14,6 +14,7 @@ from webservice.webservice import ( # noqa: import not at top of file
run_action,
wait_on_transfer,
get_slurm_partition,
get_slurm_nice
)
@@ -177,3 +178,24 @@ async def test_get_slurm_partition(proposal_number,
ret = await get_slurm_partition(client, action, proposal_number)
assert ret == expected_result
@pytest.mark.asyncio
@pytest.mark.parametrize(
'cycle, num_jobs, expected_result',
[
('202201', 0, 0), ('202201', 10, 3*10**2), # user proposal
('202221', 0, 5), ('202221', 10, 5+3*10**2), # commissioning
]
)
async def test_get_slurm_nice(fake_process, cycle, num_jobs, expected_result):
fake_process.register(
['squeue', '-h', '-o', '%.20j', '-p', 'exfel', '--me'],
stdout='\n'.join(
[f'correct_SPB_{i}' for i in range(num_jobs)] +
[f'correct_FXE_{i}' for i in range(num_jobs*2)]).encode('ascii'),
returncode=0)
ret = await get_slurm_nice(
'exfel', 'SPB', cycle, job_penalty=3, commissioning_penalty=5)
assert ret == expected_result
Loading