slurmctld: test job_specs->min_nodes before altering the value via partition setting
This fixes a problem when trying to move a pending job from one partitition to another while not supplying any other parameters: * if a partition value is present, the job is pending and no min_nodes are supplied, the job_specs->min_nodes get set from the detail_ptr value; * this causes subsequent tests for job_specs->min_nodes ==/!= NO_VAL to fail. The following illustrates the behaviour, the example is taken from our system: palu2:0 ~>scontrol update jobid=3944 partition=night slurm_update error: Requested operation not supported on this system slurmctld.log [2011-04-06T14:39:51] update_job: setting partition to night for job_id 3944 [2011-04-06T14:39:51] Change of size for job 3944 not supported [2011-04-06T14:39:51] updating accounting [2011-04-06T14:39:51] _slurm_rpc_update_job JobId=3944 uid=21215: Requested operation not supported on this system ==> The 'Change of size for job 3944' reveals that the !select_g_job_expand_allow() case was triggered, after setting the job_specs->min_nodes due to supplying a job_specs->partition. Fix: ==== Since the test for select_g_job_expand_allow() is not dependent on the job state, moved it up, before the test for the job_specs->partition. At the same time, also moved the equality for INFINITE/NO_VAL min_nodes values to the same place. Tests for job_specs->min_nodes below the job_specs->partition setting depend on the job state, - the 'Reset min and max node counts as needed, insure consistency' requires pending state; - the other remaining test is only for IS_JOB_RUNNING/SUSPENDED.
Please register or sign in to comment