I’ve followed the instructions in 5.14.6.3.ii of the PBS Pro Guide (20.0.1).
My flexlm script looks like this:
#!/bin/bash
# some comments...
raw=($(lmutil lmstat -c $2 -f $1 | grep Total | awk '{ print $0 }'))
avail=$((${raw[5]}-${raw[10]}))
total=${raw[5]}
echo $((avail))
resv=$(printf %.0f $(echo "$total*((100-$3)*0.01)" | bc)) #Percent to reserve for non-PBS jobs.
if [ "$avail" -le "$resv" ];then
echo $avail
else
echo $resv
fi
My qsub statement (which should pass and submit for execution) looks like this:
qsub -l msimhdlsim=1 ./scripts/echo_host.sh
Looking at sched_log i get this:
08/15/2024 15:16:29;0040;pbs_sched;Job;73.pbsserv;Insufficient amount of server resource: msimhdlsim (R: 1 A: 0 T: 0)
08/15/2024 15:16:29;0040;pbs_sched;Job;73.pbsserv;Job will never run with the resources currently configured in the complex
08/15/2024 15:16:29;0080;pbs_sched;Job;74.pbsserv;Considering job to run
The manual says: “The script must return the value via stdout in a single line ending with a newline”. FWIW i’ve tried doing
$avail
echo $avail
with no difference.
I didn’t include the first few lines but I already have. I’ll edit the excerpt above to reflect that.
Nothing that i can see:
08/16/2024 14:37:26;0080;pbs_sched;Req;;Starting Scheduling Cycle
08/16/2024 14:37:26;0040;pbs_sched;Node;pbscompute1;Unknown Node State: initializing on add operation
08/16/2024 14:37:26;0040;pbs_sched;Node;pbscompute1;Unknown Node State: initializing
08/16/2024 14:37:26;0080;pbs_sched;Job;76.pbsserv;Considering job to run
08/16/2024 14:37:26;0040;pbs_sched;Job;76.pbsserv;Insufficient amount of server resource: msimhdlsim (R: 50 A: 0 T: 0)
08/16/2024 14:37:26;0040;pbs_sched;Job;76.pbsserv;Job will never run with the resources currently configured in the complex
08/16/2024 14:37:26;0080;pbs_sched;Job;93.pbsserv;Considering job to run
08/16/2024 14:37:26;0040;pbs_sched;Job;93.pbsserv;Insufficient amount of server resource: msimhdlsim (R: 1 A: 0 T: 0)
08/16/2024 14:37:26;0040;pbs_sched;Job;93.pbsserv;Job will never run with the resources currently configured in the complex
08/16/2024 14:37:26;0080;pbs_sched;Job;94.pbsserv;Considering job to run
08/16/2024 14:37:26;0040;pbs_sched;Job;94.pbsserv;Insufficient amount of server resource: msimhdlsim (R: 1 A: 0 T: 0)
08/16/2024 14:37:26;0040;pbs_sched;Job;94.pbsserv;Job will never run with the resources currently configured in the complex
08/16/2024 14:37:26;0080;pbs_sched;Req;;Leaving Scheduling Cycle
08/19/2024 15:28:14;0080;pbs_sched;Job;107.pbsserv;Considering job to run
08/19/2024 15:28:14;0040;pbs_sched;Job;107.pbsserv;Insufficient amount of server resource: msimhdlsim (R: 101 A: 100 T: 100)
08/19/2024 15:28:14;0040;pbs_sched;Job;107.pbsserv;Job will never run with the resources currently configured in the complex
08/19/2024 15:28:14;0080;pbs_sched;Job;108.pbsserv;Considering job to run
08/19/2024 15:28:14;0040;pbs_sched;Job;108.pbsserv;Job run
For confirmation, my check.sh:
#!/bin/bash
echo "100"
FWIW, i added echo "100" and echo "50" to lmquery in place of the previous echo statements: