Simple interface for parallel applications is available on SCD Origin and Cray computers . . .
![]() Tom Parker
|
by Tom Parker OpenMP is an industry-wide standard for directive-based parallel programming. It gives shared-memory parallel programmers a simple and flexible interface for developing parallel applications. Jointly defined by a group of major computer hardware and software vendors, the OpenMP API (Application Program Interface) supports multiplatform, shared-memory, parallel programming in C/C++ and Fortran on all architectures, including Unix platforms and Windows NT platforms.
How does OpenMP compare with other interfaces?
FORALL loops are not rich or general enough to use as a complete parallel programming model. Their focus on loops and the rule that subroutines called by those loops can't have side effects effectively limit their scalability. FORALL loops are useful for providing information to automatic parallelizing compilers and preprocessors.
There are many parallel programming languages being researched or prototyped in the industry. These may be targeted towards a specific architecture, or focused on exploring one key requirement.
A simple example of how to use OpenMPThis example shows how to parallelize a simple loop in Fortran 90. The loop iteration variable (I) is private by default, so it is not necessary to declare it explicitly.
!$OMP PARALLEL DO
DO I=1,N
B(I) = (A(I) + A(I-1)) / 2.0
ENDDO
!$OMP END PARALLEL DO
The END PARALLEL DO directive is optional.
Bonus tipHere's an easy way to think about which variables are local and which are shared.Pretend that you replace the entire DO loop with a call to a subroutine. The arguments you would place in the calling sequence are the shared variables.
Availability on SCD computersOpenMP is available on these SCD systems:
For more informationA good source for information about OpenMP is the OpenMP website, which includes an FAQ and complete specifications (i.e., documentation). |