This example illustrates the analysis of some OpenMP parallelization strategies in a Fortran program, omptest. This program is designed to test the efficiency of parallelization strategies for two different cases:
-
The first case compares the use of a PARALLEL SECTIONS directive with a PARALLEL DO directive for a section of code in which two arrays are updated from another array. This case illustrates the issue of balancing the work load across the threads.
-
The second case compares the use of a CRITICAL SECTION directive with a REDUCTION directive for a section of code in which array elements are summed to give a scalar result. This case illustrates the cost of contention among threads for memory access.
To do this example, you must have access to a SPARCTM computer with at least four CPUs. For instructions on collecting performance data for this example, see Collecting Data for the omptest Example. When you have collected performance data, choose from the following parts of the example:
Comparing Parallel Sections and Parallel Do Strategies
Comparing Critical Section and Reduction Strategies
Can't find what you are looking for?
Submit your comments at http://www.sun.com/hwdocs/feedback.
Legal Notices