29.01.2013 Views

GPFS: Administration and Programming Reference - IRA Home

GPFS: Administration and Programming Reference - IRA Home

GPFS: Administration and Programming Reference - IRA Home

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

Chapter 7. Communicating file access patterns to <strong>GPFS</strong><br />

<strong>GPFS</strong> attempts to recognize the pattern of accesses that an application makes to an open file, <strong>and</strong><br />

optimizes its behavior accordingly. For example, <strong>GPFS</strong> can recognize sequential reads <strong>and</strong> therefore<br />

prefetch blocks in advance of when they are required by the application. However, in many cases <strong>GPFS</strong><br />

does not recognize the access pattern of the application, or cannot optimize its data transfers. In these<br />

situations, performance may improve if the application explicitly discloses aspects of its access pattern to<br />

<strong>GPFS</strong> using the gpfs_fcntl() subroutine. These subroutines are exploited by MPI Version 2.0.<br />

The gpfs_fcntl() subroutine allows application programs to pass two classes of file access information<br />

giving <strong>GPFS</strong> an opportunity to improve throughput <strong>and</strong> latency of file system requests:<br />

1. Hints<br />

2. Directives<br />

Hints allow an application to disclose its future accesses to <strong>GPFS</strong>. Hints are always optional. Adding or<br />

removing hints from a program, even incorrectly specified hints, will never alter the meaning of a program.<br />

Hints can only affect the performance of an application. The hints that may be passed to <strong>GPFS</strong> are:<br />

1. gpfsAccessRange_t<br />

2. gpfsClearFileCache_t<br />

3. gpfsFreeRange_t<br />

4. gpfsMultipleAccessRange_t<br />

Note: <strong>GPFS</strong> is free to silently ignore a hint if system resources do not permit the hint to be processed.<br />

In contrast, directives are stronger than hints. They may affect program semantics <strong>and</strong> must be either<br />

carried out by <strong>GPFS</strong> or return an error. The directives which may be passed to <strong>GPFS</strong> are:<br />

1. gpfsCancelHints_t<br />

2. gpfsDataShipMap_t<br />

3. gpfsDataShipStart_t<br />

4. gpfsDataShipStop_t<br />

To communicate hints <strong>and</strong> directives to <strong>GPFS</strong>, an application program builds a data structure in memory,<br />

then passes it to <strong>GPFS</strong>. This data structure consists of:<br />

v A fixed length header, mapped by gpfsFcntlHeader_t.<br />

v Followed by a variable number of, <strong>and</strong> any combination of, hints <strong>and</strong> directives.<br />

Hints <strong>and</strong> directives may be mixed within a single gpfs_fcntl() subroutine, <strong>and</strong> are performed in the<br />

order that they appear. A subsequent hint or directive may cancel out a preceding one.<br />

The header <strong>and</strong> hints <strong>and</strong> directives that follow it are defined as C structures.<br />

The gpfs_fcntl() subroutine takes the h<strong>and</strong>le of the opened file as its first parameter <strong>and</strong> the address of<br />

the data structure as its second parameter. For complete definitions of the gpfs_fcntl() subroutine, the<br />

header, hints, directives, <strong>and</strong> other operations, see “gpfs_fcntl() Subroutine” on page 284.<br />

© Copyright IBM Corp. 1998, 2006 57

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

Saved successfully!

Ooh no, something went wrong!