3.3.5. Dependence managers

Nanos++ provides several plugins to handle task dependencies, with different performance and features.

3.3.5.1. Usage

Description: Changes the dependency plugin to use.
Type: string value
Environment variable: NX_DEPS=<string>
Command line flag: --deps[ |=]<string>

3.3.5.2. List of dependence plugins

3.3.5.2.1. Plain

Important

This is the default dependence plugin

  • Configuration string: NX_DEPS=plain or NX_ARGS="--deps=plain"
  • Description: This plugin uses single memory addresses to compute dependences. In most of the cases the programmer can use a single memory point as a sentinel for a whole region.

3.3.5.2.2. Regions

  • Configuration string: NX_DEPS=regions or NX_ARGS="--deps=regions"
  • Description: This plugin does not partition regions. It is more suitable for task with halos.

3.3.5.2.3. Perfect-regions

  • Configuration string: NX_DEPS=perfect-regions or NX_ARSG="--deps=perfect-regions"
  • Description: Partitions regions into perfect regions. It is recommended for applications like multisort.

3.3.5.2.4. Contiguous regions

Important

This is a test and functional plugin, so it’s performance may not be the best

  • Configuration string: NX_DEPS=cregions or NX_ARSG="--deps=cregions"
  • Description: Detects dependencies between regions defined by start address and end address.

3.3.5.2.5. Contiguous regions nocache

Important

This is a test and functional plugin, so it’s performance may not be the best

  • Configuration string: NX_DEPS=cregions_nocache or NX_ARSG="--deps=cregions_nocache"
  • Description: Similar to Contiguous regions but small regions go to a dedicated structure (performance may be better in some applications).

3.3.5.3. Dependence management examples

The default plugin is called plain, and it can only handle simple dependencies that do not overlap. The following is allowed:

#pragma omp task inout( [NB]block )
task_1();

#pragma omp task inout( [NB]block )
task_2();

#pragma omp task inout( block[0;NB] )
task_3();

The following requires regions support, as provided by the regions and perfect-regions plugins:

#pragma omp task inout( block[0;3] )
task_4();

#pragma omp task inout( block[1;3] )
task_5();

Here task 5 will not depend on task 4 when using the plain plugin.

Regions are also required when you have non-contiguous memory, such as matrices. Although regions are much more powerful, there is a drawback with the current regions plugins: alignment. Keep in mind that if your data is not properly aligned, there will be a potential task serialisation and therefore a huge performance toll.