.. index:: double: dependences; plugins Dependence managers =================== Nanos++ provides several plugins to handle task dependencies, with different performance and features. Usage ----- | *Description:* Changes the dependency plugin to use. | *Type:* string value | *Environment variable:* ``NX_DEPS=`` | *Command line flag:* ``--deps[ |=]`` List of dependence plugins -------------------------- .. index:: triple: dependences; plugins; plain 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. .. index:: triple: dependences; plugins; regions 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. .. index:: triple: dependences; plugins; perfect-regions 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. .. index:: triple: dependences; plugins; examples 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. .. index:: triple: dependences; plugins; examples 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). .. index:: triple: dependences; plugins; examples 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.