---
name: "drmaa_submit"
section: "3"
platform: "linux"
package: "gridengine-drmaa-dev"
version: "8.1.9+dfsg-13.1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/drmaa_submit"
---

# drmaa\_submit(3)

Job submission

## NAME

drmaa\_run\_job, drmaa\_run\_bulk\_jobs, drmaa\_get\_next\_job\_id, drmaa\_get\_num\_job\_ids, drmaa\_release\_job\_ids - Job submission

## SYNOPSIS

**#include "drmaa.h"**

```
int drmaa_run_job(
char *job_id,
size_t job_id_len,
drmaa_job_template_t *jt,
char *error_diagnosis,
size_t error_diag_len
```

**);**

```
int drmaa_run_bulk_jobs(
drmaa_job_ids_t **jobids,
drmaa_job_template_t *jt,
int start,
int end,
int incr,
char *error_diagnosis,
size_t error_diag_len
```

**);**

```
int drmaa_get_next_job_id(
drmaa_job_ids_t *values,
char *value,
int value_len
```

**);**

```
int drmaa_get_num_job_ids(
drmaa_job_ids_t *values,
int *size
```

**);**

```
void drmaa_release_job_ids(
drmaa_job_ids_t *values
```

**);**

## DESCRIPTION

**drmaa\_run\_job() submits an Grid Engine job with attributes defined in** **the DRMAA job template** *jt***. On success up to** *job\_id\_len* **bytes of the job identifier are returned into the buffer,** *job\_id***.  Note the effect of the** **SGE\_DRMAA\_ALLOW\_JOB\_ERROR\_STATE environment variable, as below.**

### drmaa\_run\_bulk\_jobs()

**The drmaa\_run\_bulk\_jobs() submits a Grid Engine array job very much as if the** [*qsub*(1)](/qsub/1.md) option \`-t *start*-*end*:*incr*' had been used along with the additional attributes defined in the DRMAA job  template, *jt*.  The same constraints regarding value ranges are also in effect for the parameters *start*, *end*, and *incr* as for *qsub*(5) -t. On success a DRMAA job id string vector containing job identifiers for each array job task is returned into *jobids*.  The job identifiers in the job id string vector can be extracted using [*drmaa\_get\_next\_job\_id*(3)](/drmaa_get_next_job_id/3.md). The number of identifiers in the job id string vector can be determined using [*drmaa\_get\_num\_job\_ids*(3)](/drmaa_get_num_job_ids/3.md). Note that this function is only available in the 1.0 implementation. The caller is responsible for releasing the job id string vector returned into *jobids* using [*drmaa\_release\_job\_ids*(3)](/drmaa_release_job_ids/3.md).

### drmaa\_get\_next\_job\_id()

Each time drmaa\_get\_next\_job\_id() is called it returns into the buffer, *value*, up to *value\_len*  bytes of the next entry stored in the DRMAA job id string vector, *values*. Once the job ids list has been exhausted, DRMAA\_ERRNO\_NO\_MORE\_ELEMENTS is returned.

### drmaa\_get\_num\_job\_ids()

The drmaa\_get\_num\_job\_ids() returns into *size* the number of entries in the DRMAA job ids string vector.  This function is only available in the 1.0 implementation.

### drmaa\_release\_job\_ids()

The drmaa\_release\_attr\_job\_id() function releases all resources associated with the DRMAA job id string vector, *values*. This operation has no effect on the actual Grid Engine array job  tasks.

## ENVIRONMENTAL VARIABLES

- **SGE\_ROOT**

  Specifies the location of the Grid Engine standard configuration files.

- **SGE\_CELL**

  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. **default**.

- **SGE\_DEBUG\_LEVEL**

  If set, specifies that debug information should be written to stderr. In addition the level of detail in which debug information is generated is defined.

- **SGE\_QMASTER\_PORT**

  If set, specifies the tcp port on which [*sge\_qmaster*(8)](/sge_qmaster/8.md) is expected to listen for communication requests. Most installations will use a services map entry instead to define that port.

- **SGE\_DRMAA\_ALLOW\_JOB\_ERROR\_STATE**

  If set, in case of job errors the job will enter the error state.  By default DRMAA jobs are not allowed to enter the job error state since an error state does not exist in DRMAA, so jobs with, say, a wrong input path specification, must fail when doing drmaa\_wait().

## RETURN VALUES

Upon successful completion, drmaa\_run\_job(), drmaa\_run\_bulk\_jobs(), and drmaa\_get\_next\_job\_id() return DRMAA\_ERRNO\_SUCCESS. Other values indicate an error. Up to *error\_diag\_len* characters of error related diagnosis  information is then provided in the buffer *error\_diagnosis*.

## ERRORS

The drmaa\_run\_job(), drmaa\_run\_bulk\_jobs(), and drmaa\_get\_next\_job\_id() functions can fail with:

- **DRMAA\_ERRNO\_INTERNAL\_ERROR**

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

- **DRMAA\_ERRNO\_DRM\_COMMUNICATION\_FAILURE**

  Could not contact DRM system for this request.

- **DRMAA\_ERRNO\_AUTH\_FAILURE**

  The specified request is not processed successfully due to authorization failure.

- **DRMAA\_ERRNO\_INVALID\_ARGUMENT**

  The input value for an argument is invalid.

- **DRMAA\_ERRNO\_NO\_ACTIVE\_SESSION**

  Failed because there is no active session.

- **DRMAA\_ERRNO\_NO\_MEMORY**

  Failed allocating memory.

The drmaa\_run\_job() and drmaa\_run\_bulk\_jobs() functions can fail with:

- **DRMAA\_ERRNO\_TRY\_LATER**

  The DRM system indicated that it is too busy to accept the job. A retry may succeed, however.

- **DRMAA\_ERRNO\_DENIED\_BY\_DRM**

  The DRM system rejected the job. The job will never be accepted due to DRM configuration or job template settings.

The drmaa\_get\_next\_job\_id() function can fail with:

- **DRMAA\_ERRNO\_INVALID\_ATTRIBUTE\_VALUE**

  When there are no more entries in the vector.

## SEE ALSO

[*drmaa\_attributes*(3)](/drmaa_attributes/3.md), [*drmaa\_jobtemplate*(3)](/drmaa_jobtemplate/3.md).
