drmaa_session(3)               Grid Engine DRMAA              drmaa_session(3)



[1mNAME[0m
       drmaa_init, drmaa_exit - Start/finish Grid Engine DRMAA session


[1mSYNOPSIS[0m
       [1m#include "drmaa.h"[0m

       [1mint drmaa_init([0m
              [1mconst char *contact,[0m
              [1mchar *error_diagnosis,[0m
              [1msize_t error_diag_len[0m
       [1m);[0m

       [1mint drmaa_exit([0m
              [1mchar *error_diagnosis,[0m
              [1msize_t error_diag_len[0m
       [1m);[0m


[1mDESCRIPTION[0m
   [1mdrmaa_init()[0m
       The drmaa_init() function initializes the Grid Engine DRMAA API library
       for all threads of the process and creates a new  DRMAA  session.  This
       routine  must  be  called  once before any other DRMAA call, except for
       [4mdrmaa_version[24m(3), [4mdrmaa_get_DRM_system[24m(3),  and  [4mdrmaa_get_DRMAA_imple-[0m
       [4mmentation[24m(3).   Except  for  the above listed functions, no DRMAA func-
       tions may be called before the drmaa_init()  function  [4mcompletes[24m.   Any
       DRMAA  function  which  is called before the drmaa_init() function com-
       pletes will return a DRMAA_ERRNO_NO_ACTIVE_SESSION error.   [4mContact[24m  is
       an  implementation  dependent string which may be used to specify which
       Grid Engine cell to use. If [4mcontact[24m is NULL, the  default  Grid  Engine
       cell  will be used. In the 1.0 implementation [4mcontact[24m may have the fol-
       lowing value: [4msession=<session_id>[24m.  To determine the  session_id,  the
       [4mdrmaa_get_contact[24m(3)  function  should  be called after the session has
       already been initialized.  By passing the  [4msession=<session_id>[24m  string
       to  the drmaa_init() function, instead of creating a new session, DRMAA
       will attempt to reconnect to the session indicated by  the  [4msession_id[24m.
       The  result of reconnecting to a previous session is that all jobs pre-
       viously submitted in that session [1mthat are still running [22mwill be avail-
       able in the DRMAA session.  Note, however, that jobs which ended before
       the call to drmaa_init() may not be available or may have no associated
       exit information or resource usage data.


   [1mdrmaa_exit()[0m
       The  drmaa_exit() function closes the DRMAA session for all threads and
       must be called before process termination.  The  drmaa_exit()  function
       may  be called only once by a single thread in the process and may only
       be called after the drmaa_init() function  has  completed.   Any  DRMAA
       function,   other   than  [4mdrmaa_init[24m(3),  which  is  called  after  the
       drmaa_exit()      function      completes      will      return       a
       DRMAA_ERRNO_NO_ACTIVE_SESSION error.

       The  drmaa_exit() function does necessary clean up of the DRMAA session
       state,  including  unregistering   from   the   [4mqmaster[24m(8).    If   the
       drmaa_exit()  function is not called, the qmaster will store events for
       the DRMAA client until the connection times out, causing extra work for
       the qmaster and consuming system resources.

       Submitted jobs are not affected by the drmaa_exit() function.


[1mENVIRONMENTAL VARIABLES[0m
       [1mGE_ROOT        [22mSpecifies  the location of the Grid Engine standard con-
                      figuration files.

       [1mGE_CELL        [22mIf set, specifies the default Grid  Engine  cell  to  be
                      used. To address a Grid Engine cell Grid Engine uses (in
                      the order of precedence):

                             The name of the cell specified in the environment
                             variable GE_CELL, if it is set.

                             The name of the default cell, i.e. [1mdefault[22m.


       [1mGE_DEBUG_LEVEL [22mIf set, specifies that debug information should be writ-
                      ten to stderr. In addition the level of detail in  which
                      debug information is generated is defined.

       [1mGE_QMASTER_PORT[0m
                      If  set,  specifies the tcp port on which the ge_qmaster
                      is expected to listen for communication requests.   Most
                      installations  will  use a services map entry instead to
                      define that port.

[1mRETURN VALUES[0m
       Upon  successful  completion,  drmaa_init()  and  drmaa_exit()   return
       DRMAA_ERRNO_SUCCESS.    Other   values   indicate   an  error.   Up  to
       [4merror_diag_len[24m characters of error  related  diagnosis  information  is
       then provided in the buffer [4merror_diagnosis[24m.


[1mERRORS[0m
       The drmaa_init() and drmaa_exit() functions will fail if:

   [1mDRMAA_ERRNO_INTERNAL_ERROR[0m
       Unexpected or internal DRMAA error, like system call failure, etc.

   [1mDRMAA_ERRNO_DRM_COMMUNICATION_FAILURE[0m
       Could not contact DRM system for this request.

   [1mDRMAA_ERRNO_AUTH_FAILURE[0m
       The  specified  request is not processed successfully due to authoriza-
       tion failure.

   [1mDRMAA_ERRNO_INVALID_ARGUMENT[0m
       The input value for an argument is invalid.

       The drmaa_init() will fail if:

   [1mDRMAA_ERRNO_INVALID_CONTACT_STRING[0m
       Initialization failed due to invalid contact string.

   [1mDRMAA_ERRNO_DEFAULT_CONTACT_STRING_ERROR[0m
       Could not use the default contact string to connect to DRM system.

   [1mDRMAA_ERRNO_DRMS_INIT_FAILED[0m
       Initialization failed due to failure to init DRM system.

   [1mDRMAA_ERRNO_ALREADY_ACTIVE_SESSION[0m
       Initialization failed due to existing DRMAA session.

   [1mDRMAA_ERRNO_NO_MEMORY[0m
       Failed allocating memory.

       The drmaa_exit() will fail if:

   [1mDRMAA_ERRNO_NO_ACTIVE_SESSION[0m
       Failed because there is no active session.

   [1mDRMAA_ERRNO_DRMS_EXIT_ERROR[0m
       DRM system disengagement failed.


[1mSEE ALSO[0m
       [4mdrmaa_submit[24m(3).



GE 6.2u2                 $Date: 2008/07/08 09:10:04 $         drmaa_session(3)
