24.05.2014 Views

XL Fortran Enterprise Edition for AIX : User's Guide - IBM

XL Fortran Enterprise Edition for AIX : User's Guide - IBM

XL Fortran Enterprise Edition for AIX : User's Guide - IBM

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Logical Volume I/O<br />

To use a logical volume as a file, do the following:<br />

v<br />

v<br />

Set up the logical volume with permissions that allow you to read or write it.<br />

Specify the name of the special file (<strong>for</strong> example, /dev/rlv99) in the OPEN<br />

statement.<br />

Attention: Do not per<strong>for</strong>m this kind of I/O with any logical volume that already<br />

contains a file system; doing so will destroy the file system. You must also take<br />

any precautions necessary to ensure that multiple users or programs do not write<br />

to the same logical volume or write to a logical volume while someone else is<br />

reading from it.<br />

Notes:<br />

1. A logical volume can only be opened as a single direct-access file with a record<br />

length that is a multiple of the logical volume’s sector size (usually 512 bytes).<br />

2. I/O operations are not guaranteed to detect attempts to read or write past the<br />

end of the logical volume. There<strong>for</strong>e, make sure that the program keeps track<br />

of the extent of the logical volume. The maximum amount of data that can be<br />

stored this way on logical volume is the size of the logical volume minus the<br />

size of one stripe. The <strong>XL</strong> <strong>Fortran</strong> I/O routines use this stripe <strong>for</strong> bookkeeping.<br />

3. For optimal per<strong>for</strong>mance of data striping, ensure that any data items that you<br />

specified in the read or write lists <strong>for</strong> a logical volume are aligned on 64-byte<br />

boundaries. The simplest way to ensure this alignment <strong>for</strong> large static arrays<br />

and common blocks is to specify the option -qalign=4k.<br />

4. Regardless of any STATUS=’SCRATCH’ or STATUS=’DELETE’ specifiers,<br />

neither the data in a logical volume nor the special file in /dev is destroyed by<br />

an OPEN or CLOSE statement.<br />

Related In<strong>for</strong>mation: See “-qalign Option” on page 125.<br />

Data Striping<br />

Data striping is primarily useful <strong>for</strong> increasing I/O throughput <strong>for</strong> large,<br />

direct-access scratch files. The per<strong>for</strong>mance benefit is greatest when a program<br />

reads and writes large objects.<br />

When you make use of data striping, you per<strong>for</strong>m I/O to a logical volume as<br />

described in “Logical Volume I/O” and set up the logical volume especially <strong>for</strong><br />

high-per<strong>for</strong>mance striped I/O through the smit or mklv commands. You can then<br />

use the technique that is described in “Naming Scratch Files” on page 332 to place<br />

a scratch file on a striped logical volume.<br />

For example, consider a <strong>Fortran</strong> program that contains the following statements:<br />

OPEN (UNIT=42, STATUS=’SCRATCH’,<br />

+ FORM=’UNFORMATTED’, ACCESS=’DIRECT’, RECL=131072)<br />

...<br />

OPEN (UNIT=101, STATUS=’SCRATCH’,<br />

+ FORM=’UNFORMATTED’, ACCESS=’DIRECT’, RECL=131072)<br />

You could place the scratch files <strong>for</strong> units 42 and 101 on the raw logical volumes<br />

/dev/rlv30 and /dev/rlv31 by setting environment variables be<strong>for</strong>e running the<br />

program, as follows:<br />

<strong>XL</strong>FRTEOPTS="scratch_vars=yes"<br />

<strong>XL</strong>FSCRATCH_42="/dev/rlv30"<br />

<strong>XL</strong>FSCRATCH_101="/dev/rlv31"<br />

export <strong>XL</strong>FRTEOPTS <strong>XL</strong>FSCRATCH_42 <strong>XL</strong>FSCRATCH_101<br />

334 <strong>XL</strong> <strong>Fortran</strong> <strong>Enterprise</strong> <strong>Edition</strong> <strong>for</strong> <strong>AIX</strong> : User’s <strong>Guide</strong>

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

Saved successfully!

Ooh no, something went wrong!