drmaa2_close_jsession
- drmaa2_close_jsession, Closes a DRMAA2 job session.
#include "drmaa2.h"
drmaa2_error drmaa2_close_jsession(drmaa2_jsession jsession);
Closes a job session. Closing means that jobs submitted within this session can not be used / controlled / queried anymore. Most drmaa2_jsession function calles will fail. No further reports of jobs belonging to the job session are sent from the Univa(R) Grid Engine(TM) master process to the DRMAA2 application. If no more job session or monitoring session is open the DRMAA2 application is disconnected from the Univa(R) Grid Engine(TM) master process. After closing the job session the job session object must be freed by the drmaa2_jsession_free(3) call.
Returns a drmaa2_error
value. In case of success DRMAA2_SUCCESS is returned otherwise the error value which indicates the error. In case of an error a more detailed error description is set for the calling thread. This description can be fetched with the drmaa2_lasterror_text(3) function.
/* "unique_jsession" must exist on Univa(R) Grid Engine(TM) master process */
drmaa2_jsession js = drmaa2_open_jsession("unique_jsession");
if (js != NULL) {
/* do something with the job session */
drmaa2_j_list jobs = drmaa2_jsession_get_jobs(js, NULL);
/* process jobs and free list ... */
...
if (DRMAA2_SUCCESS != drmaa2_close_jsession(ms)) {
drmaa2_string error = drmaa2_lasterror_text();
fprintf(stderr, "Error during closing the job session: %s\n", error);
drmaa2_string_free(&error);
}
drmaa2_jsession_free(&ms);
}
drmaa2_open_jsession(3), drmaa2_destroy_jsession(3), drmaa2_create_jsession(3), drmaa2_jsession_free(3), drmaa2_jsession_get_jobs(3), drmaa_jsession_get_job_categories(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_jsession_get_contact(3), drmaa2_jsession_get_session_name(3), drmaa2_jsession_get_job_array(3)
Copyright Univa Corporation 2013