Implementation-Defined Behavior for OpenMP in LabWindows/CVI
The OpenMP 2.5 Specification allows the compiler implementing the OpenMP model to define some behaviors of the model. The following table displays the implementation-defined behavior for OpenMP in LabWindows/CVI.
Behavior | Description | LabWindows/CVI-Defined Behavior |
---|---|---|
Memory model | Defines whether memory accesses by multiple threads to the same variable, without synchronization, are atomic. Also defines the sizes of memory accesses. | Uses Windows and Microsoft Visual Studio memory model. |
Internal control variables | 1) Defines the number of copies of the internal control variables during the execution of any explicit parallel region. Also defines the effects of internal control variables. 2) Defines the initial values of the following variables: nthreads-var dyn-var run-sched-var def-sched-var | 1) There is one global instance of all internal control variables for the process. Setting values takes effect immediately. 2) LabWindows/CVI defines the variables as follows: nthreads-var = number of processors dyn-var = FALSE run-sched-var = static def-sched-var = static |
Nested parallelism | Defines the number of levels of parallelism supported. | LabWindows/CVI supports one level of parallelism. |
Dynamic adjustment of threads | 1) Defines the ability to dynamically adjust the number of threads. 2) Implementations can to deliver fewer threads than indicated by Figure 2-1 of the OpenMP 2.5 Specification in exceptional situations, such as when there is a lack of resources, even if dynamic adjustment is disabled. The implementation must deliver at least one thread. | 1) LabWindows/CVI does not support dynamically adjusting threads. 2) LabWindows/CVI delivers only the threads that it can create. |
sections directive | Defines the method of scheduling the structured blocks among the threads in the team. | LabWindows/CVI schedules each section in the order it is parsed. |
single directive | Defines the method of choosing a thread to execute the structured block. | The master thread always executes the single directive. |
atomic directive | Defines the circumstances under which a compliant implementation may enforce exclusive access between atomic regions which update different storage locations. | Clang and Windows defined |
omp_set_num_threads function | The following aspects of this function are implementation-defined:
1) The binding thread set and binding region, if required, when you call omp_set_num_threads from within any explicit parallel region 2) The behavior of this function, if the function is called from within any explicit parallel region 3) The behavior of this function, if the number of threads requested exceeds the number the implementation can support, or the number of threads requested is not a positive integer | 1) Binding thread set is all threads 2) Behavior is to update the value of the internal control variable. The next call to the omp_get_max_threads function from any thread gets the updated value. 3) Exceeds: Delivers only the threads that LabWindows/CVI can create. When > 64: Coerced to 64 When <= 0 : Ignored (last valid value retained) |
omp_get_max_threads function | When called from within any explicit parallel region, the binding thread set (and binding region, if required) for the omp_get_max_threads function is implementation defined. | The binding thread set is all threads. |
omp_set_dynamic function | When called from within any explicit parallel region, the binding thread set (and binding region, if required) for the omp_set_dynamic function is implementation defined. If called from within any explicit parallel region, the behavior of this function is implementation defined. | LabWindows/CVI does not support dynamically adjusting threads. Calling this function has no effect. |
omp_get_dynamic function | When called from within any explicit parallel region, the binding thread set (and binding region, if required) for the omp_get_dynamic function is implementation defined. | LabWindows/CVI does not suport dynamically adjusting threads. This function always returns false from all threads. |
omp_set_nested function | When called from within any explicit parallel region, the binding thread set (and binding region, if required) for the omp_set_nested function is implementation defined. | LabWindows/CVI does not support nested parallelism. Calling this function has no effect. |
omp_get_nested function | When called from within any explicit parallel region, the binding thread set (and binding region, if required) for the omp_get_nested function is implementation defined. | LabWindows/CVI does not support nested parallelism. This function always returns false from all threads. |
OMP_NUM_THREADS environment variable | If the requested value of OMP_NUM_THREADS is greater than the number of threads an implementation can support, or if the value is not a positive integer, the behavior of the program is implementation defined. | Exceeds: Delivers only the threads that LabWindows/CVI can create.
When > 64: Coerced to 64 When <= 0 : Ignored (last valid value retained) |