1pbs_statjob(3B) PBS pbs_statjob(3B)
2
3
4
6 pbs_statjob - obtain status of pbs batch jobs
7
9 #include <pbs_error.h>
10 #include <pbs_ifl.h>
11
12 struct batch_status *pbs_statjob(int connect, char *id,
13 struct attrl *attrib, char *extend)
14
15 void pbs_statfree(struct batch_status *psj)
16
18 Issue a batch request to obtain the status of a specified batch job or
19 a set of jobs at a destination.
20
21 A Status Job batch request is generated and sent to the server over the
22 connection specified by connect which is the return value of pbs_con‐
23 nect().
24
25 The parameter, id, may be either a job identifier or a destination
26 identifier.
27
28 If id is a job identifier, it is the identifier of the job for which
29 status is requested. It is specified in the form: sequence_num‐
30 ber.server
31
32 If id is a destination identifier, it specifies that status of all jobs
33 at the destination (queue) which the user is authorized to see be
34 returned. If id is the null pointer or a null string, the status of
35 each job at the server which the user is authorized to see is returned.
36
37 The parameter, attrib, is a pointer to an attrl structure which is
38 defined in pbs_ifl.h as:
39
40 struct attrl {
41 struct attrl *next;
42 char *name;
43 char *resource;
44 char *value;
45 };
46
47 The attrib list is terminated by the first entry where next is a null
48 pointer. If attrib is given, then only the attributes in the list are
49 returned by the server. Otherwise, all the attributes of a job are
50 returned. When an attrib list is specified, the name member is a
51 pointer to a attribute name as listed in pbs_alter(3) and pbs_sub‐
52 mit(3). The resource member is only used if the name member is ATTR_l,
53 otherwise it should be a pointer to a null string. The value member
54 should aways be a pointer to a null string.
55
56 The parameter, extend, is reserved for implementation defined exten‐
57 sions. TORQUE 2.0.0p1 added the #define'd constant string EXECQUEONLY
58 to only retrieve jobs in execution queues.
59
60 The return value is a pointer to a list of batch_status structures or
61 the null pointer if no jobs can be queried for status. The batch_sta‐
62 tus structure is defined in pbs_ifl.h as
63
64 struct batch_status {
65 struct batch_status *next;
66 char *name;
67 struct attrl *attribs;
68 char *text;
69 }
70
71 It is up the user to free the structure when no longer needed, by call‐
72 ing pbs_statfree().
73
75 qstat(1B) and pbs_connect(3B)
76
78 When the batch request generated by pbs_statjob() function has been
79 completed successfully and the status of each job has been returned by
80 the batch server, the routine will return a pointer to the list of
81 batch_status structures. If no jobs were available to query or an
82 error occurred, a null pointer is returned. The global integer
83 pbs_errno should be examined to determine the cause.
84
85
86
87
88Local pbs_statjob(3B)