5.1 Why Simulate Network Striped Files?

In the current implementation of Digital High Performance Fortran 90, all I/O operations are serialized through a single processor. For example, when output must be done, all of the data being written is copied to a temporary buffer on Peer 0, and the print function is then performed by Peer 0. This communication of data is necessary to produce meaningful output, because only a fragment of a distributed data object is normally available on any given processor. In order for distributed data to be output in a usable form, the data must first be gathered onto a single processor.

Checkpointing, however, is a special case. In checkpointing, the state of a program is preserved through I/O to allow restarting in case of software or hardware failure. Although ordinary serialized I/O through Peer 0 accomplishes this goal, the performance cost of this approach is very great in many cases. Because the only purpose of checkpointing is to preserve the state of the program, the relevant data stored on each peer can be output directly without regard to how it fits together with data stored on other peers.

This method of parallel output is known as simulating a network striped file. As long as the relevant data stored on every peer is output, checkpointing can be accomplished without first gathering the data onto one peer. This technique eliminates the need for moving the data to Peer 0. Because all movement of data between processors is eliminated, network striped file simulation is a much more efficient checkpointing technique than ordinary I/O.

For More Information:

5.1.1 Constructing a Module for Parallel Temporary Files

This chapter will show how to simulate network striped files using a module containing EXTRINSIC routines that simulate Fortran I/O statements such as READ and WRITE. EXTRINSIC routines allow code based upon non-HPF computing models to be incorporated into an HPF program.

The data parallel model uses a single logical thread of control and views the distributed processing environment as a single logical computer. This is the HPF computing model.

Simulating a network striped file requires diverging from the HPF computing model. A programming model that views the entire PSE cluster as a single computer would not allow us to specify that each node should write its data to its own local device.

A more appropriate programming model for simulating a network striped file is explicit SPMD programming. Explicit SPMD programming lacks the global addressing that is available in HPF. In explicit SPMD programming, a separate copy of the same program, parametrized by processor number, is executed by each processor. Unlike an HPF routine, in which a distributed array is addressed as a single entity, distributed arrays have no direct representation in explicit SPMD routines. Each processor addresses its own slice of such an array as if it were a separate local array. The global array that is the sum of the parts stored by each local processor exists only in the mind of the programmer.

HPF lets you mix programming models on a procedure basis:

Using EXTRINSIC(HPF_LOCAL), explicit SPMD code to simulate a network striped file can be incorporated into an HPF program. In network striped file simulation, a set of files (one file for each peer) is treated as a single logical file.

The module should define subroutines to be parallel versions of OPEN, CLOSE, READ, WRITE, and REWIND. The module uses two private variables defining the range of logical unit numbers to be used for temporary files, in this case 90 to 99:

MODULE parallel_temporary_files
  INTEGER, PRIVATE :: highest_unit_number = 90
  INTEGER, PRIVATE :: maximum_unit_number = 99
CONTAINS
  EXTRINSIC(HPF_LOCAL) SUBROUTINE parallel_open(unit_number, ok)
   . . .
  END SUBROUTINE parallel_open
   . . .
END MODULE parallel_temporary_files