Hook error on qsub

Hello OpenPBS community team,

I have OpenPBS 23.06 installed on Ubuntu 22.04.
I am trying to limit the WallTime of an interactive job using Hook.

I get the following error after qsub and cannot queue

Submit:

$ qsub -q VM-CPU@kvm-pbs -I
qsub: request rejected as filter hook 'setWallTime' encountered an exception.

Hook:

import pbs
import sys

e = pbs.event()
j = e.job

if e.job.interactive:
    j.Resource_List["walltime"] = pbs.duration(getseconds("48:00:00"))

e.accept()

Server_LOG:

02/09/2024 16:04:05;0086;Server@kvm-pbs;Svr;Server@kvm-pbs;Compiling script file: </var/spool/pbs/server_priv/hooks/setWallTime.PY>
02/09/2024 16:04:05;0001;Server@kvm-pbs;Svr;Server@kvm-pbs;PBS server internal error (15011) in Error evaluating Python script, <class 'NameError'>
02/09/2024 16:04:05;0001;Server@kvm-pbs;Svr;Server@kvm-pbs;PBS server internal error (15011) in Error evaluating Python script, name 'getseconds' is not defined
02/09/2024 16:04:05;0100;Server@kvm-pbs;Hook;setWallTime;queuejob hook 'setWallTime' encountered an exception, request rejected

Please inform us if you need more information

Regards,
Hiromi

Please try this instead
#pbs.duration(“[[hours:]minutes:]seconds[.milliseconds]”)
j.Resource_List["walltime"] = pbs.duration('48:00:00')

Thank you

Adarsh-san,

Thank you for your reply.
Hook has worked properly.

Thank you!

1 Like