pbs_selstat(3B)
π pbs_selstat(3B) β get status of selected PBS batch jobs β¨
okay bestie, this is the pbs_selstat(3B) page from the PBS Professional manual, and it's lowkey the "give me the jobs that match these criteria" bestie. no cap, it's useful. let's go π«Ά
πΈ NAME πΈ
pbs_selstat β get status of selected PBS batch jobs
β¨ SYNOPSIS β¨
#include <pbs_error.h>
#include <pbs_ifl.h>
struct batch_status *
pbs_selstat(int connect, struct attropl *criteria_list,
struct attrl *output_attribs, char *extend)
π DESCRIPTION π
okay so pbs_selstat issues a batch request to get the status of jobs that meet the specified criteria. it generates a Select Status (51) batch request and sends it to the server over the connection specified by connect.
it returns a list of batch_status structures for jobs that meet the selection criteria. iconic.
this function is a combination of pbs_selectjob() and pbs_statjob(). the way it's literally two icons in a trench coat.
by default this gives status for all jobs for which you are authorized to query status. you can filter the results by specifying selection criteria. slay.
π¦ ARGUMENTS π¦
connectβ return value ofpbs_connect(). specifies the connection handle over which to send the batch request to the server.criteria_listβ pointer to a list of selection criteria, which are attributes and resources with required values. if this list is null, you are not filtering your results via selection criteria. each attribute or resource is described in anattroplstructure, defined inpbs_ifl.has:
struct attropl {
struct attropl *next;
char *name;
char *resource;
char *value;
enum batch_op op;
};
if criteria_list itself is null, you are not using attributes or resources as selection criteria. both null facts stay, bestie.
output_attribsβ pointer to a list of attributes to return. if this list is null, all attributes are returned. each attribute is described in anattrlstructure, defined inpbs_ifl.has:
struct attrl {
char *name;
char *resource;
char *value;
struct attrl *next;
};
extendβ character string where you can specify limits or extensions of your selection.
π§ Members of attropl Structure π§
nextβ points to the next attribute in the list. a null pointer terminates the list.nameβ points to a string containing the name of the attribute.resourceβ points to a string containing the name of a resource. used only when the specified attribute contains resource information. otherwise,resourceshould be a null pointer.valueβ points to a string containing the value of the attribute or resource. for parameterized limit attributes, this string contains all parameters for the attribute.opβ specifies the test to be applied to the attribute or resource. the operators areEQ,NE,GE,GT,LE,LT.
π Members of attrl Structure π
nameβ points to a string containing the name of the attribute.resourceβ points to a string containing the name of a resource. used only when the specified attribute contains resource information. otherwise,resourceshould be a null pointer.valueβ points to a string containing the value of the attribute or resource. should always be null.nextβ points to the next attribute in the list. a null pointer terminates the list.
π QUERYING STATES π
you can select jobs in more than one state using a single request, by listing all states you want returned. for example, to get jobs in Held and Waiting states:
Fill in criteria_list->name with "job_state"
Fill in criteria_list->value with "HW" for Held and Waiting
π₯ EXTENDING YOUR QUERY π₯
you can use the following characters in the extend parameter:
T,tβ extends query to include subjobs. job arrays are not included.xβ extends query to include finished and moved jobs.
π Querying Finished and Moved Jobs π
to get information on finished or moved jobs, as well as current jobs, add an 'x' character to the extend parameter (set one character to be the 'x' character). for example:
pbs_selstat ( ..., ..., <extend characters>) ...
to get information on finished jobs only:
Add the "x" character to the extend parameter
Fill in criteria_list->name with "ATTR_state"
Fill in criteria_list->value with "FM" for Finished and Moved
for example:
criteria_list->name = ATTR_state;
criteria_list->value = "FM";
criteria_list->op = EQ;
pbs_selstat ( ..., criteria_list, ..., extend) ...
subjobs are not considered finished until the parent array job is finished. important bestie!
π¦ Querying Job Arrays and Subjobs π¦
to query only job arrays (not jobs or subjobs):
Fill in criteria_list->name with "array"
Fill in criteria_list->value with "True"
to query only job arrays and subjobs (not jobs):
Fill in criteria_list->name with "array"
Fill in criteria_list->value with "True"
Add the "T" or "t" character to the extend parameter
to query only jobs and subjobs (not job arrays), add the "T" or "t" character to the extend parameter.
π RETURN VALUE π
returns a pointer to a list of batch_status structures for jobs that meet the selection criteria. if no jobs meet the criteria or can be queried for status, returns the null pointer.
if an error occurred, the routine returns a null pointer, and the error number is available in the global integer pbs_errno.
π The batch_status Structure π
the batch_status structure is defined in pbs_ifl.h as
struct batch_status {
struct batch_status *next;
char *name;
struct attrl *attribs;
char *text;
}
π CLEANUP π
you must free the list of batch_status structures when no longer needed, by calling pbs_statfree().
π SEE ALSO π
qselect(1B)qstat(1B)pbs_connect(3B)pbs_selectjob(3B)pbs_statjob(3B)
that's the whole page, bestie β source/version Local, dated 15 November 2019, for pbs_selstat(3B) in the PBS Professional manual. bye and slay πβ¨
π¦ where this page comes from
- nixos 26.05: openpbs 23.06.06-unstable-2026-04-02
- nixpkgs unstable: openpbs 23.06.06-unstable-2026-04-02
- Copyright (C) 1994-2021 Altair Engineering, Inc
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms