1drmaa_session(3)               Grid Engine DRMAA              drmaa_session(3)
2
3
4

NAME

6       drmaa_init, drmaa_exit - Start/finish Grid Engine DRMAA session
7

SYNOPSIS

9       #include "drmaa.h"
10
11       int drmaa_init(
12              const char *contact,
13              char *error_diagnosis,
14              size_t error_diag_len
15       );
16
17       int drmaa_exit(
18              char *error_diagnosis,
19              size_t error_diag_len
20       );
21

DESCRIPTION

23   drmaa_init()
24       The drmaa_init() function initializes the Grid Engine DRMAA API library
25       for all threads of the process and creates a new  DRMAA  session.  This
26       routine  must  be  called  once before any other DRMAA call, except for
27       drmaa_version(3), drmaa_get_DRM_system(3),  and  drmaa_get_DRMAA_imple‐
28       mentation(3).   Except  for  the above listed functions, no DRMAA func‐
29       tions may be called before the drmaa_init()  function  completes.   Any
30       DRMAA  function  which  is called before the drmaa_init() function com‐
31       pletes will return a DRMAA_ERRNO_NO_ACTIVE_SESSION error.   Contact  is
32       an  implementation  dependent string which may be used to specify which
33       Grid Engine cell to use. If contact is NULL, the  default  Grid  Engine
34       cell  will be used. In the 1.0 implementation contact may have the fol‐
35       lowing value: session=<session_id>.  To determine the  session_id,  the
36       drmaa_get_contact(3)  function  should  be called after the session has
37       already been initialized.  By passing the  session=<session_id>  string
38       to  the drmaa_init() function, instead of creating a new session, DRMAA
39       will attempt to reconnect to the session indicated by  the  session_id.
40       The  result of reconnecting to a previous session is that all jobs pre‐
41       viously submitted in that session that are still running will be avail‐
42       able in the DRMAA session.  Note, however, that jobs which ended before
43       the call to drmaa_init() may not be available or may have no associated
44       exit information or resource usage data.
45
46       In the 0.95 implementation, setting contact has no effect.
47
48   drmaa_exit()
49       The  drmaa_exit() function closes the DRMAA session for all threads and
50       must be called before process termination.  The  drmaa_exit()  function
51       may  be called only once by a single thread in the process and may only
52       be called after the drmaa_init() function  has  completed.   Any  DRMAA
53       function,   other   than  drmaa_init(3),  which  is  called  after  the
54       drmaa_exit()      function      completes      will      return       a
55       DRMAA_ERRNO_NO_ACTIVE_SESSION error.
56
57       The  drmaa_exit() function does necessary clean up of the DRMAA session
58       state,  including  unregistering   from   the   qmaster(8).    If   the
59       drmaa_exit()  function is not called, the qmaster will store events for
60       the DRMAA client until the connection times out, causing extra work for
61       the qmaster and consuming system resources.
62
63       Submitted jobs are not affected by the drmaa_exit() function.
64

ENVIRONMENTAL VARIABLES

66       SGE_ROOT       Specifies  the location of the Grid Engine standard con‐
67                      figuration files.
68
69       SGE_CELL       If set, specifies the default Grid  Engine  cell  to  be
70                      used. To address a Grid Engine cell Grid Engine uses (in
71                      the order of precedence):
72
73                             The name of the cell specified in the environment
74                             variable SGE_CELL, if it is set.
75
76                             The name of the default cell, i.e. default.
77
78
79       SGE_DEBUG_LEVEL
80                      If set, specifies that debug information should be writ‐
81                      ten to stderr. In addition the level of detail in  which
82                      debug information is generated is defined.
83
84       SGE_QMASTER_PORT
85                      If  set, specifies the tcp port on which the sge_qmaster
86                      is expected to listen for communication requests.   Most
87                      installations  will  use a services map entry instead to
88                      define that port.
89

RETURN VALUES

91       Upon  successful  completion,  drmaa_init()  and  drmaa_exit()   return
92       DRMAA_ERRNO_SUCCESS.    Other   values   indicate   an  error.   Up  to
93       error_diag_len characters of error  related  diagnosis  information  is
94       then provided in the buffer error_diagnosis.
95

ERRORS

97       The drmaa_init() and drmaa_exit() functions will fail if:
98
99   DRMAA_ERRNO_INTERNAL_ERROR
100       Unexpected or internal DRMAA error, like system call failure, etc.
101
102   DRMAA_ERRNO_DRM_COMMUNICATION_FAILURE
103       Could not contact DRM system for this request.
104
105   DRMAA_ERRNO_AUTH_FAILURE
106       The  specified  request is not processed successfully due to authoriza‐
107       tion failure.
108
109   DRMAA_ERRNO_INVALID_ARGUMENT
110       The input value for an argument is invalid.
111
112       The drmaa_init() will fail if:
113
114   DRMAA_ERRNO_INVALID_CONTACT_STRING
115       Initialization failed due to invalid contact string.
116
117   DRMAA_ERRNO_DEFAULT_CONTACT_STRING_ERROR
118       Could not use the default contact string to connect to DRM system.
119
120   DRMAA_ERRNO_DRMS_INIT_FAILED
121       Initialization failed due to failure to init DRM system.
122
123   DRMAA_ERRNO_ALREADY_ACTIVE_SESSION
124       Initialization failed due to existing DRMAA session.
125
126   DRMAA_ERRNO_NO_MEMORY
127       Failed allocating memory.
128
129       The drmaa_exit() will fail if:
130
131   DRMAA_ERRNO_NO_ACTIVE_SESSION
132       Failed because there is no active session.
133
134   DRMAA_ERRNO_DRMS_EXIT_ERROR
135       DRM system disengagement failed.
136

SEE ALSO

138       drmaa_submit(3).
139
140
141
142GE 6.1                   $Date: 2006/03/01 22:05:53 $         drmaa_session(3)
Impressum