#define SEQAN_OMP_PRAGMA
Portable conditional #pragma issuing if OpenMP is enabled.

Defined in <seqan/parallel.h>
Signature SEQAN_OMP_PRAGMA(x)

Parameters

x The string to issue behind #pragma omp.

Detailed Description

Remarks

This macro uses portable pragma generation, dependent on the macro _OPENMP being defined (as by the OpenMP standard).

This is useful for disabling OpenMP pragmas on compilers that do not support OpenMP or when OpenMP is not enabled to suppress warnings.

Example

Parallelize loop with OpenMP if OpenMP is enabled:

SEQAN_OMP_PRAGMA(parallel for)  // becomes: #pragma omp parallel for
for (int i = 0; i < x; ++i)
{
    // Do work.
}

Make an addition atomic if OpenMP is enabled:

SEQAN_OMP_PRAGMA(parallel atomic)  // becomes: #pragma omp parallel atomic
i += 1;