drmaa_session(3)               Grid Engine DRMAA              drmaa_session(3)



NNAAMMEE
       drmaa_init, drmaa_exit - Start/finish Grid Engine DRMAA session


SSYYNNOOPPSSIISS
       ##iinncclluuddee ""ddrrmmaaaa..hh""

       iinntt ddrrmmaaaa__iinniitt((
              ccoonnsstt cchhaarr **ccoonnttaacctt,,
              cchhaarr **eerrrroorr__ddiiaaggnnoossiiss,,
              ssiizzee__tt eerrrroorr__ddiiaagg__lleenn
       ));;

       iinntt ddrrmmaaaa__eexxiitt((
              cchhaarr **eerrrroorr__ddiiaaggnnoossiiss,,
              ssiizzee__tt eerrrroorr__ddiiaagg__lleenn
       ));;


DDEESSCCRRIIPPTTIIOONN
   ddrrmmaaaa__iinniitt(())
       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
       _d_r_m_a_a___v_e_r_s_i_o_n(3), _d_r_m_a_a___g_e_t___D_R_M___s_y_s_t_e_m(3),  and  _d_r_m_a_a___g_e_t___D_R_M_A_A___i_m_p_l_e_-
       _m_e_n_t_a_t_i_o_n(3).   Except  for  the above listed functions, no DRMAA func-
       tions may be called before the drmaa_init()  function  _c_o_m_p_l_e_t_e_s.   Any
       DRMAA  function  which  is called before the drmaa_init() function com-
       pletes will return a DRMAA_ERRNO_NO_ACTIVE_SESSION error.   _C_o_n_t_a_c_t  is
       an  implementation  dependent string which may be used to specify which
       Grid Engine cell to use. If _c_o_n_t_a_c_t is NULL, the  default  Grid  Engine
       cell  will be used. In the 1.0 implementation _c_o_n_t_a_c_t may have the fol-
       lowing value: _s_e_s_s_i_o_n_=_<_s_e_s_s_i_o_n___i_d_>.  To determine the  session_id,  the
       _d_r_m_a_a___g_e_t___c_o_n_t_a_c_t(3)  function  should  be called after the session has
       already been initialized.  By passing the  _s_e_s_s_i_o_n_=_<_s_e_s_s_i_o_n___i_d_>  string
       to  the drmaa_init() function, instead of creating a new session, DRMAA
       will attempt to reconnect to the session indicated by  the  _s_e_s_s_i_o_n___i_d.
       The  result of reconnecting to a previous session is that all jobs pre-
       viously submitted in that session tthhaatt aarree ssttiillll rruunnnniinngg will 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.

       In the 0.95 implementation, setting _c_o_n_t_a_c_t has no effect.


   ddrrmmaaaa__eexxiitt(())
       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  _d_r_m_a_a___i_n_i_t(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   _q_m_a_s_t_e_r(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.


EENNVVIIRROONNMMEENNTTAALL VVAARRIIAABBLLEESS
       SSGGEE__RROOOOTT       Specifies  the location of the Grid Engine standard con-
                      figuration files.

       SSGGEE__CCEELLLL       If 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 SGE_CELL, if it is set.

                             The name of the default cell, i.e. ddeeffaauulltt.


       SSGGEE__DDEEBBUUGG__LLEEVVEELL
                      If 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.

       SSGGEE__QQMMAASSTTEERR__PPOORRTT
                      If  set, specifies the tcp port on which the sge_qmaster
                      is expected to listen for communication requests.   Most
                      installations  will  use a services map entry instead to
                      define that port.

RREETTUURRNN VVAALLUUEESS
       Upon  successful  completion,  drmaa_init()  and  drmaa_exit()   return
       DRMAA_ERRNO_SUCCESS.    Other   values   indicate   an  error.   Up  to
       _e_r_r_o_r___d_i_a_g___l_e_n characters of error  related  diagnosis  information  is
       then provided in the buffer _e_r_r_o_r___d_i_a_g_n_o_s_i_s.


EERRRROORRSS
       The drmaa_init() and drmaa_exit() functions will fail if:

   DDRRMMAAAA__EERRRRNNOO__IINNTTEERRNNAALL__EERRRROORR
       Unexpected or internal DRMAA error, like system call failure, etc.

   DDRRMMAAAA__EERRRRNNOO__DDRRMM__CCOOMMMMUUNNIICCAATTIIOONN__FFAAIILLUURREE
       Could not contact DRM system for this request.

   DDRRMMAAAA__EERRRRNNOO__AAUUTTHH__FFAAIILLUURREE
       The  specified  request is not processed successfully due to authoriza-
       tion failure.

   DDRRMMAAAA__EERRRRNNOO__IINNVVAALLIIDD__AARRGGUUMMEENNTT
       The input value for an argument is invalid.

       The drmaa_init() will fail if:

   DDRRMMAAAA__EERRRRNNOO__IINNVVAALLIIDD__CCOONNTTAACCTT__SSTTRRIINNGG
       Initialization failed due to invalid contact string.

   DDRRMMAAAA__EERRRRNNOO__DDEEFFAAUULLTT__CCOONNTTAACCTT__SSTTRRIINNGG__EERRRROORR
       Could not use the default contact string to connect to DRM system.

   DDRRMMAAAA__EERRRRNNOO__DDRRMMSS__IINNIITT__FFAAIILLEEDD
       Initialization failed due to failure to init DRM system.

   DDRRMMAAAA__EERRRRNNOO__AALLRREEAADDYY__AACCTTIIVVEE__SSEESSSSIIOONN
       Initialization failed due to existing DRMAA session.

   DDRRMMAAAA__EERRRRNNOO__NNOO__MMEEMMOORRYY
       Failed allocating memory.

       The drmaa_exit() will fail if:

   DDRRMMAAAA__EERRRRNNOO__NNOO__AACCTTIIVVEE__SSEESSSSIIOONN
       Failed because there is no active session.

   DDRRMMAAAA__EERRRRNNOO__DDRRMMSS__EEXXIITT__EERRRROORR
       DRM system disengagement failed.


SSEEEE AALLSSOO
       _d_r_m_a_a___s_u_b_m_i_t(3).



GE 6.1                   $Date: 2006/03/01 22:05:53 $         drmaa_session(3)
