Get walltime in a PBS job script

跟風遠走 提交于 2019-12-01 17:27:30

This is stored in the environment variable $PBS_WALLTIME.

Of course, that is for TORQUE, I'm not sure which PBS queuing system you are using.

I was looking for an answer to this and the comments above gave me an idea that seems to work pretty well. You can use qstat and grab the pertinent information from it with sed:

qstat -f $PBS_JOBID | sed -rn 's/.*Resource_List.walltime = (.*)/\1/p'

Putting this in your PBS script will print out the value and you can use standard bash to store the output of this in a variable:

WALLTIME=$(qstat -f $PBS_JOBID | sed -rn 's/.*Resource_List.walltime = (.*)/\1/p')

You can also use this to get other information that is not available from the PBS_* environment variables such as the amount of memory allocated for the job and probably some other stuff.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!