Guardian Application Conversion Guide

Improving I/O Performance Using Direct I/O Transfers
Converting Other Parts of an Application
096047 Tandem Computers Incorporated 8–35
Improving I/O
Performance Using
Direct I/O Transfers
The D-series operating system can improve the performance of I/O operations by
transferring data directly between a program's I/O buffers and the I/O device without
first allocating an intermediate buffer in the program's process file segment (PFS). A
C-series operating system I/O operation uses an intermediate buffer in a program's
PFS to transfer data, except when using the SETMODE 141 function (enable or disable
large transfers for disk files).
By default, the D-series operating system uses direct transfers for I/O operations.
However, the SETMODE 72 function allows a program to control whether direct I/O
transfers or intermediate PFS buffers are used for I/O operations.
Using Direct I/O Transfers Your existing program might use PFS buffers in I/O operations for a file. To convert
your program to use direct I/O transfers for a file, open the file using the FILE_OPEN_
procedure. The FILE_OPEN_ default mode for I/O operations is direct transfers.
You can also open the file using the OPEN procedure and then execute a SETMODE 72
function as described in the following subsection.
Using the
SETMODE 72 Function
Regardless of the open procedure you use, you can set the I/O transfer mode using the
SETMODE 72 function. The SETMODE 72 parameters are:
parameter-1
1 = Force the system to use an intermediate buffer in
the PFS for I/O transfers for this file.
0 = Allow the system to make direct I/O transfers to
and from user buffers for this file.
parameter-2
Is not used and should be zero if it is supplied.
If you open a file using the OPEN procedure but need the performance improvement
of direct I/O transfers, execute a SETMODE 72 as follows:
LITERAL force^pfs^buffers = 72,
direct^transfers = 0;
...
CALL SETMODE (file^number,
force^pfs^buffers,
direct^transfers);
Conversely, if you open a file using the FILE_OPEN_ procedure but need to use PFS
buffers for the I/O transfer, execute a SETMODE 72 as follows:
LITERAL force^pfs^buffers = 72,
use^pfs^buffers = 1;
...
CALL SETMODE (file^number,
force^pfs^buffers,
use^pfs^buffers);