How To Create Custom Resource On PBS

1)create the resource.like lscratch on compute node
/var/spool/PBS/mom_priv ->
[root@n001 mom_priv]# file lscratch
lscratch: Bourne-Again shell script text executable
[root@n001 mom_priv]# cat lscratch
#!/bin/bash
LSCRATCH=/scratch
echo "$(/bin/df -BG $LSCRATCH|tail -n 1| awk '{print $4}'|tr [:upper:] [:lower:])b"
[root@n001 mom_priv]# ./lscratch
653gb

2)Add the script into config file
[root@n001 mom_priv]# cat  config
lscratch !/var/spool/PBS/mom_priv/lscratch
<resource-name> !<absolute_path_of_the_resource_scrtip>

Go To The Server
1)Add the Resource to the scheduler
/var/spool/PBS/sched_priv

[root@admin aeihwula sched_priv]# cat sched_config | grep -i lscratch
resources: "ncpus, mem, arch, host, DynaTokens, dyna, dyna1, vnode, netwins, aoe, applications_enabled,pas_applications_enabled, ngpus,lscratch"
mom_resources: "lscratch"

# cat resourcedef
lscratch type=size flag=h

Testing
You can test with Interactive job
1)qsub -I -l select=1:ncpus=4:lsctach=4gb

Post a Comment

0 Comments