pbs_rescquery(3B)
π pbs_rescquery(3B) β your fave resource availability bestie π
okay so real talk: this is the pbs_rescquery(3B) page from the PBS manual. It's giving "I need to know what nodes are free" energy, and honestly? Iconic. Let's get into it π«Ά
β¨ NAME β¨
pbs_rescquery, avail, totpool, usepool β all about asking the batch server "hey bestie, what resources do we actually have?" π
πΈ SYNOPSIS πΈ
#include <pbs_error.h>
#include <pbs_ifl.h>
int pbs_rescquery(int connect, char **resourcelist, int arraysize,
int *available, int *allocated, int *reserved, int *down )
char *avail(int connect, char *resc)
int totpool(int connect, int update)
int usepool(int connect, int update)
π¦ DESCRIPTION π¦
π pbs_rescquery
So this one literally sends a request to the batch server asking about resource availability. Slay.
connectβ the connection you got back frompbs_connect()π«resourcelistβ an array of one or more strings saying which resources you're asking aboutarraysizeβ the number of strings chillin' inresourcelistavailable,allocated,reserved,downβ integer arrays, all sizearraysize. The amount of each resource from the matchingresourceliststring gets dropped into these bad boys: what's available, what's already allocated, what's reserved, and what's down/off-line π
rn the only resource you can specify is "nodes", and you can write it like:
nodes
nodes=
nodes=specification
where specification is exactly what a user would put in the -l option argument list for nodes β check qsub(1B) and the various pbs_resource_* man pages for the deets π
When the node resourcelist is a simple type β like "nodes", "nodes=", or "nodes=type" β the numbers coming back are the actual count of nodes (of that specified type) that are available, allocated, reserved, or down. No cap.
For a more complex node resourcelist β like "nodes=2" or "nodes=type1:type2" β only the value in available has meaning, periodt:
- If
availableis positive, it's the number of nodes required to satisfy the specification, and some set of nodes is available that will satisfy it (seeavail()below π). - If
availableis zero, some number of nodes required to satisfy the specification are currently unavailable β the request might get satisfied later, so don't lose hope bestie π - If
availableis negative, no combination of known nodes can satisfy the specification. It's giving never-ever energy π
π avail
The avail() call is a conversion aid for schedulers written for early versions of PBS. It uses pbs_rescquery() and returns a character string answer. Very throwback, very demure β¨
connectβ the connection frompbs_connect()rescβ a singlenode=specificationspec, same as discussed above
What you get back:
- If the nodes to satisfy the spec are currently available β the string
yes - If they're currently unavailable β the string
no - If the spec could never be satisfied β the string
never - If there's an error in the specification β the string
?
π§ totpool
totpool() returns the total number of nodes known to the PBS server. That's the sum of available + allocated + reserved + down. Math girlie behavior π
connect(calledconnectionin the param list above) β the connection frompbs_connect()updateβ if non-zero,totpool()issues apbs_rescquery()call to get fresh info. If zero, it uses numbers from the priorpbs_rescquery(). Your choice, bestie π«
π usepool
usepool() returns the number of nodes currently in use β that's allocated + reserved + down. Main character energy for the "busy" nodes π
connect(again,connectionin the param list) β the connection frompbs_connect()updateβ if non-zero,totpool()issues apbs_rescquery()call to get fresh info. If zero, numbers from the priorpbs_rescquery()are used.
π careful: the manpage literally saystotpool()in theusepool()description for the update param. Not me, not my typo, that's just what it says. Copying it verbatim because facts are facts.
π SEE ALSO π
qsub(1B), pbs_connect(3B), pbs_disconnect(3B), pbs_rescreserve(3B) and pbs_resources(7B) β go read these too, iykyk π
π₯ DIAGNOSTICS π₯
When the batch request generated by pbs_rescquery() is completed successfully by a batch server, the routine returns 0 (zero). Otherwise, a non-zero error is returned. The error number is also set in pbs_errno. β¨
The functions usepool() and totpool() return -1 on error. Sad but true π«Ά
π cute sign-off π
This page comes from the Local source, version 3B, and yeah β that's the whole vibe. Stay resourceful, bestie. ππΈπ¦β¨
pbs_rescquery(3B) β Local, 3B β periodt π
π¦ where this page comes from
- epel 9: torque-devel 6.1.3-8.el9 Β· OpenPBS and TORQUEv1.1
- nixos 26.05: torque 6.1.3h2
- nixpkgs unstable: torque 6.1.3h2
- Copyright (c) 1999-2000 Veridian Information Solutions, Inc
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms