SECTION 8 Auxiliary Functions for Interpreting Wait Status Code


Functions

int drmaa_wifexited (int *exited, int stat, char *error_diagnosis, size_t error_diag_len)
int drmaa_wexitstatus (int *exit_status, int stat, char *error_diagnosis, size_t error_diag_len)
int drmaa_wifsignaled (int *signaled, int stat, char *error_diagnosis, size_t error_diag_len)
int drmaa_wtermsig (char *signal, size_t signal_len, int stat, char *error_diagnosis, size_t error_diag_len)
int drmaa_wcoredump (int *core_dumped, int stat, char *error_diagnosis, size_t error_diag_len)
int drmaa_wifaborted (int *aborted, int stat, char *error_diagnosis, size_t error_diag_len)

Function Documentation

int drmaa_wcoredump ( int *  core_dumped,
int  stat,
char *  error_diagnosis,
size_t  error_diag_len 
)

This function always returns 0 in core_dumped

Parameters:
core_dumped Always 0
stat The status code of a finished job
error_diagnosis string of characters with error related diagnosis information.
error_diag_len size of the error_diagnosis buffer.
Returns:
  • DRMAA_ERRNO_SUCCESS on success
  • DRMAA_ERRNO_NO_ACTIVE_SESSION if drmaa_init() function has not been previously called.

int drmaa_wexitstatus ( int *  exit_status,
int  stat,
char *  error_diagnosis,
size_t  error_diag_len 
)

This function returns into exit_status the exit code extracted from stat.

Parameters:
exit_status The job's exit status (equals to stat)
stat The status code of a finished job
error_diagnosis string of characters with error related diagnosis information.
error_diag_len size of the error_diagnosis buffer.
Returns:
  • DRMAA_ERRNO_SUCCESS on success
  • DRMAA_ERRNO_NO_ACTIVE_SESSION if drmaa_init() function has not been previously called.

int drmaa_wifaborted ( int *  aborted,
int  stat,
char *  error_diagnosis,
size_t  error_diag_len 
)

This function always returns 0 in aborted.

Parameters:
aborted Always 0
stat The status code of a finished job
error_diagnosis string of characters with error related diagnosis information.
error_diag_len size of the error_diagnosis buffer.
Returns:
  • DRMAA_ERRNO_SUCCESS on success
  • DRMAA_ERRNO_NO_ACTIVE_SESSION if drmaa_init() function has not been previously called.

int drmaa_wifexited ( int *  exited,
int  stat,
char *  error_diagnosis,
size_t  error_diag_len 
)

This function returns into exited a non-zero value if stat was returned for a job that terminated normally. The job exit status can be retrieved using drmaa_wexitstatus(). The exited parameter is zero if the job terminated abnormally, drmaa_wifsignaled() can be used to gather more information. NOTE: The status code is interpreted in a bash fashion

Parameters:
exited non-zero if the job has an exit status available
stat The status code of a finished job obtained with the drmaa_wait() function
error_diagnosis string of characters with error related diagnosis information.
error_diag_len size of the error_diagnosis buffer.
Returns:
  • DRMAA_ERRNO_SUCCESS on success
  • DRMAA_ERRNO_NO_ACTIVE_SESSION if drmaa_init() function has not been previously called.

int drmaa_wifsignaled ( int *  signaled,
int  stat,
char *  error_diagnosis,
size_t  error_diag_len 
)

This function evaluates into signaled a non-zero value if stat was returned for a job that terminated due to the receipt of a signal. NOTE: The status code is interpreted in a bash fashion

Parameters:
signaled non-zero if the job terminated on a signal
stat The status code of a finished job
error_diagnosis string of characters with error related diagnosis information.
error_diag_len size of the error_diagnosis buffer.
Returns:
  • DRMAA_ERRNO_SUCCESS on success
  • DRMAA_ERRNO_NO_ACTIVE_SESSION if drmaa_init() function has not been previously called.

int drmaa_wtermsig ( char *  signal,
size_t  signal_len,
int  stat,
char *  error_diagnosis,
size_t  error_diag_len 
)

This function fills signal with up to signal_len characters of the signal name that causes the termination of the job. Only signals by POSIX are returned. For non-POSIX signals, the returned name is "UNKNOWN".

Parameters:
signal The signal name
signal_len The size in characters of the signal buffer
stat The status code of a finished job
error_diagnosis string of characters with error related diagnosis information.
error_diag_len size of the error_diagnosis buffer.
Returns:
  • DRMAA_ERRNO_SUCCESS on success
  • DRMAA_ERRNO_NO_ACTIVE_SESSION if drmaa_init() function has not been previously called.