next up previous contents index
Next: 3 Home of Computations Up: ADAPTOR HPF Programmers Guide Previous: 1 Overview   Contents   Index

Subsections


2 Execution Model of HPF Programs

This section describes the different execution models of High Performance Fortran. Though the description is related to the ADAPTOR compilation system, most of the techniques might also be applied within other HPF compilers. This is especially true for the distributed memory execution model based on message passing.

The HPF mapping directives define a mapping of data objects (arrays) to abstract processors. Data objects that have been mapped to a certain abstract processor are said to be owned by that processor. Ownership of data is the central concept for the execution of HPF programs. Based on the ownership of data, the distribution of computations to the abstract processors and the necessary communication and/or synchronization between processors is derived automatically.

Figure 1: Mapping directives of High Performance Fortran.
\includegraphics[height=60mm]{hpf-map.eps}

While the concept of ownership and work distribution is followed within all HPF execution models, the layout of distributed data and the mapping of abstract processors to processes or threads varies for the different HPF execution models.

2.1 Serial Execution of HPF Programs

HPF programs can also run as serial programs. For this purpose, ADAPTOR treats them as follows:

2.2 The Multiprocessing Execution Model for HPF

In the multiprocessing execution model, every abstract HPF processor becomes an own process with its own local address space. Each process executes the same program but operates only on its own data. Any two processes communicate by exchanging messages. In accordance with the SPMD paradigm, an HPF compiler has to ensure that all processes executing the target program follow the same control flow in a loosely synchronous style. For the parallel execution, each process is usually mapped to one processor.

Figure 2: The multiprocessing HPF execution model.
\includegraphics[height=60mm]{dm_model.eps}

The multi-processing execution model for HPF, illustrated in Figure 2, has the following main characteristics:


2.3 The Multithreading Execution Model for HPF

The multi-threading execution model for HPF, targeted towards shared memory parallel architectures only, is fundamentally different from the multi-processing execution model. With the multi-threading execution model, a HPF program is compiled into a shared memory parallel program which utilizes thread parallelism only.

The multithreading execution model employs a set of threads which execute concurrently in a shared address space. All data objects of an HPF program are allocated in an un-partitioned way in the shared memory, regardless of HPF mapping directives. The information provided by the HPF mapping directives is utilized the achieve parallel execution by distributing the computations among the threads. Consistency of shared data objects is guaranteed by automatically generating the required synchronization between threads.

Figure 3: The multi-threading HPF execution model.
\includegraphics[height=60mm]{sm_model.eps}

The multi-threading execution model for HPF has the following main characteristics [BB00]:

REDUCTION and NEW clauses are handled similar to the REDUCTION and PRIVATE clauses of OpenMP.

!hpf$ independent, new(X), reduction(SUM)
      do I = 1, N
         X = W * (I -0.5d0)
         SUM = SUM + F(X)
      end do

is translated to

!omp$ parallel do, private(X), reduction(+:SUM)
      do I = 1, N
         X = W * (I -0.5d0)
         SUM = SUM + F(X)
      end do

The use of this thread based shared memory programming model for HPF can be very convenient for porting applications to HPF. In this model, data locality does not play such an important rule and there are no problems for the HPF compiler to generate efficient communication.

2.4 The Hierarchical Execution Model

Within the hierarchical execution model an HPF program is executed by a set of parallel processes, each of which executes on a separate node of an SMP cluster within its own local address space. Each of these processes employs of a set of threads which execute concurrently in the shared address space of a node. Process parallelism, data partitioning, and message-passing communication is utilized between the nodes of a cluster in much the same way as in the multiprocessing execution model, while within a node additional parallelism is exploited in analogy to the multi-threading execution model by means of threads concurrently executing in a shared address space.

Figure 4: The hierarchical HPF execution model.
\includegraphics[height=70mm]{hyb_model.eps}

The hierarchical execution model, illustrated in Figure 4 has the following main characteristics:

The hierarchical execution model offers certain advantages against the multiprocessing execution model.


next up previous contents index
Next: 3 Home of Computations Up: ADAPTOR HPF Programmers Guide Previous: 1 Overview   Contents   Index
Thomas Brandes 2004-03-18