pbs_selectjob.3B 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  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_selectjob 3B "3 March 2015" Local "PBS Professional"
  37. .SH NAME
  38. pbs_selectjob - select PBS batch jobs
  39. .SH SYNOPSIS
  40. #include <pbs_error.h>
  41. .br
  42. #include <pbs_ifl.h>
  43. .sp
  44. .B char **pbs_selectjob(\^int\ connect, struct\ attropl\ *attrib, char\ *extend\^)
  45. .SH DESCRIPTION
  46. Issue a batch request to select jobs which meet certain criteria.
  47. \f3pbs_selectjob\f1() returns an array of job identifiers which met the criteria.
  48. .LP
  49. The
  50. .I attropl
  51. struct contains the list of selection criteria.
  52. .LP
  53. Initially all batch jobs are selected for which the user is authorized to
  54. query status.
  55. This set may be reduced or filtered by specifying certain attributes
  56. of the jobs.
  57. .LP
  58. A
  59. .I "Select Jobs"
  60. batch request is generated and sent to the server over the connection
  61. specified by
  62. .I connect
  63. which is the return value of \f3pbs_connect\f1().
  64. .LP
  65. The argument,
  66. .I attrib ,
  67. is a pointer to an
  68. .I attropl
  69. structure which is defined in pbs_ifl.h as:
  70. .sp
  71. .Ty
  72. .nf
  73. struct attropl {
  74. struct attropl *next;
  75. char *name;
  76. char *resource;
  77. char *value;
  78. enum batch_op op;
  79. };
  80. .fi
  81. .sp
  82. The
  83. .I attrib
  84. list is terminated by the first entry where
  85. .I next
  86. is a null pointer.
  87. .LP
  88. The
  89. .I name
  90. member points to a string which is the name of the attribute.
  91. Not all of the job attributes may be used as a selection criteria.
  92. The
  93. .I resource
  94. member points to a string which is the name of a resource. This
  95. member is only used when
  96. .I name
  97. is set to ATTR_l.
  98. Otherwise, resource should be a pointer to a null string.
  99. The
  100. .I value
  101. member points to a string which is the value of the attribute or resource.
  102. The attribute names are listed in pbs_job_attributes.7B.
  103. .LP
  104. The
  105. .I op
  106. member defines the operator in the logical expression:
  107. .br
  108. .B \ \ \ \ value\ operator\ current_value
  109. .br
  110. The logical expression must evaluate as true for the job to be selected.
  111. The permissible values of
  112. .I op
  113. are defined in pbs_ifl.h as:
  114. .br
  115. .B "enum batch_op { ..., EQ, NE, GE, GT, LE, LT, ... };" .
  116. .br
  117. The attributes marked with (E) in the description above may only be selected
  118. with the equal, EQ, or not equal, NE, operators.
  119. .LP
  120. If
  121. .I attrib
  122. itself is a null pointer, then no selection is done on
  123. the basis of attributes.
  124. .LP
  125. The return value is a pointer to a null terminated array of character pointers.
  126. Each character pointer in the array points to a character string which is a
  127. .IR job_identifier
  128. in the form:
  129. .RS 4
  130. .I sequence_number.server@server
  131. .RE
  132. .LP
  133. The array is allocated by pbs_selectjob via \f3malloc\f1().
  134. When the array is no longer needed, the user is responsible for freeing it
  135. by a call to \f3free\f1().
  136. .LP
  137. The parameter,
  138. .I extend ,
  139. is reserved for implementation-defined extensions.
  140. .B Finished and Moved Jobs
  141. .br
  142. In order to get information on finished and moved jobs, you must add an
  143. .I 'x'
  144. character to the
  145. .I extend
  146. parameter. The
  147. .I extend
  148. parameter is a character string; set one character
  149. to be the
  150. .I 'x'
  151. character.
  152. For example:
  153. .RS 5
  154. .br
  155. .B pbs_selectjob
  156. ( ..., ..., extend) ...
  157. .RE
  158. .LP
  159. To get information on finished and moved jobs only, specify the Finished ('F')
  160. and moved ('M') job states. You must also use the
  161. .I extend
  162. character string containing the
  163. .I 'x'
  164. character.
  165. .LP
  166. Subjobs are not considered finished until the parent array job is finished.
  167. .SH "SEE ALSO"
  168. qselect(1B), pbs_alterjob(3B), and pbs_connect(3B)
  169. .SH DIAGNOSTICS
  170. When the batch request generated by
  171. pbs_selectjob()
  172. function has been completed successfully by a batch server, the routine will
  173. return a pointer to the array of job identifiers.
  174. If no jobs met the criteria, the first pointer in the array will be the
  175. null pointer.
  176. .LP
  177. If an error occurred, a null pointer is returned and the error is available
  178. in the global integer pbs_errno.