Autoparallelization enables you to automatically detect different code sequences which can be correctly and profitably executed concurrently, in separate threads. For example, the code in the first row of the following example can be computed in two threads:
do i=1,100 |
Thread 1 |
do i=1,50 |
Thread 2 |
do i=50,100 |
Use auto-parallelization for the subroutine daxpy.
Subroutine daxpy |
subroutine daxpy |
Parent Thread Code |
subroutine daxpy |
In the above example, work threshold and runtime dependency tests are
combined in this if statement:
if ( kmpc_ok_to_fork() .eqv. .true. )
Child Thread Code |
subroutine daxpy(kmpc_tid, a, b, s) |
Using /Qpar_report |
subroutine daxpy() |
Using Auto-parallelization Directive |
subroutine daxpy |