Introduction
By Richard Gerber
This is the last of three white papers that teach you, an experienced C/C++ programmer, how to get started using OpenMP*, simplifying creation, synchronization, and deletion of threads in your applications. The first paper introduced you to the most common feature of OpenMP: work sharing for loops. The second paper taught you how to exploit non-loop parallelism and the usage of the synchronization directives. This final paper discusses the library functions, the environment variables, how to debug your application when things go wrong, and some tips for maximizing performance.
Run-Time Library Functions
As you might remember, OpenMP is a set of pragmas, function calls, and environment variables. The first two papers discussed only the pragmas, which leaves the function calls and environment variables for this paper. The reason for this arrangement is simple: the pragmas are the reason for OpenMP, because they provide the highest degree of simplicity, they do not require source-code changes, and the pragmas can be easily ignored to generate a serial version of your code. On the other hand, use of the function calls requires program changes that may make it difficult to execute a serial version if desired. When in doubt, always try to use the pragmas and reserve the function calls for those times when they are To use the function calls, include the <omp.h> header file, and, of course, continue to use the Intel® C++ Compiler command line switch /Qopenmp. No additional libraries are required for linking.
![]()
If you're interested in this topic, these articles may be helpful:
![]() | Discussion Forum: Visual Fortran Compiler for Windows This forum is the place to ask questions of and share information with... |
![]() | Performance Obstacles for Threading: How do they affect OpenMP code? Why thread, and what does that have to do with performance? You might... |
![]() | More WorkSharing with OpenMP Abstract By Richard Gerber As you know, OpenMP* contains a very po... |
![]() | Intel® Threading Tools and OpenMP* Introduction Find where parallelism can be implemented effectively wi... |
![]()
Related Jobs:

