drmaa2_jsession_get_session_name
- drmaa2_jsession_get_session_name(3), Returns the name of a job session.
#include "drmaa2.h"
drmaa2_string drmaa2_jsession_get_session_name(const drmaa2_jsession jsession);
Returns the name of a DRMAA2 job session. This name can be used for opening a job session after it was closed and it can be used for destroying a job session (after the session was closed). The name is identical to the name which was used for creating the job session.
Returns a newly allocated drmaa2_string
with the name of the given job session, which must be freed after usage.
drmaa2_jsession js = drmaa2_create_jsession("mysession", NULL);
if (js == NULL) {
/* an error happend */
drmaa2_string error = drmaa2_lasterror_text();
fprintf(stderr, "Error during creation of job session with the name %s: %s\n",
"mysession", error);
drmaa2_string_free(&error);
} else {
drmaa2_string session_name = drmaa2_jsession_get_session_name(js);
fprintf(stdout, "Session name is: %s\n", session_name?session_name:"NULL");
drmaa2_string_free(&session_name);
/* close jsession */
drmaa2_jsession_close(js);
/* free jsession */
drmaa2_jsession_free(&js);
/* remove the job session from the Univa(R) Grid Engine(TM) master process */
if (drmaa2_destroy_jsession("mysession") != DRMAA2_SUCCESS) {
/* an error happend */
drmaa2_string error = drmaa2_lasterror_text();
fprintf(stderr, "Error during destruction of job session with the name %s: %s\n",
"mysession", error);
drmaa2_string_free(&error);
}
}
drmaa2_jsession_get_contact(3), drmaa2_jsession_get_job_categories(3), drmaa2_jsession_get_jobs(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_create_jsession(3), drmaa2_destroy_jsession(3)
Copyright Univa Corporation 2013