Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Contact Us
Online Help
Domain Status
Man Pages

Virtual Servers

Topology Map

Server Agreement
Year 2038

USA Flag



Man Pages

Manual Reference Pages  -  PBS_SELECTJOB (3)



pbs_selectjob - select pbs batch jobs




#include <pbs_error.h>
#include <pbs_ifl.h>

char **pbs_selectjob(int connect, struct attropl *attrib, char *extend)


Issue a batch request to select jobs which meet certain criteria. pbs_selectjob() returns a array of job identifiers which met the criteria.

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 Jobs batch request is generated and sent to the server over the connection specified by which is the return value of pbs_connect().

The argument, 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 list is terminated by the first entry where is a null pointer.

The 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 member points to a string which is the name of a resource. This member is only used when is set to ATTR_l. Otherwise, resource should be a pointer to a null string. The member points to a string which is the value of the attribute or resource. The attribute names are defined in pbs_ifl.h:

#define ATTR_a Select based upon the job’s execution time.
#define ATTR_A Select (E) based upon the account string.
#define ATTR_c Select based upon the checkpoint interval.
#define ATTR_e Select (E) based upon the name of the standard error file.
#define ATTR_g Select (E) based upon the list of group names under which the job may execute.
#define ATTR_h Select (E) based upon the hold types.
#define ATTR_j Select (E) based upon the value of the join list.
#define ATTR_k Select (E) based upon the value of the keep files list.
#define ATTR_l Select based upon the value of the resource named in
#define ATTR_m Select (E) based upon the setting of the mail points attribute.
#define ATTR_M Select (E) based upon the list of user names to which mail will be sent.
#define ATTR_N Select (E) based upon the job name.
#define ATTR_o Select (E) based upon the name of the standard output file.
#define ATTR_p Select based upon the priority of the job.
#define ATTR_q Select based upon the specified destination. Jobs selected are restricted to those residing in the named queue. If destination is the null string, the default queue at the server is assumed.
#define ATTR_r Select (E) based upon the rerunable flag.
#define ATTR_session Select based upon the session id assigned to running jobs.
#define ATTR_S Select (E) based upon the execution shell list.
#define ATTR_u Select (E) based upon the owner of the jobs.
#define ATTR_v Select (E) based upon the list of environment variables.
#define ATTR_ctime Select based upon the creation time of the job.
#define ATTR_depend Select based upon the list of job dependencies.
#define ATTR_mtime Select based upon the last modification time of the job.
#define ATTR_qtime Select based upon the time of the job was placed into the current queue.
#define ATTR_qtype Select (E) base on the type of queue in which the job resides.
#define ATTR_stagein Select based upon the list of files to be staged-in.
#define ATTR_stageout Select based upon the list of files to be staged-out.
#define ATTR_state Select based upon the state of the jobs. State is not a job attribute, but is included here to allow selection.

The member defines the operator in the logical expression:
The logical expression must evaluate as true for the job to be selected. The permissible values of are defined in pbs_ifl.h as: The attributes marked with (E) in the description above may only be selected with the equal, EQ, or not equal, NE, operators.

The full range of batch_op values is Only the relational operators are allowed in a select call, and others will be rejected by the server.

If itself is a null pointer, then no selection is done on the basis of attributes.

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_identifier in the form:

The array is allocated by pbs_selectjob via malloc(). When the array is no longer needed, the user is responsible for freeing it by a call to free(). The space for the array and the job identifier strings is malloc-ed by pbs_selectjob() as one allocation. The array of pointers starts at the address returned by malloc(), so free() will work.

The parameter, is reserved for implementation defined extensions. TORQUE 2.0.0p1 added the #define’d constant string EXECQUEONLY to only retrieve jobs in execution queues. It is not currently used by this function.


qselect(1B), pbs_alterjob(3B), and pbs_connect(3B)


When the batch request generated by pbs_selectjob() function has been completed successfully by a batch server, the routine will return a pointer to the array of job identifiers. If no jobs met the criteria, the first pointer in the array will be the null pointer.

If an error occurred, a null pointer is returned and the error is available in the global integer pbs_errno.

Search for    or go to Top of page |  Section 3 |  Main Index


Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.