Quantcast
Channel: Intel® Software - Intel® Fortran Compiler for Linux* and macOS*
Viewing all articles
Browse latest Browse all 2746

Building OpenMP-compatible sequential libraries

$
0
0

Hi,

I have code that consists of a non-parallelized (statically linked) library that I reuse across various projects, and some user code that calls this library from OpenMP-parallelized loops. After observing numerous data races in the library routines, which I though I had written in a thread-safe way, I realized
that the sequential library itself has to be compiled with -qopenmp, even though it does not use OpenMP at all.

I was wondering what the best practice is when creating a sequential library that can be used both with OpenMP and sequential user code.
Are there any problems when linking against a library compiled with -qopenmp if the user code itself is compiled without -qopenmp?

Thanks,
Richard


Viewing all articles
Browse latest Browse all 2746

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>