---
name: "drmaa_set_vector_attribute"
section: "3"
platform: "linux"
package: "gridengine-drmaa-dev"
version: "6.2u5-7.1"
release: "Debian 7 (Wheezy)"
platforms: ["linux"]
url: "https://new.carta.tech/drmaa_jobtemplate"
---

# drmaa\_set\_vector\_attribute(3)

Sun Grid Engine DRMAA job template handling

Part of [drmaa\_jobtemplate(3)](/drmaa_jobtemplate/3.md).

## NAME

drmaa\_allocate\_job\_template, drmaa\_delete\_job\_template, drmaa\_set\_attribute, drmaa\_get\_attribute, drmaa\_set\_vector\_attribute, drmaa\_get\_vector\_attribute, drmaa\_get\_next\_attr\_value, drmaa\_get\_num\_attr\_values, drmaa\_release\_attr\_values - Sun Grid Engine DRMAA job template handling

## SYNOPSIS

**#include "drmaa.h"**

```
int drmaa_allocate_job_template(
drmaa_job_template_t **jt,
char *error_diagnosis,
size_t error_diag_len
```

**);**

```
int drmaa_delete_job_template(
drmaa_job_template_t *jt,
char *error_diagnosis,
size_t error_diag_len
```

**);**

```
int drmaa_set_attribute(
drmaa_job_template_t *jt,
const char *name,
const char *value,
char *error_diagnosis,
size_t error_diag_len
```

**);**

```
int drmaa_get_attribute(
drmaa_job_template_t *jt,
const char *name,
char *value,
size_t value_len,
char *error_diagnosis,
size_t error_diag_len
```

**);**

```
int drmaa_set_vector_attribute(
drmaa_job_template_t *jt,
const char *name,
const char *value[],
char *error_diagnosis,
size_t error_diag_len
```

**);**

```
int drmaa_get_vector_attribute(
drmaa_job_template_t *jt,
const char *name,
drmaa_attr_values_t **values,
char *error_diagnosis,
size_t error_diag_len
```

**);**

```
int drmaa_get_next_attr_value(
drmaa_attr_values_t* values,
char *value,
int value_len
```

**);**

```
int drmaa_get_num_attr_values(
drmaa_attr_values_t* values,
int *size
```

**);**

```
void drmaa_release_attr_values(
drmaa_attr_values_t* values
```

**);**

```

```

## DESCRIPTION

**The drmaa\_allocate\_job\_template() function allocates a new DRMAA job template** **into** *jt***. DRMAA job templates describe specifics of jobs that are submitted** **using** [*drmaa\_run\_job*(3)](/drmaa_run_job/3.md) and  [*drmaa\_run\_bulk\_jobs*(3)](/drmaa_run_bulk_jobs/3.md).

### drmaa\_delete\_job\_template()

The drmaa\_delete\_job\_template() function releases all resources associated  with the DRMAA job template *jt*. Jobs that were submitted using the job  template are not affected.

### drmaa\_set\_attribute()

The drmaa\_set\_attribute() function stores the *value* under *name*  for the given DRMAA job template, *jt* . Only non-vector attributes may be passed.

### drmaa\_get\_attribute()

The drmaa\_get\_attribute() function returns into *value* up to *value\_len*  bytes from the string stored for the non-vector attribute, *name*, in the DRMAA job template, *jt*.

### drmaa\_set\_vector\_attribute()

The drmaa\_set\_vector\_attribute() function stores the strings in *value* under  *name* in the list of vector attributes for the given DRMAA job template,  *jt* . Only vector attributes may be passed. The *value* pointer array  must be *NULL* terminated.

### drmaa\_get\_vector\_attribute()

The drmaa\_get\_vector\_attribute() function returns into *values* a DRMAA attribute  string vector containing all string values stored in the vector attribute, *name*.  The values in the DRMAA values string vector can be extracted using  [*drmaa\_get\_next\_attr\_value*(3)](/drmaa_get_next_attr_value/3.md). The caller is responsible for releasing the DRMAA values string  vector returned into *values* using  [*drmaa\_release\_attr\_values*(3)](/drmaa_release_attr_values/3.md).

### drmaa\_get\_next\_attr\_value()

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

### drmaa\_get\_num\_attr\_values()

The drmaa\_get\_num\_attr\_values() returns into *size* the number of entries in the DRMAA values string vector.  This function is only available in the 1.0 implementation.

### drmaa\_release\_attr\_values()

The drmaa\_release\_attr\_values() function releases all resources associated with the DRMAA values string vector, *values*.

## ENVIRONMENTAL VARIABLES

- **SGE\_ROOT**

  Specifies the location of the Sun Grid Engine standard configuration files.

- **SGE\_CELL**

  If set, specifies the default Sun Grid Engine cell to be used. To address a Sun Grid Engine cell Sun 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.

## RETURN VALUES

Upon successful completion, drmaa\_allocate\_job\_template(), drmaa\_delete\_job\_template(), drmaa\_set\_attribute(), drmaa\_get\_attribute(), drmaa\_set\_vector\_attribute(),  drmaa\_get\_vector\_attribute(), and drmaa\_get\_next\_attr\_value()  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\_allocate\_job\_template(), drmaa\_delete\_job\_template(), drmaa\_set\_attribute(), drmaa\_get\_attribute(), drmaa\_set\_vector\_attribute(),  drmaa\_get\_vector\_attribute(), and drmaa\_get\_next\_attr\_value()  functions will fail if:

### 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\_set\_attribute() and drmaa\_set\_vector\_attribute() will fail if:

### DRMAA\_ERRNO\_INVALID\_ATTRIBUTE\_FORMAT

The format for the attribute value is invalid.

### DRMAA\_ERRNO\_INVALID\_ATTRIBUTE\_VALUE

The value for the attribute is invalid.

### DRMAA\_ERRNO\_CONFLICTING\_ATTRIBUTE\_VALUES

The value of this attribute is conflicting with a previously set attributes.

The drmaa\_get\_attribute() and drmaa\_get\_vector\_attribute() will fail if:

### DRMAA\_ERRNO\_INVALID\_ATTRIBUTE\_VALUE

The specified attribute is not set in the DRMAA job template.

The drmaa\_get\_next\_attr\_value() will fail if:

### DRMAA\_ERRNO\_INVALID\_ATTRIBUTE\_VALUE

When there are no more entries in the vector.

## SEE ALSO

[*drmaa\_submit*(3)](/drmaa_submit/3.md)and [*drmaa\_attributes*(3)](/drmaa_attributes/3.md).
