OpenMP Overview

LabWindows/CVI 2017 Help

Edition Date: May 2017

Part Number: 370051AG-01

»View Product Info

DOWNLOAD (Windows Only)
LabWindows/CVI 2010 Help
LabWindows/CVI 2012 Help
LabWindows/CVI 2013 Help
LabWindows/CVI 2015 Help
LabWindows/CVI 2017 Help

OpenMP, Open Multi-Processing, is a set of compiler directives and related clauses, an application programming interface (API), and environment variables that allow you to easily create applications that execute on multiple threads. The Open MP model allows you to complete the following tasks:

  • Define parallel regions of code and create teams of threads that execute the parallel regions.
  • Specify how to share work among the threads in the team.
  • Declare data that is shared among the threads and data that is private to each thread.
  • Synchronize threads, protect shared data from concurrent access, and define regions that execute by a single thread exclusively.

The compiler directives and associated clauses address the high level work of defining parallel regions, dividing code and loop iterations among threads, and synchronizing work among the threads of a team. The API provides a finer level of control within a parallel region; you can determine and set the number of available threads, set and initialize locks, and more. The environment variables control the execution of the parallel regions at run time.

Note Note  The OpenMP Run-Time Library is available only in the LabWindows/CVI Full Development System.

While you can use the LabWindows/CVI Multithreaded Library to create multithreaded applications, the benefits of using the OpenMP model include:

  • Implementing OpenMP incrementally within existing code, with minimal re-writing of the code.
  • Preserving the sequential order of the original source code.
  • Minimizing possible programming errors common to multithreaded programming with the structured approach of OpenMP.
  • Porting code to other compilers and operating systems easily.
    Note Note  Compilers that do not support the OpenMP structure ignore the OpenMP compiler directives. Use the _OpenMP macro to ensure that OpenMP function calls do not result in errors in other compilers that do not support OpenMP.

To utilize OpenMP directives and clauses, variables, and function calls, you must enable OpenMP by selecting Enable OpenMP Support in the Build Options dialog box. If you do not enable OpenMP, LabWindows/CVI ignores all OpenMP directives and clauses, variables, and function calls.

LabWindows/CVI is compliant with the OpenMP 2.5 Specification.

This help file provides basic information about OpenMP as well as information about LabWindows/CVI-specfic implementation details. Refer to the References to Other OpenMP Resources topic for references to more in-depth OpenMP documentation.

To access information about each supported OpenMP function, you can use the function tree list of OpenMP Run-Time Library functions or click the function name in the Library Reference»OpenMP Run-Time Library»Alphabetical List of Functions section of this help file.

Related Topics

OpenMP Specification Compliance

OpenMP Compiler Directives and Clauses

Creating Parallel Regions

Communicating between Threads and Sharing Data

Using Synchronization to Avoid Data Conflicts

OpenMP Terminology

References to Other OpenMP Resources


Not Helpful