26.06.2015 Views

Parallel Programming in Fortran 95 using OpenMP - People

Parallel Programming in Fortran 95 using OpenMP - People

Parallel Programming in Fortran 95 using OpenMP - People

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

58 4. The <strong>OpenMP</strong> run-time library<br />

disable the dynamic adjustment feature <strong>in</strong> order to be sure. Also implementations are not<br />

required to support dynamic adjustment, but they have at least to implement the present<br />

<strong>in</strong>terface for portability reasons.<br />

4.1.8 OMP get dynamic<br />

This function returns the status of the dynamic thread adjustment mechanism: it will return<br />

.TRUE., if it is enabled, and .FALSE., if it is disabled. If the <strong>OpenMP</strong>-implementation<br />

does not implement dynamic thread adjustment, this function always returns .FALSE..<br />

The <strong>in</strong>terface declaration for this function is the follow<strong>in</strong>g one:<br />

function OMP_get_dynamic()<br />

logical(k<strong>in</strong>d = OMP_logical_k<strong>in</strong>d) :: OMP_get_dynamic<br />

end function OMP_get_dynamic<br />

4.1.9 OMP set nested<br />

This subrout<strong>in</strong>e enables or disables the nested parallelism. Its <strong>in</strong>terface declaration is:<br />

subrout<strong>in</strong>e OMP_set_nested(enable)<br />

logical(k<strong>in</strong>d = OMP_logical_k<strong>in</strong>d), <strong>in</strong>tent(<strong>in</strong>) :: enable<br />

end subrout<strong>in</strong>e OMP_set_nested<br />

When enable is set equal to .TRUE., nested parallelism is enabled, while if it is equal<br />

to .FALSE., it is disabled. The default sett<strong>in</strong>g is always .FALSE., which means that, by<br />

default, nested parallel regions are serialized; that is, they are executed by a team with<br />

only one thread.<br />

The number of threads used to execute nested parallel regions is <strong>OpenMP</strong>-implementation<br />

dependent. As a result, <strong>OpenMP</strong>-compliant implementations are allowed to serialize<br />

nested parallel regions even when nested parallelism is enabled.<br />

A call to this subrout<strong>in</strong>e overwrites the sett<strong>in</strong>gs specified by the environment variable<br />

OMP NESTED for the follow<strong>in</strong>g nested parallel regions.<br />

4.1.10 OMP get nested<br />

This function returns the status of the nested parallelism mechanism: it will return .TRUE.,<br />

if it is enabled, and .FALSE., if it is disabled. If the <strong>OpenMP</strong>-implementation does not<br />

support nested parallelism, this function always returns .FALSE.. The <strong>in</strong>terface declaration<br />

for this function looks as follows:<br />

function OMP_get_nested()<br />

logical(k<strong>in</strong>d = OMP_logical_k<strong>in</strong>d) :: OMP_get_nested<br />

end function OMP_get_nested

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!