Intel® Fortran Compiler 17.0 Developer Guide and Reference
The following examples show how to use several OpenMP* features.
This example shows a simple parallel loop where the amount of work in each iteration is different. Dynamic scheduling is used to improve load balancing.
The END DO has a NOWAIT because there is an implicit barrier at the end of the parallel region.
Example |
---|
|
The example uses two parallel loops fused to reduce fork/join overhead. The first END DO directive has a NOWAIT clause because all the data used in the second loop is different than all the data used in the first loop.
Example |
---|
|
The example demonstrates the use of the SECTIONS directive. The logic is identical to the preceding DO example, but uses SECTIONS instead of DO. Here the speedup is limited to two because there are only two units of work whereas in the example above there are (n-1) + (m-1) units of work.
Example |
---|
|
This example demonstrates how to use a SINGLE construct to update an element of the shared array a. The optional nowait clause after the first loop is omitted because it is necessary to wait at the end of the loop before proceeding into the SINGLE construct.
Example |
---|
|