Unable to set pbs.event().job.Resource_List['select'] on runjob reject if job had no select request

Description

Trying to set a Resourrce_List on a job that was not submitted with a -lselect request fails.

See http://community.pbspro.org/t/runjob-hook-modify-select-problem/268

Using this as a runjob hook:

import pbs
pbs.event().job.Resource_List["select"] = pbs.select("2:nodetype=io")
pbs.event().reject("Some comment")

With this resource:

create resource nodetype
set resource nodetype type = string
set resource nodetype flag = h

I see this behavior:

[root@centos7 tmp]# qmgr -c "c n centos7"
[root@centos7 tmp]# /opt/pbs/sbin/pbs_mom
[root@centos7 tmp]# qmgr -c "s s scheduling=f"

GOOD, nodetype gets set:

[user1@centos7 ~]$ echo "echo bar" | qsub -lselect=1:ncpus=1
0.centos7

[root@centos7 tmp]# qstat -f 0 | grep select
Resource_List.select = 1:ncpus=1
schedselect = 1:ncpus=1
Submit_arguments = -lselect=1:ncpus=1
[root@centos7 tmp]# qrun 0
qrun: Failed to run: Some comment (15136) 0.centos7
[root@centos7 tmp]# qstat -f 0 | grep select
Resource_List.select = 2:nodetype=io
schedselect = 2:nodetype=io:ncpus=1
Submit_arguments = -lselect=1:ncpus=1

BAD, nodetype is not set:

[user1@centos7 ~]$ echo "echo bar" | qsub
1.centos7

[root@centos7 tmp]# qstat -f 1 | grep select
Resource_List.select = 1:ncpus=1
schedselect = 1:ncpus=1
[root@centos7 tmp]# qrun 1
qrun: Failed to run: Some comment (15136) 1.centos7
[root@centos7 tmp]# qstat -f 1 | grep select
Resource_List.select = 1:ncpus=1
schedselect = 1:ncpus=1

Acceptance Criteria

None

Status

Assignee

Unassigned

Reporter

Scott Campbell

Severity

None

OS

None

Start Date

None

Pull Request URL

None

Story Points

1

Components

Affects versions

14.1.0

Priority

Low
Configure