# 6.8.13 SET MPI ROOT

Part of: [6 Language](6-language.md) › [6.8 Data Miscellaneous Language (DMISCL)](6-8-data-miscellaneous-language-dmiscl.md)

### Syntax

**SET** **MPI** **ROOT** {_root_rank_ | **DEFAULT**}

### Description

Set the MPI root process rank[^52] for gathering processed (HDF5) data by other MPI processes. In other words, after each MPI process finishes processing a subset of the data (i.e. a chunk), it sends it to the specified MPI root process rank (please refer to the section [PROCESSING](6-2-processing.md) for additional information). If using an HDFql non MPI-based distribution, an error is raised. In case the keyword DEFAULT is specified, the MPI root process rank for gathering processed data is set to zero.

### Parameter(s)

_root_rank_ – optional integer that specifies the MPI process rank to use as root for gathering processed (HDF5) data by other MPI processes. If _root_rank_ is specified, it must be between 0 and the value returned by [SHOW MPI SIZE](6-7-37-show-mpi-size.md) - 1 (otherwise an error is raised).

### Return

Nothing

### Example(s)

```hdfql
# set the MPI root process rank (to use when gathering processed (HDF5) data by other MPI processes) to 3
SET MPI ROOT 3

# select (i.e. read) an HDF5 dataset named "my_dataset" in parallel, where each MPI process sends the local maximum value stored in the dataset to the MPI root process (i.e. rank 3), which in turn returns the global maximum value stored in the dataset
SELECT FROM MAX(my_dataset) IN PARALLEL

# set the MPI root process rank (to use when gathering processed (HDF5) data by other MPI processes) to the default value (i.e. 0)
SET MPI ROOT DEFAULT

# select (i.e. read) an HDF5 dataset named "my_dataset" in parallel, where each MPI process sends the local maximum value stored in the dataset to the MPI root process (i.e. rank 0), which in turn returns the global maximum value stored in the dataset
SELECT FROM MAX(my_dataset) IN PARALLEL
```

[^52]: By default (i.e. upon initialization of the HDFql library), the MPI root process rank is set to zero.
