Interface 1: As an admin or user, I would like qstat to be able to output full job attribute information in JSON format so that I can more easily write scripts consuming this information.
- Visibility: Public
- Change Control: Stable
- Details: qstat -f will use -Fjson option to print the output in JSON format(http://www.json.org/).
- Similar to pbsnodes -av -Fjson, timestamp, pbs_version and pbs_server will be used as the prolog of the output.
Usage:
qstat -f -F json
qstat -f -F json <job_id>
Example:
{
"timestamp":1479277336,
"pbs_version":"14.1",
"pbs_server":"vbox",
"Jobs":{
"1.vbox":{
"Job_Name":"STDIN",
"Job_Owner":"root@vbox",
"job_state":"Q",
"queue":"workq",
"server":"vbox",
"Checkpoint":"u",
"ctime":"Fri Nov 11 17:57:05 2016",
"Error_Path":"vbox:/home/nithinj/Tasks/overlay/STDIN.e1",
"Hold_Types":"n",
"Join_Path":"n",
"Keep_Files":"n",
"Mail_Points":"a",
"mtime":"Fri Nov 11 17:57:05 2016",
"Output_Path":"vbox:/home/nithinj/Tasks/overlay/STDIN.o1",
"Priority":0,
"qtime":"Fri Nov 11 17:57:05 2016",
"Rerunable":"True"
"Resource_List":{"ncpus":1,
"nodect":1,
"place":"pack",
"select":"1:ncpus=1"
},"schedselect":"1:ncpus=1",
"substate":10,
"Variable_List":{
"PBS_O_HOME":"/root",
"PBS_O_LANG":"en_US.utf8",
"PBS_O_LOGNAME":"nithinj",
"PBS_O_PATH":"/root/perl5/bin:/usr/lib64/qt- 3.3/bin:/home/nithinj/perl5/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:/usr/pbs/bin:/home/nithinj/.local/bin:/home/nithinj/bin:/opt/pbs/default/bin:/usr/local/git/bin:/opt/pbs/default/bin:/opt/pbs/default/sbin:/usr/local/git/bin",
"PBS_O_MAIL":"/var/spool/mail/nithinj",
"PBS_O_SHELL":"/bin/bash",
"PBS_O_WORKDIR":"/home/nithinj/Tasks/overlay",
"PBS_O_SYSTEM":"Linux",
"PBS_O_QUEUE":"workq",
"PBS_O_HOST" :"vbox"
},
"euser":"root",
"egroup":"root",
"queue_rank":1,
"queue_type":"E",
"comment":"Not Running: Not enough free nodes available",
"etime":"Fri Nov 11 17:57:05 2016",
"Submit_arguments":"-- /bin/sleep 1000",
"executable":"<jsdl-hpcpa:Executable>/bin/sleep</jsdl-hpcpa:Executable>",
"argument_list":"<jsdl-hpcpa:Argument>1000</jsdl-hpcpa:Argument>",
"project":"_pbs_project_default"
}
}
}
Interface 2: As an admin or user, I would like qstat to be able to output full job attribute information in delimiter separated value format so that I can more easily write scripts consuming this information.
- Visibility: Public
- Change Control: Stable
- Details: qstat -f will use -Fdsv option to print the output in delimiter separated value format.
- Default delimiter will be a pipe.("|")
- The user can provide custom delimiter using -D option. (character or string)
- Backslash ("\") is used as the escape character if delimiter itself is appearing in the value.
- newline is used as the separator between multiple jobs. Using the newline as the delimiter will lead to undefined behavior.
Since feed characters could break the dsv format, they are converted into the following if appears in the value.
newline → '\'+'n' and formfeed → '\'+'f' (plus indicated that it is a concatenation)
Usage:
qstat -f -F dsv
qstat -f -F dsv <job_id>
qstat -f -F dsv -D, (where "," is the delimiter)
Example:
qstat -f -Fdsv
Job Id: 1.vbox|Job_Name = STDIN|Job_Owner = root@vbox|job_state = Q|queue = workq|server = vbox|Checkpoint = u|ctime = Fri Nov 11 17:57:05 2016|Error_Path = vbox:/home/nithinj/Tasks/overlay/STDIN.e1|Hold_Types = n|Join_Path = n|Keep_Files = n Mail_Points = a|mtime = Fri Nov 11 17:57:05 2016|Output_Path = vbox:/home/nithinj/Tasks/overlay/STDIN.o1|Priority = 0|qtime = Fri Nov 11 17:57:05 2016|Rerunable = True|Resource_List.ncpus = 1|Resource_List.nodect = 1|Resource_List.place = pack|Resource_List.select = 1:ncpus=1|schedselect = 1:ncpus=1|substate = 10|Variable_List = PBS_O_HOME=/root,PBS_O_LANG=en_US.utf8, PBS_O_LOGNAME=nithinj, PBS_O_PATH=/root/perl5/bin:/usr/lib64/qt-3.3/bin:/home/nithinj/perl5/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:/usr/pbs/bin:/home/nithinj/.local/bin:/home/nithinj/bin:/opt/pbs/default/bin:/usr/local/git/bin:/opt/pbs/default/bin:/opt/pbs/default/sbin:/usr/local/git/bin,PBS_O_MAIL=/var/spool/mail/nithinj,PBS_O_SHELL=/bin/bash, PBS_O_WORKDIR=/home/nithinj/Tasks/overlay,PBS_O_SYSTEM=Linux, PBS_O_QUEUE=workq,PBS_O_HOST=vbox|euser = root|egroup = root|queue_rank = 1|queue_type = E|comment = Not Running: Not enough free nodes available|etime = Fri Nov 11 17:57:05 2016|Submit_arguments = -- /bin/sleep 1000|executable = <jsdl-hpcpa:Executable>/bin/sleep</jsdl-hpcpa:Executable>|argument_list = <jsdl-hpcpa:Argument>1000</jsdl-hpcpa:Argument>|project = _pbs_project_default
Job Id: 2.vbox|Job_Name = STDIN|Job_Owner = root@vbox|job_state = Q|queue = workq|server = vbox|Checkpoint = u|ctime = Fri Nov 11 17:57:05 2016|Error_Path = vbox:/home/nithinj/Tasks/overlay/STDIN.e2|Hold_Types = n|Join_Path = n|Keep_Files = n Mail_Points = a|mtime = Fri Nov 11 17:57:05 2016|Output_Path = vbox:/home/nithinj/Tasks/overlay/STDIN.o2|Priority = 0|qtime = Fri Nov 11 17:57:05 2016|Rerunable = True|Resource_List.ncpus = 1|Resource_List.nodect = 1|Resource_List.place = pack|Resource_List.select = 1:ncpus=1|schedselect = 1:ncpus=1|substate = 10|Variable_List = PBS_O_HOME=/root,PBS_O_LANG=en_US.utf8, PBS_O_LOGNAME=nithinj, PBS_O_PATH=/root/perl5/bin:/usr/lib64/qt-3.3/bin:/home/nithinj/perl5/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:/usr/pbs/bin:/home/nithinj/.local/bin:/home/nithinj/bin:/opt/pbs/default/bin:/usr/local/git/bin:/opt/pbs/default/bin:/opt/pbs/default/sbin:/usr/local/git/bin,PBS_O_MAIL=/var/spool/mail/nithinj,PBS_O_SHELL=/bin/bash, PBS_O_WORKDIR=/home/nithinj/Tasks/overlay,PBS_O_SYSTEM=Linux, PBS_O_QUEUE=workq,PBS_O_HOST=vbox|euser = root|egroup = root|queue_rank = 1|queue_type = E|comment = Not Running: Not enough free nodes available|etime = Fri Nov 11 17:57:05 2016|Submit_arguments = -- /bin/sleep 1000|executable = <jsdl-hpcpa:Executable>/bin/sleep</jsdl-hpcpa:Executable>|argument_list = <jsdl-hpcpa:Argument>1000</jsdl-hpcpa:Argument>|project = _pbs_project_default
NOTE:
JSON and DSV will be supported only with full set of attributes (" -f " option). This would include every vaild combination of "-f" (Ex: "qstat -Qf" or "qstat -Bf")
Using it with other optargs will throw the already existing "conflicting options" error and prints the usage on the screen.