How to manage Flexnet Licensing in PBS Pro?

  • qmgr -c “create resource hwu_lic type=long”

  • create a script in /usr/loca/bin/hwu_lic.sh that queries the license server and outputs available number of tokens only (integer)

  • Add it to the resources: line in the sched_config
    resources: “ncpus, aoe, …,hwu_lic”

  • Add the server_dyn_res line
    server_dyn_res: “hwu_lic !/usr/local/bin/hwu_lic.sh”

  • kill -HUP < PID OF THE PBS SCHEDULAR >

  • Submit jobs qsub -l select=1:ncpus=1 -l hwu_lic=100 – /bin/sleep 100

Please request the specific vendor for more information about the license query
Here is the script that might help you:

available=$(/path/to/bin/lmstat -a -c 1700@licenseserver| grep "Users of  feature" | awk >     '{print $6}')
used=$(path/to/bin/lmstat -a -c 1700@licenseserver| grep "Users of feature" | awk '{print $11}')
remaining=$((available-used))
echo $remaining

More about server_dyn_res can be found in this documentation

1 Like