pbs_selectjob(3B)
pbs_selectjob(3B) from PBS Professional is here to teach you how to select PBS batch jobs, and she is serving π
.
πΈ NAME πΈ
pbs_selectjob β select PBS batch jobs according to specified criteria. yes bestie, thatβs literally the whole vibe π―
β¨ SYNOPSIS β¨
#include <pbs_error.h>
#include <pbs_ifl.h>
char **pbs_selectjob(int connect, struct attropl *criteria_list,
char *extend)
π DESCRIPTION π
okay so pbs_selectjob() sends a batch request to select jobs that meet the criteria you specify, and then returns an array of job IDs that meet those criteria. iconic behavior, honestly π
This call generates a Select Jobs (16) batch request and sends it to the server over the connection handle specified by connect.
By default, pbs_selectjob() returns all batch jobs for which the user is authorized to query status. you filter the jobs by specifying values for job attributes and resources. You send a linked list of attributes with associated values and operators. Job attributes are listed in pbs_job_attributes(7B).
It returns a list of jobs that meet all specified criteria. no half-matches, no maybes, periodt β¨
π 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 attributes to use as selection criteria. Each attribute 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.
extendβ Character string where you can specify limits or extensions of your search.
π§ 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.opβ Defines the operator in the logical expression:
<existing value> <operator> <specified limit>
Jobs for which the logical expression evaluates to True are selected.
For this command, op can be EQ, NE, GE, GT, LE, LT. get into it π
π¦ QUERYING STATES π¦
You can select jobs in more than one state using a single request, by listing all the states you want returned. For example, to get jobs in Held and Waiting states:
- Fill in
criteria_list->namewith"job_state" - Fill in
criteria_list->valuewith"HW"for Held and Waiting
see? one request, multiple states, main character energy π
π 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_selectjob ( ..., ..., <extend characters>) ...
To get information on finished jobs only:
- Add the
"x"character to theextendparameter - Fill in
criteria_list->namewith"ATTR_state" - Fill in
criteria_list->valuewith"FM"for Finished and Moved
Subjobs are not considered finished until the parent array job is finished. important lore, bestie π«Ά
π Querying Job Arrays and Subjobs π
To query only job arrays (not jobs or subjobs):
- Fill in
criteria_list->namewith"array" - Fill in
criteria_list->valuewith"True"
To query only job arrays and subjobs (not jobs):
- Fill in
criteria_list->namewith"array" - Fill in
criteria_list->valuewith"True" - Add the
"T"or"t"character to theextendparameter
To query only jobs and subjobs (not job arrays), add the "T" or "t" character to the extend parameter.
β RETURN VALUE β
The return value is a pointer to a null-terminated array of character pointers. Each character pointer in the array points to a character string which is a job ID in the form:
<sequence number>.<server>@<server>
If no jobs met the criteria, the first pointer in the array is null.
If an error occurred, the routine returns a null pointer, and the error number is available in the global integer pbs_errno. so if something goes sideways, check pbs_errno, okay? π
π CLEANUP REQUIRED π
The returned array of character pointers is malloc()'ed by pbs_selectjob(). When the array is no longer needed, you must free it via a call to free(). do not ghost your memory, bestie π
π SEE ALSO π
qselect(1B), pbs_connect(3B)
π and thatβs the wholepbs_selectjob(3B)page, bestie β source/versionLocal, dated15 November 2019. go select some jobs 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