View Source

h1. Implementation Defined Behaviors in Sun Studio OpenMP 3.0

NOTE: All page numbers refer to the OpenMP Specification Version 3.0 at [http://www.openmp.org/mp-documents/spec30.pdf]

*1. Task scheduling points (see Section 1.3 on page 11):*
\\

In both tied and untied task regions, task scheduling points may occur only in task, taskwait, explicit or implicit barrier constructs, and at the completion point of the task.
\\

*2. Memory model (see Section 1.4.1 on page 13):*

There is no guarantee that memory accesses by multiple threads to the same variable without synchronization are atomic with respect to each other. Several implementation-dependent and application-dependent factors affect whether accesses are atomic or not. Some variables may be larger than the largest atomic memory operation on the target platform. Some variables may be mis-aligned or of unknown alignment and the compiler or the run-time system may need to use multiple loads/stores to access the variable. Sometimes there are faster code sequences that use more loads/stores.

*3. Internal control variables (see Section 2.3.2 on page 29):*
* The initial value of nthreads-var is 1.
* The initial value of dyn-var is TRUE.
* The initial value of run-sched-var is static with no chunk size.
* The initial value of def-sched-var is static with no chunk size.
* The initial value of stacksize-var is 4 MegaBytes for 32-bit applications and 8 MegaBytes for 64-bit applications.
* The initial value of wait-policy-var is PASSIVE.
* The initial value of thread-limit-var is 1024.
* The initial value of max-active-levels-var is 4.

*4. Dynamic adjustment of threads (see Section 2.4.1 on page 35):*

This implementation provides the ability to dynamically adjust the number of threads. Dynamic adjustment is enabled by default. Set the OMP_DYNAMIC environment variable, or call the omp_set_dynamic() routine to disable dynamic adjustment.

When a thread encounters a parallel construct, the number of threads delivered by this implementation is determined according to Algorithm 2.1 pp. 35-36. In exceptional situations, such as when there is a lack of system resources, the number of threads supplied will be less than described in Algorithm 2.1. In these situations, if SUNW_MP_WARN is set to TRUE or a callback function is registered via a call to sunw_mp_register_warn(), a warning message will be issued.

*5. Loop directive (see Section 2.5.1 on page 38):*

The integer type used to compute the iteration count of a collapsed loop is "long".

The effect of the schedule(runtime) clause when the run-sched-var internal control variable is set to auto is static with no chunk size.

*6. sections construct (see Section 2.5.2 on page 47):*

The structured blocks in the sections construct are scheduled among threads in the team in a static fashion, so that each thread gets an approximately equal number of consecutive structured blocks.

*7. single construct (see Section 2.5.3 on page 49):*

The first thread to encounter the single construct will execute the construct.

*8. atomic construct (see Section 2.8.5 on page 69):*

This implementation replaces all atomic directives by enclosing the target statement with a special, named critical construct. This will enforce exclusive access between all atomic regions in the program, whether or not these regions update the same or different storage locations.

*9. omp_set_num_threads routine (see Section 3.2.1 on page 110):*

If the argument to omp_set_num_threads() is not a positive integer, then the call will be ignored. A warning message will be issued if SUNW_MP_WARN is set to TRUE or a callback function is registered by a call to sunw_mp_register_warn().

*10. omp_set_schedule routine (see Section 3.2.11 on page 121):*

The behavior for the Sun-specific sunw_mp_sched_reserved schedule is the same as static with no chunk size, which is the default loop schedule (when no schedule is specified for a loop) and also the default runtime schedule.

*11. omp_set_max_active_levels routine (see Section 3.2.14 on page 126):*

If omp_set_max_active_levels() is called from within an active parallel region, then the call will be ignored. A warning message will be issued if SUNW_MP_WARN is set to TRUE or a callback function is registered by a call to sunw_mp_register_warn().

If the argument to omp_set_max_active_levels() is not a non-negative integer, then the call will be ignored. A warning message will be issued if SUNW_MP_WARN is set to TRUE or a callback function is registered by a call to sunw_mp_register_warn().

*12. omp_get_max_active_levels routine (see Section 3.2.15 on page 127):*

omp_get_max_active_levels() can be called from anywhere in the program. The call will return the value of the max-active-levels-var internal control variable.

*13. OMP_SCHEDULE environment variable (see Section 4.1 on page 146):*

If the schedule type specified for the OMP_SCHEDULE is not one of the valid types (static, dynamic, guided, or auto), then the environment variable will be ignored, and the default schedule (static with no chunk size) will be used. A warning message will be issued if SUNW_MP_WARN is set to TRUE or a callback function is registered by a call to sunw_mp_register_warn().

If the schedule type specified for the OMP_SCHEDULE environment variable is static, dynamic, or guided, but the chunk specified size is not positive, then the chunk size will be as follows:

For static, there will be no chunk size (i.e. static with no chunk size). For dynamic and guided, the chunk size will be 1.

*14. OMP_NUM_THREADS environment variable (see Section 4.2 on page 147):*

If the value specified for OMP_NUM_THREADS is greater than the number of threads the implementation can support, then a warning message will be issued if SUNW_MP_WARN is set to TRUE or a callback function is
registered by a call to sunw_mp_register_warn().

*15. OMP_DYNAMIC environment variable (see Section 4.3 on page 148):*

If the value specified for OMP_DYNAMIC is neither TRUE nor FALSE, then the value will be ignored, and the default value (TRUE) will be used. A warning message will be issued if SUNW_MP_WARN is set to TRUE or a callback function is registered by a call to sunw_mp_register_warn().

*16. OMP_NESTED environment variable (see Section 4.4 on page 148):*

If the value specified for OMP_NESTED is neither TRUE nor FALSE, then the value will be ignored, and the default value (FALSE) will be used. A warning message will be issued if SUNW_MP_WARN is set to TRUE or a callback function is registered by a call to sunw_mp_register_warn().

*17. OMP_STACKSIZE environment variable (see Section 4.5 on page 149):*

If the value given for OMP_STACKSIZE does not conform to the specified format, then the value will be ignored, and the default value (4 Megabytes for 32-bit applications, and 8 Megabytes for 64-bit applications) will be used. A warning message will be issued if SUNW_MP_WARN is set to TRUE or a callback function is registered by a call to sunw_mp_register_warn().

*18. OMP_WAIT_POLICY environment variable (see Section 4.6 on page 150):*

The ACTIVE behavior for a thread is spin. The PASSIVE behavior for a thread is sleep, after possibly spinning for a while.

*19. OMP_MAX_ACTIVE_LEVELS environment variable (see Section 4.7 on page 150):*

If the value specified for OMP_MAX_ACTIVE_LEVELS is not a nonnegative integer, then the value will be ignored, and the default value (4) will be used. A warning message will be issued if SUNW_MP_WARN is set to TRUE or a callback function is registered by a call to sunw_mp_register_warn().

*20. OMP_THREAD_LIMIT environment variable (see Section 4.8 on page 151):*

If the value specified for OMP_THREAD_LIMIT is not a positive integer, then the value will be ignored, and the default value (1024) will be used. A warning message will be issued if SUNW_MP_WARN is set to TRUE or a callback function is registered by a call to sunw_mp_register_warn().

\--------------------------------\-

*ITEMS 21-23 APPLY TO FORTRAN ONLY:*
\--------------------------------\-

*21. threadprivate directive (see Section 2.9.2 on page 81):*

If the conditions for values of data in the threadprivate objects of threads (other than the initial thread) to persist between two consecutive active parallel regions do not all hold, then the allocation status of an allocatable array in the second region may be "not currently allocated".

*22. shared clause (see Section 2.9.3.2 on page 88):*

Passing a shared variable to a non-intrinsic procedure may result in the value of the shared variable being copied into temporary storage before the procedure reference, and back out of the temporary storage into the actual argument storage after the procedure reference. This copying into and out of temporary storage can occur only if conditions a, b, and c in Section 2.9.3.2 on p. 88 hold.

*23. Runtime library definitions(see Section 3.1 on page 108):*

Both the include file omp_lib.h and the module file omp_lib are provided in this implementation.

On Solaris, the OpenMP runtime library routines that take an argument are extended with a generic interface so arguments of different Fortran KIND types can be accommodated.

The individuals who post here are part of the extended Sun Microsystems community and they might not be employed or in any way formally affiliated with Sun Microsystems. The opinions expressed here are their own, are not necessarily reviewed in advance by anyone but the individual authors, and neither Sun nor any other party necessarily agrees with them.

Copyright 1994-2009 Sun Microsystems, Inc.
Powered by Atlassian Confluence
Sun Guidelines on Public Discourse Privacy Policy Terms of Use Trademarks Site Map Employment Investor Relations Contact