1pbs_rescquery(3B)                     PBS                    pbs_rescquery(3B)
2
3
4

NAME

6       pbs_rescquery, avail, totpool, usepool - query resource availability
7

SYNOPSIS

9       #include <pbs_error.h>
10       #include <pbs_ifl.h>
11
12       int pbs_rescquery(int connect, char **resourcelist, int arraysize,
13       int *available, int *allocated, int *reserved, int *down )
14
15       char *avail(int connect, char *resc)
16
17       int totpool(int connect, int update)
18
19       int usepool(int connect, int update)
20

DESCRIPTION

22       pbs_rescquery
23         Issue  a  request  to  the  batch server to query the availability of
24         resources.  connect is  the  connection  returned  by  pbs_connect().
25         resourcelist  is  an  array  of  one  or  more strings specifying the
26         resources to be queried.  arraysize is the is the number  of  strings
27         in  resourcelist.  available, allocated, reserved, and down are inte‐
28         ger arrays of size arraysize.  The amount of  resource  specified  in
29         the  corresponding  resourcelist  string  which is available, already
30         allocated, reserved, and down/off-line is  returned  in  the  integer
31         arrays.
32
33         At  the  present  time  the  only resources which may be specified is
34         "nodes".  It may be specified as
35             nodes
36             nodes=
37             nodes=specification
38         where specification is what a user specifies in the -l option  argue‐
39         ment  list for nodes, see qsub(1B) and the various pbs_resource_* man
40         pages.
41
42         Where the node resourcelist  is  a  simple  type,  such  as  "nodes",
43         "nodes=",  or  "nodes=type",  the numbers returned reflect the actual
44         number of nodes (of the specified type) which  are  available,  allo‐
45         cated, reserved, or down.
46
47         For   a   more  complex  node  resourcelist,  such  as  "nodes=2"  or
48         "nodes=type1:type2", only the value returned in available  has  mean‐
49         ing.   If  the  number  in available is positive, it is the number of
50         nodes requried to satisified the specification and that some  set  of
51         nodes  are  available  which  will satisify it, see avail ().  If the
52         number in available is zero, some number of nodes requried to satisi‐
53         fied  the specification are currently unavailable,  the request might
54         be satisifed at a later time.  If the number in  available  is  nega‐
55         tive, no combination of known nodes can satisified the specification.
56
57       avail
58         The avail () call is provided as conversion aid for scheduler written
59         for early versions of PBS.   The avail() routine uses pbs_rescquery()
60         and  returns  a  character  string answer.  connect is the connection
61         returned by pbs_connect().  resc is a single node=specification spec‐
62         ification  as discussed above.  If the nodes to satisify the specifi‐
63         cation are currently available, the return  value  is  the  character
64         string  yes  .  If the nodes are currently unavailable, the return is
65         the character string no .  If the specification could never be  sati‐
66         fied, the return is the string never .  An error in the specification
67         returns the character string ? .
68
69       totpool
70         The totpool () function returns the total number of nodes know to the
71         PBS  server.  This is the sum of the number of nodes available, allo‐
72         cated, reserved, and down.  The parameter connection is  the  connec‐
73         tion  returned  by  pbs_connect().  The parameter update if non-zero,
74         causes totpool() to issue a  pbs_rescquery()  call  to  obtain  fresh
75         information.    If  zero,  numbers from the prior pbs_rescquery() are
76         used.
77
78       usepool
79         usepool () returns the number of nodes currently in use, the  sum  of
80         allocated,  reserved, and down.  The parameter connection is the con‐
81         nection returned by pbs_connect().  The parameter update if non-zero,
82         causes  totpool()  to  issue  a  pbs_rescquery() call to obtain fresh
83         information.   If zero, numbers from the  prior  pbs_rescquery()  are
84         used.
85

SEE ALSO

87       qsub(1B),  pbs_connect(3B), pbs_disconnect(3B), pbs_rescreserve(3B) and
88       pbs_resources(7B)
89

DIAGNOSTICS

91       When the batch request generated by the  pbs_rescquery()  function  has
92       been  completed successfully by a batch server, the routine will return
93       0 (zero).  Otherwise, a non zero error is returned.  The  error  number
94       is also set in pbs_errno.
95
96       The functions usepool() and totpool() return -1 on error.
97
98
99
100
101
102Local                                                        pbs_rescquery(3B)
Impressum