1. drmaa2_open_jsession(3)
  2. DRMAA2
  3. drmaa2_open_jsession(3)

NAME

drmaa2_open_jsession - drmaa2_open_jsession, Opens a DRMAA2 job session.

SYNOPSIS

#include "drmaa2.h"

drmaa2_jsession drmaa2_open_jsession(const char* session_name);

DESCRIPTION

Opens a DRMAA2 job session with a specific name. The job session must exist on the Univa(R) Grid Engine(TM) master process. A job session can be created by the drmaa2_create_jsession(3) function or by qconf(3) commands on command line. The session name argument must not be NULL. In case of success a connection is established to the Univa(R) Grid Engine(TM) master process. If there is already a connection (because the process has already other job sessions or a monitoring session open) the existing connection to the master process is shared, but additionally events relating to jobs in this job session are subscribed from the master process. The session needs to be closed and freed when it is not going to be used anymore in order to reduce the network traffic or close the connection to the master process completely (if the sesssion is the last open session).

A DRMAA2 job session is used for submitting jobs, monitoring and controling jobs. Operations on jobs can only be performed when the job session they belong to is open.

RETURN VALUES

Returns a newly allocated drmaa2_jsession object in case of success. This object is going to be used in further job session related function calls. The session object needs to be freed with drmaa2_jsession_free(3) after closing a job session with drmaa2_close_jsession(3). Finally the persistent job session can be removed from the master process by drmaa2_destroy_jsession(3).

In case of an error NULL is returned. The error number and error text is set in the current thread context.

EXAMPLE

/* "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);
}

SEE ALSO

drmaa2_close_jsession(3), drmaa2_destroy_jsession(3), drmaa2_jsession_free(3), drmaa2_get_jsession_names(3), drmaa2_jsession_all_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)

AUTHOR

Copyright Univa Corporation 2013

  1. Univa Corporation
  2. October 2013
  3. drmaa2_open_jsession(3)