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

Create successful ePaper yourself

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

Table 22. Table <strong>for</strong> Binding an Application Written Only in <strong>Fortran</strong><br />

<strong>Fortran</strong> program using asynchronous I/O statements<br />

Type of<br />

Linking Yes No<br />

Dynamic xlf95 -o t t.f xlf95 -o t t.f<br />

Static<br />

xlf95 -o t t.f<br />

-bnso -bnodelcsect<br />

-bI:/lib/syscalls.exp<br />

-lc -bI:/lib/aio.exp<br />

xlf95 -o t t.f<br />

-bnso -bnodelcsect<br />

-bI:/lib/syscalls.exp<br />

Table 23. Table <strong>for</strong> Binding an Application Written in Both <strong>Fortran</strong> and C, Where the C<br />

Routines Call the libc Asynchronous I/O Routines<br />

<strong>Fortran</strong> program using asynchronous I/O statements<br />

Type of<br />

Linking Yes No<br />

Dynamic xlf95 -o t t.f c.o -lc xlf95 -o t t.f c.o -lc<br />

Static<br />

xlf95 -o t t.f c.o<br />

-bnso -bnodelcsect<br />

-bI:/lib/syscalls.exp<br />

-lc -bI:/lib/aio.exp<br />

Note: c.o is an object file of routines written in C.<br />

xlf95 -o t t.f c.o<br />

-bnso -bnodelcsect<br />

-bI:/lib/syscalls.exp<br />

-lc -bI:/lib/aio.exp<br />

You can bind an application that uses asynchronous I/O on a system with <strong>AIX</strong><br />

asynchronous I/O disabled. However, you must run the resulting executable on a<br />

system with <strong>AIX</strong> asynchronous I/O enabled.<br />

Error Handling<br />

For an asynchronous data transfer, errors or end-of-file conditions might occur<br />

either during execution of the data transfer statement or during subsequent data<br />

transfer. If these conditions do not result in the termination of the program, you<br />

can detect these conditions via ERR=, END= and IOSTAT= specifiers in the data<br />

transfer or in the matching WAIT statement.<br />

Execution of the program terminates if an error condition occurs during execution<br />

or during subsequent data transfer of an input/output statement that contains<br />

neither an IOSTAT= nor an ERR= specifier. In the case of a recoverable error, if the<br />

IOSTAT= and ERR= specifiers are not present, the program terminates if you set<br />

the err_recovery run-time option to no. If you set the err_recovery run-time option<br />

to yes, recovery action occurs, and the program continues.<br />

If an asynchronous data transfer statement causes either of the following events, a<br />

matching WAIT statement cannot run, because the ID= value is not defined:<br />

v A branch to the label that you specified by ERR= or END=<br />

v The IOSTAT= specifier to be set to a non-zero value<br />

<strong>XL</strong> <strong>Fortran</strong> Thread-Safe I/O Library<br />

The <strong>XL</strong> <strong>Fortran</strong> thread-safe I/O library libxlf90_r.a provides support <strong>for</strong> parallel<br />

execution of <strong>Fortran</strong> I/O statements. For <strong>Fortran</strong> programs that contain I/O<br />

statements in a parallelized loop or that create multiple threads and execute I/O<br />

340 <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!