drmaa_jobcontrol(3)
π drmaa_jobcontrol(3) π
okay bestie, welcome to the Grid Engine DRMAA corner of the manual β this is drmaa_jobcontrol, page 3 of the Grid Engine DRMAA section, and it's literally the page where you learn to monitor and control your jobs. group chat energy, but make it Unix. π¦
β¨ NAME β¨
drmaa_job_ps, drmaa_control β monitor and control jobs, bestie. that's the whole job description. π
πΈ SYNOPSIS πΈ
#include "drmaa.h"
int drmaa_job_ps(
const char *job_id,
int *remote_ps,
char *error_diagnosis,
size_t error_diag_len
);
int drmaa_control(
const char *jobid,
int action,
char *error_diagnosis,
size_t error_diag_len
);
π DESCRIPTION π
so drmaa_job_ps() is the vibe-check function. it takes your Grid Engine job job_id and drops its status into the integer that remote_ps points at. the possible return values are right here, no cap:
DRMAA_PS_UNDETERMINEDβ job status cannot be determined (mystery era π)DRMAA_PS_QUEUED_ACTIVEβ job is queued and activeDRMAA_PS_SYSTEM_ON_HOLDβ job is queued and in system holdDRMAA_PS_USER_ON_HOLDβ job is queued and in user holdDRMAA_PS_USER_SYSTEM_ON_HOLDβ job is queued and in user and system holdDRMAA_PS_RUNNINGβ job is running (main character energy π₯)DRMAA_PS_SYSTEM_SUSPENDEDβ job is system suspendedDRMAA_PS_USER_SUSPENDEDβ job is user suspendedDRMAA_PS_DONEβ job finished normally (ate, no crumbs β¨)DRMAA_PS_FAILEDβ job finished, but failed (it's giving tragedy π)
want the receipts on how those line up with actual Grid Engine statuses? check sge_status(5). iykyk.
jobs' user hold and user suspend states can be controlled via drmaa_control(3). but for touching system hold and system suspend states? nope, not here β you gotta use the appropriate Grid Engine interfaces for that. π
π drmaa_control() π
drmaa_control() applies control operations on Grid Engine jobs. the jobid can be either a Grid Engine jobid, or DRMAA_JOB_IDS_SESSION_ALL to refer to all jobs submitted during the DRMAA session opened using drmaa_init(3). the way that's a whole-session vibe. π
legal values for action and their meanings:
DRMAA_CONTROL_SUSPENDβ suspend the jobDRMAA_CONTROL_RESUMEβ resume the jobDRMAA_CONTROL_HOLDβ put the job on-holdDRMAA_CONTROL_RELEASEβ release the hold on the jobDRMAA_CONTROL_TERMINATEβ kill the job π
the DRMAA suspend/resume operations are equivalent to using the -sj jobid and -usj jobid options with Grid Engine qmod(1). the DRMAA hold/release operations are equivalent to using Grid Engine qhold(1) and qrls(1). the DRMAA terminate operation is equivalent to using Grid Engine qdel(1). and only user hold and user suspend can be controlled via drmaa_control(3) β for affecting system hold and system suspend states, the appropriate Grid Engine interfaces must be used. that part is not a suggestion, bestie, it's a boundary. π«Ά
π ENVIRONMENTAL VARIABLES π
SGE_ROOTβ specifies the location of the Grid Engine standard configuration files.SGE_CELLβ if set, specifies the default Grid Engine cell to be used. to address a Grid Engine cell, Grid Engine uses (in the order of precedence):- the name of the cell specified in the environment variable
SGE_CELL, if it is set. - the name of the default cell, i.e.
default.
- the name of the cell specified in the environment variable
SGE_DEBUG_LEVELβ if set, specifies that debug information should be written to stderr. in addition, the level of detail in which debug information is generated is defined.SGE_QMASTER_PORTβ if set, specifies the tcp port on whichsge_qmaster(8)is expected to listen for communication requests. most installations will use a services map entry instead to define that port.
β RETURN VALUES β
upon successful completion, drmaa_job_ps() and drmaa_control() return DRMAA_ERRNO_SUCCESS. any other value means an error happened, bestie. in that case, up to error_diag_len characters of error-related diagnosis information get dropped into the buffer error_diagnosis. π©Ή
π ERRORS π
drmaa_job_ps() and drmaa_control() may fail with:
DRMAA_ERRNO_INTERNAL_ERRORβ unexpected or internal DRMAA error, like system call failure, etc. (the classic "idk what happened either" moment π)DRMAA_ERRNO_DRM_COMMUNICATION_FAILUREβ could not contact DRM system for this request.DRMAA_ERRNO_AUTH_FAILUREβ the specified request was not processed successfully due to authorization failure. (you're not on the list, bestie π)DRMAA_ERRNO_INVALID_ARGUMENTβ the input value for an argument is invalid.DRMAA_ERRNO_NO_ACTIVE_SESSIONβ failed because there is no active session.DRMAA_ERRNO_NO_MEMORYβ failed allocating memory.DRMAA_ERRNO_INVALID_JOBβ the specified job does not exist. (ghosted by your own job π)
and drmaa_control() may fail with these extra ones:
DRMAA_ERRNO_RESUME_INCONSISTENT_STATEβ the job is not suspended. the resume request will not be processed.DRMAA_ERRNO_SUSPEND_INCONSISTENT_STATEβ the job is not running and thus cannot be suspended.DRMAA_ERRNO_HOLD_INCONSISTENT_STATEβ the job cannot be moved to a hold state.DRMAA_ERRNO_RELEASE_INCONSISTENT_STATEβ the job is not in a hold state.
ngl, "inconsistent state" errors are just the DRM system saying "bestie, that's not where the job is at rn." read the state, then act. periodt. π
π SEE ALSO π
drmaa_submit(3), drmaa_wait(3), sge_status(5).
and that's the page, bestie!! π this one came from SGE 8.1.3pre, dated $Date: 2009-06-17 09:50:13 $ β yes it's old, yes it still slays, go monitor those jobs. πβ¨π¦
π¦ where this page comes from
- debian bookworm: gridengine-drmaa-dev 8.1.9+dfsg-10+b1 Β· SISSL
- debian trixie: gridengine-drmaa-dev 8.1.9+dfsg-13.1 Β· SISSL
- ubuntu jammy: gridengine-drmaa-dev 8.1.9+dfsg-10build1 Β· SISSL
- ubuntu noble: gridengine-drmaa-dev 8.1.9+dfsg-11build3 Β· SISSL
- ubuntu questing: gridengine-drmaa-dev 8.1.9+dfsg-13.1
- ubuntu resolute: gridengine-drmaa-dev 8.1.9+dfsg-13.2 Β· SISSL
- ubuntu stonking: gridengine-drmaa-dev 8.1.9+dfsg-13.2ubuntu1 Β· SISSL
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms