Intel® Moderncode for Parallel Architectures
Support for developing parallel programming applications on Intel® Architecture.
Announcements
Intel Customer Support will be observing the Martin Luther King holiday on Monday, Jan. 17, and will return on Tues. Jan. 18.
For the latest information on Intel’s response to the Log4j/Log4Shell vulnerability, please see Intel-SA-00646

OpenMP in pure procedures

Stanislav_Fyodorov
64 Views

Hello,

According OpenMP 2.5 specification we can't use OpenMP in pure procedures. Why so? I mean, what if I what use PURE procedures also for compiler-checking of purity of my code (not only for parallelization)?

0 Kudos
1 Reply
jimdempseyatthecove
Black Belt
64 Views

Have you considered using conditional compilation?

When _OPENMP not defined compile the affected routines with PURE

When _OPENMP defined compile the affected routines without PURE

If you use the Fortran PreProcessor you could define a macro as follows

#ifdef _OPENMP
#define TEST_PURE
#else
#define TEST_PURE pure
#endif

Then use as

TEST_PURE function foo(a,b,c)
...

Jim Dempsey


Reply