pbs_statjob.3B 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253
  1. .\" Copyright (C) 1994-2018 Altair Engineering, Inc.
  2. .\" For more information, contact Altair at www.altair.com.
  3. .\"
  4. .\" This file is part of the PBS Professional ("PBS Pro") software.
  5. .\"
  6. .\" Open Source License Information:
  7. .\"
  8. .\" PBS Pro is free software. You can redistribute it and/or modify it under the
  9. .\" terms of the GNU Affero General Public License as published by the Free
  10. .\" Software Foundation, either version 3 of the License, or (at your option) any
  11. .\" later version.
  12. .\"
  13. .\" PBS Pro is distributed in the hope that it will be useful, but WITHOUT ANY
  14. .\" WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  15. .\" FOR A PARTICULAR PURPOSE.
  16. .\" See the GNU Affero General Public License for more details.
  17. .\"
  18. .\" You should have received a copy of the GNU Affero General Public License
  19. .\" along with this program. If not, see <http://www.gnu.org/licenses/>.
  20. .\"
  21. .\" Commercial License Information:
  22. .\"
  23. .\" For a copy of the commercial license terms and conditions,
  24. .\" go to: (http://www.pbspro.com/UserArea/agreement.html)
  25. .\" or contact the Altair Legal Department.
  26. .\"
  27. .\" Altair’s dual-license business model allows companies, individuals, and
  28. .\" organizations to create proprietary derivative works of PBS Pro and
  29. .\" distribute them - whether embedded or bundled with other software -
  30. .\" under a commercial license agreement.
  31. .\"
  32. .\" Use of Altair’s trademarks, including but not limited to "PBS™",
  33. .\" "PBS Professional®", and "PBS Pro™" and Altair’s logos is subject to Altair's
  34. .\" trademark licensing policies.
  35. .\"
  36. .TH pbs_statjob 3B "21 October 2013" Local "PBS Professional"
  37. .SH NAME
  38. pbs_statjob - obtain status of PBS batch jobs
  39. .SH SYNOPSIS
  40. #include <pbs_error.h>
  41. .br
  42. #include <pbs_ifl.h>
  43. .sp
  44. .B struct batch_status *pbs_statjob(\^int\ connect, char\ *id,
  45. .B struct\ attrl\ *attrib, char *extend)
  46. .sp
  47. .B void pbs_statfree(\^struct batch_status *psj\^)
  48. .SH DESCRIPTION
  49. Issue a batch request to query and return the status of a
  50. specified batch job, a list of batch jobs, or a set of batch jobs at a
  51. queue or server.
  52. .LP
  53. A
  54. .I "Status Job"
  55. batch request is generated and sent to the server over the connection
  56. specified by
  57. .I connect.
  58. .LP
  59. .SH PARAMETERS
  60. The
  61. .I connect
  62. parameter is the return value of
  63. .B pbs_connect().
  64. The
  65. .I id
  66. parameter can be a job identifier, a list of job identifiers, or a
  67. queue or server identifier.
  68. .LP
  69. .RS 4
  70. If
  71. .I id
  72. is a job identifier, it is the identifier of the job
  73. for which status is requested. It is specified in the form:
  74. .RS 4
  75. .I "sequence_number.server"
  76. .br
  77. or, for an array job,
  78. .br
  79. .I "sequence_number[].server"
  80. .RE
  81. where the first character of the identifier must be a digit. If the
  82. identifier is for an array job but the 't' character is not included
  83. in the
  84. .I extend
  85. parameter, the status of the array job is returned, but not the status
  86. of its subjobs. If the 't' character is included, status for each
  87. subjob is returned.
  88. .LP
  89. If
  90. .I id
  91. is a list of job identifiers, it must be a comma-separated list of job
  92. identifiers in a single string. The first character of the string must
  93. be a digit. White space outside of a job identifier is ignored. There is
  94. no limit to the length of the string except as imposed by available memory.
  95. If
  96. .I id
  97. is a destination (server or queue) identifier, the status of all jobs
  98. at the destination which the user is authorized to see is returned.
  99. If
  100. .I id
  101. is the null pointer or a null string, the status of each job at the
  102. server to which the user is connected is returned.
  103. .LP
  104. .RE
  105. The
  106. .I attrib
  107. parameter is a pointer to a list of attributes.
  108. If
  109. .I attrib
  110. is specified, then only the attributes in the list are returned by the server.
  111. Otherwise, all the attributes of a job are returned.
  112. The
  113. .I attrib
  114. parameter is a pointer to an
  115. .I attrl
  116. structure which is defined in pbs_ifl.h as:
  117. .sp
  118. .Ty
  119. .nf
  120. struct attrl {
  121. struct attrl *next;
  122. char *name;
  123. char *resource;
  124. char *value;
  125. };
  126. .fi
  127. .sp
  128. .RS 4
  129. The
  130. .I next
  131. member is a pointer to the next entry in the list.
  132. The
  133. .I attrib
  134. list is terminated by the first entry where
  135. .I next
  136. is a null pointer.
  137. The
  138. .I name
  139. member is a pointer to an attribute name. Attribute names are
  140. listed in pbs_ifl.h.
  141. The
  142. .I resource
  143. member specifies the name of the resource in the job's
  144. .I Resource_List
  145. attribute.
  146. When
  147. .I attrl
  148. describes the job's
  149. .I Resource_List
  150. job attribute, the
  151. .I name
  152. member is ATTR_l.
  153. If
  154. .I attrl
  155. is not ATTR_l,
  156. .I resource
  157. should be a
  158. pointer to a null string.
  159. The
  160. .I value
  161. member should always be a pointer to a null string.
  162. .LP
  163. .RE
  164. The
  165. .I extend
  166. parameter is used for extensions. This parameter can consist of
  167. characters in any order.
  168. .RS 4
  169. When the
  170. .I extend
  171. parameter includes 't', if any array job identifiers are in the set of
  172. IDs being queried, the
  173. status of each array job is followed by status of each subjob in
  174. the array job.
  175. When the
  176. .I extend
  177. parameter includes 'x', finished and moved jobs and subjobs can be
  178. queried, and their status is included. Subjobs are not considered
  179. finished until the parent array job is finished.
  180. .RE
  181. .LP
  182. .SH RETURN VALUES and ERRORS
  183. For a single job, if the job can be queried, the return value is a pointer to a
  184. .I batch_status
  185. structure containing the status of the specified job.
  186. If the job cannot be queried, a NULL pointer is returned, and
  187. .I pbs_errno
  188. is set to an error number.
  189. For a list of jobs, if any of the specified jobs can be queried, the
  190. return value is a pointer to a
  191. .I batch_status
  192. structure containing the
  193. status of all the queryable jobs. If none of the jobs can be queried,
  194. a NULL pointer is returned, and
  195. .I pbs_errno
  196. is set to the error number
  197. that indicates the reason that the last job in the list could not be
  198. queried.
  199. For a queue, if the queue exists, the return value is a pointer to a
  200. .I batch_status
  201. structure containing the status of all the queryable jobs
  202. in the queue. If the queue does not exist, a NULL pointer is returned, and
  203. .I pbs_errno
  204. is set to PBSE_UNKQUE (15018). If the queue exists but contains
  205. no queryable jobs, a NULL pointer ia returned and
  206. .I pbs_errno
  207. is set to
  208. PBSE_NONE (0).
  209. When querying a server, the connection to the server is already
  210. established by
  211. .B pbs_connect().
  212. If there are jobs at the server, the return value of the query is a
  213. pointer to a
  214. .I batch_status
  215. structure containing the status of all the queryable jobs at the
  216. server. If the server does not contain any queryable jobs, a NULL
  217. pointer ia returned and
  218. .I pbs_errno
  219. is set to PBSE_NONE (0).
  220. The batch_status structure is defined in pbs_ifl.h as
  221. .sp
  222. .Ty
  223. .nf
  224. struct batch_status {
  225. struct batch_status *next;
  226. char *name;
  227. struct attrl *attribs;
  228. char *text;
  229. }
  230. .fi
  231. .LP
  232. It is up the user to free the structure when no longer needed, by calling
  233. \f3pbs_statfree\f1().
  234. .LP
  235. .SH SEE ALSO
  236. qstat(1B) and pbs_connect(3B)