drmaa2_jarray_get_jobs
- drmaa2_jarray_get_jobs(3), Returns jobs which belong to an array job.
#include "drmaa2.h"
drmaa2_j_list drmaa2_jarray_get_jobs(const drmaa2_jarray ja)
A drmaa2_jarray
is the equivalent of an Univa(R) Grid Engine(TM)
array job. It consists of several single drmaa2_j
jobs. This function returns all jobs which belong to the drmaa2_jarray
as a list of drmaa2_j
jobs. If job tasks (i.e. DRMAA2 jobs) are finsihed during the DRMAA2 application was not connected to the Univa(R) Grid Engine(TM)
master process (because the job session was closed or the application was shut-down) those jobs are not available anymore. The job objects can be used for controling the job or getting more detailed job information. Most operations on the job objects require an open DRMAA2 job or monitoring session.
Returns a list of drmaa2_j
job objects in a drmaa2_j_list
or NULL in case of an error. The newly allocated list was initialized with an appropriate callback function which frees the job object. After usage the drmaa2_j_list
must be freed with drmaa2_list_free
.
/* ... ja is the array job which was returned by drmaa2_jsession_run_bulk_jobs() ... */
if (ja != NULL) {
drmaa2_j_list jl = drmaa2_jarray_get_jobs(ja);
if (jl != NULL) {
/* ... do something with the job list ... */
long i, size;
size = drmaa2_list_size(jl);
for (i = 0; i < size; i++) {
drmaa2_j job = (drmaa2_j) drmaa2_list_get(jl, i);
/* ... do something with the job - but don't free it ...
}
/* finally free the complete job list */
drmaa2_list_free(&jl);
}
}
drmaa2_jarray_free(3), drmaa2_jarray_get_job_template(3), drmaa2_jarray_get_session_name(3), drmaa2_jarray_get_id(3), drmaa2_jsession_get_contact(3), drmaa2_jsession_get_job_array(3), drmaa2_jsession_run_job(3), drmaa2_jsession_run_bulk_jobs(3), drmaa2_jsession_wait_any_started(3), drmaa2_jsession_wait_any_terminated(3), drmaa2_open_jsession(3), drmaa2_list_get(3), drmaa2_list_size(3), drmaa2_list_free(3)
Copyright Univa Corporation 2013