OpenMP supports atomic update which ensures sequential execution of a single assignment statement and thus prevents a memory location from being updated simultaneously by different threads. OpenMP provides execution environment routines that can be used to query and control the parallel execution environment. Capabilities include setting and querying the number of threads that execute a parallel region, querying the thread number, querying the number of processors available to the program, querying whether one is currently dynamic within a region executing in parallel, enabling or disabling dynamic adjustment of the number of available threads, and enabling or disabling nested parallelism. Locking routines can be used to guarantee that only one thread accesses a variable at a time. OpenMP also provides environment variables for controlling execution of parallel regions.
Environment routines take precedence over environment variables.
The users were in agreement that this is indeed the case for many application codes. Gabb commented that when there is loop-level or sectional parallelism, using OpenMP is almost trivial. She believes that the incremental approach supported by OpenMP makes parallel programming accessible to many more people. She says that with OpenMP, one can get good parallel performance with little effort. Yan and Jin agreed that with OpenMP once can use an incremental approach and parallelize gradually, picking up performance gradually as well.