|
NAMEpbs_selstat - obtain status of selected pbs batch jobsSYNOPSIS#include <pbs_error.h>#include <pbs_ifl.h> struct batch_status *pbs_selstat(int connect, struct attropl *sel_list, char *extend) void pbs_statfree(struct batch_status *psj) DESCRIPTIONIssue a batch request to examine the status of jobs which meet certain criteria. pbs_selstat() returns a list of batch_status structures for those jobs which met the selection criteria.This function is a combination of pbs_selectjobs() and pbs_statjob(). It is an extension to the POSIX Batch standard. Initially all batch jobs are selected for which the user is authorized to query status. This set may be reduced or filtered by specifying certain attributes of the jobs. A Select Status batch request is generated and sent to the server over the connection specified by connect which is the return value of pbs_connect(). The parameter, sel_list, is a pointer to an attropl structure which is defined in pbs_ifl.h as: struct attropl { struct attropl *next; char *name; char *resource; char *value; enum batch_op op; }; The sel_list list is terminated by the first entry where next is a null pointer. The name member points to a string which is the name of the
attribute. Not all of the job attributes may be used as a selection
criteria. The resource member points to a string which is the name of
a resource. This member is only used when name is set to ATTR_l,
otherwise it should be a pointer to a null string. The value member
points to a string which is the value of the attribute or resource. The
attribute names are defined in pbs_ifl.h:
The op member defines the operator in the logical
expression:
If sel_list itself is a null pointer, then no selection is done on the basis of attributes. The return value is a pointer to a list of batch_status structures or the null pointer if no jobs can be queried for status. 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; } The entry, attribs, is a pointer to a list of attrl structures defined in pbs_ifl.h as: struct attrl { struct attrl *next; char *name; char *resource; char *value; }; It is up the user to free the list of batch_status structures when no longer needed, by calling pbs_statfree(). The parameter, extend, is reserved for implementation defined extensions. TORQUE 2.0.0p1 added the #define'd constant string EXECQUEONLY to only retrieve jobs in execution queues. SEE ALSOqselect(1B), pbs_alterjob(3B), pbs_connect(3B), pbs_statjob(3B), and pbs_selectjob(3B).DIAGNOSTICSWhen the batch request generated by pbs_selstat() function has been completed successfully by a batch server, the routine will return a pointer to the list of batch_status structures. If no jobs met the criteria or an error occurred, the return will be the null pointer. If an error occurred, the global integer pbs_errno will be set to a non-zero value.
Visit the GSP FreeBSD Man Page Interface. |