Example: Parallel Region in FORTRAN
Compiler directives are enabled with the -mp switch or -apo switch. With -apo automatic parallelization is requested.
- In this example all loops can be made parallel automatically (-apo)
SUBROUTINE MXM(A,B,C,LM,M,N,N1)
DIMENSION A(M,L), B(N1,M), C(N1,L)
C(I,K) = C(I,K) + B(I,J)*A(J,K)
Will be run serially, unless
Default variable type association rules:
all variables shared (I.e. A,B,C are shared)
Induction variables I,J,K will be found
automatically and assigned private scope