FastSort Manual

Using FastSort System Procedures
FastSort Manual429834-003
5-6
SORTBUILDPARM Procedure
Guidelines
Follow these guidelines when you call the SORTBUILDPARM procedure.
Specifying a Group of Processors for Subsort Processes
When you configure a parallel sort run, you can have the distributor-collector
SORTPROG process select processors for subsort processes. SORTPROG considers
processors you specify in the cpu-mask parameter. You can use the not-cpu-mask
parameter, which overrides cpu-mask, to exclude one or more processors.
FastSort selects a processor from the group if you do not specify a processor for a
subsort process in the process-start parameter of SORTMERGESTART. If you do
not specify any processors, FastSort puts each subsort process in the processor that
runs the disk process for the subsort initial scratch file.
Improving Performance With Record Blocking and Nowait I/O
If your program calls SORTMERGESEND or SORTMERGERECEIVE, you can reduce
the number of interprocess messages by using a single or double buffer for record
blocking. SORTMERGESTART provides the buffer to transfer a block of records to or
from SORTPROG, instead of a single record, in each interprocess message.
Record blocking is valid only for sort runs. If you try to use record blocking with merge
runs, SORTPROG returns error 81 (BLOCKED INTERFACE NOT ALLOWED WITH
MERGE).
Each call to SORTMERGESEND puts a record into the buffer, and each call to
SORTMERGERECEIVE returns a record from the buffer. FastSort transfers blocks of
unsorted records out of the buffer and blocks of sorted records into the buffer. You
specify block size, from 4 KB to 32 KB, in the buffer-length parameter.
Your process can use the second buffer to send or receive a single record while
FastSort transfers a block of records. This feature reduces the time your process waits
for SORTMERGESEND or SORTMERGERECEIVE to complete its operation.
Use buffer2 only if you want nowait I/O. You also need to use the flags2 parameter
in the call to SORTMERGESTART, with the flags2.<15> bit set to 1. Then the
FastSort routines call AWAITIO and switch the buffers when necessary.
For more information about AWAITIO, see the Guardian Procedure Calls Reference
Manual. For more information about nowait I/O, see the Guardian Programmer's
Guide.
Figure 5-1
on page 5-7 shows how FastSort transfers unblocked records between your
process and SORTPROG.
Caution. YIf you use nowait I/O, your process should not call AWAITIO to wait on any file
(filenum=-1). If your application program calls AWAITIOX - 1 while a sort in invoked, the sort
will fail with error 5 (COMMUNICATIONS WITH THE SORT PROCESS HAVE FAILED).