12.07.2015 Views

LF95 Linux User's Guide - Lahey Computer Systems

LF95 Linux User's Guide - Lahey Computer Systems

LF95 Linux User's Guide - Lahey Computer Systems

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

5 Multi-Processing(PRO version only)This chapter describes how to create parallelized Fortran programs using OpenMP. The programmercan allow the compiler to completely control parallelization, can direct theparallelization process with optimization control lines (OCLs), may exert complete controlover the parallelization process by use of OpenMP directives, or use a combination of theseprocesses.Overview of Multi-ProcessingIn this document, multi-processing means that one program is executed on two or more CPUsthat can work independently and simultaneously. As used here, it does not mean executingtwo or more programs simultaneously. Consider the following code:do i = 1, 50000a(i) = b(i) + c(i)end doDifferent iterations of the DO loop are executed on different CPUs at the same time.CPU 1:CPU 2:do i1 = 1, 25000a(i1) = b(i1) + c(i1)end dodo i2 = 25001, 50000a(i2) = b(i2) + c(i2)end do<strong>Lahey</strong>/Fujitsu <strong>Linux</strong>64 Fortran User’s <strong>Guide</strong> 83

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!