Error when unsetting ncpus, that is ['ncpus'] = None, in modifyjob hook

Description

The hook is:
------------------------
import pbs
e = pbs.event()
j = e.job
#select = "4:ncpus=16:mem=10g"
#select = "1:ncpus=1"
select = "1:ncpus=1:mem=10m"
j.Resource_List['ncpus'] = None
j.Resource_List['select'] = pbs.select(select)

The reason the customer has : "j.Resource_List['ncpus'] = None"
is to remove the -l ncpus before PBS can "see" it.
Proof: This works as shown by: qsub -I -h -l ncpus=X
--> returns no errors.
When removing the line, j.Resource_List['ncpus'] = None

Problem: The same hook code is now also given the modifyjob event.
when user does: qalter -l ncpus=Y <jobid>
the same hook code should "remove" the ncpus because of the line: "j.Resource_List['ncpus'] = None"
However, that line is not working -> consequence is that -l ncpus is not removed -> hence PBS complains that
— qalter: "-lresource=" cannot be used with "select" or "place", resource is: ncpus 836.centos01.chee

Acceptance Criteria

None

Assignee

Mohammad Riyaz M Hakki

Reporter

Sam Goosen

Severity

None

OS

None

Start Date

None

Pull Request URL

None

Story Points

1

Fix versions

Priority

High
Configure