README File for Integer Sort Benchmark
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

The file buk.f is a Fortran 77 source file which sorts a disordered
sequence of N integer keys with key values in the range [0,MAXKEY).  To
run, compile using the supplied Makefile.

To scale up the problem size, two parameters need to be changed.  The
number of keys to be sorted must be changed, this value is stored in the
variable N in the source, and the range of key values needs to be changed, 
this value is stored in the variable MAXKEY.

The source code includes routines to check the Sample, Class A and Class B
size benchmarks.  Three output files are included in this directory, 
'buk.sample.out', 'buk.A.out', and 'buk.B.out'.  The first is for the 
Sample problem, the second is for the Class A problem, and the third
corresponds to the Class B size problem.  Note that for each iteration
there is a partial verification of the ranking.  The file buk.B.out was
generated with the buk_dsk.f version described below.

Integer Sort Benchmark (Out of Core Implementation)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

The file buk_dsk.f is a Fortran 77 source file which sorts a disordered
sequence of N integer keys with key values in the range [0,MAXKEY).  To
run, compile with:  f77 -extend_source -o buk_dsk buk_dsk.f
and run as: buk_dsk

The code is not written in standard Fortran 77.  The code makes use
of the 'malloc' procedure provided in Sun and SGI versions of F77.
Most modern versions of F77 have some such procedure and so the code
should be easily adaptable to run on different systems.  Also, the
code has some lines longer than 72 characters, the '-extend_source'
flag is necessary for the compiler to interpret the code as 132 character
lines.  Again, most modern compilers include this feature.

A somewhat confusing issue with the F77 malloc is that it in the
procedure that calls malloc, the allocated array is indexed
in the Fortran style starting from 1, however the benchmark 
specification (and the way BUK was written), the arrays are 
indexed in the C style starting from 0.  For this reason, references
to 'rank' and 'key2' in the main procedure of BUK_DSK differ from
those in BUK.

To scale up the problem size, two parameters need to be changed.  The
number of keys to be sorted must be changed, this value is stored in the
variable N in the source, and the range of key values needs to be changed, 
this value is stored in the variable MAXKEY.

The main difference between this code and the BUK code is that only half
of the 'rank' array, and one quarter of the 'key2' array are kept in
local memory, and disk memory is used for the rest.  This means that
the code should need about 5N bytes (N is the number of keys) to run,
(compared to 12N bytes for the BUK code).  This also means that the
system needs to have 7N bytes of disk space available.  For the Class B
size benchmark N is equal to 32 million.

The source code includes routines to check the reduced scale, and the Class A
and B size benchmark.  

Two sample output files follow.  The first is for the Class A problem,
and the second is for the Class B problem.  Note that for each iteration
there is a partial verification of the ranking.


============= SAMPLE OUTPUT FOR CLASS A BENCHMARK ====================

 Begin iteration            1
 PASSED partial verification test
 Begin iteration            2
 PASSED partial verification test
 Begin iteration            3
 PASSED partial verification test
 Begin iteration            4
 PASSED partial verification test
 Begin iteration            5
 PASSED partial verification test
 Begin iteration            6
 PASSED partial verification test
 Begin iteration            7
 PASSED partial verification test
 Begin iteration            8
 PASSED partial verification test
 Begin iteration            9
 PASSED partial verification test
 Begin iteration           10
 PASSED partial verification test
 Performed           10 rankings in time:    719.1899    
 writing out key sequence
 reading in 1st half of rank array
 reading in 1st quarter of key array
 reading in 2nd quarter of key array
 reading in 2nd half of rank array
 reading in 3rd quarter of key array
 reading in 4th quarter of key array
            0 keys with val -1
   
 PASSED:   0 out of place.

============= SAMPLE OUTPUT FOR CLASS B BENCHMARK ====================

 Begin iteration            1
 PASSED partial verification test
 Begin iteration            2
 PASSED partial verification test
 Begin iteration            3
 PASSED partial verification test
 Begin iteration            4
 PASSED partial verification test
 Begin iteration            5
 PASSED partial verification test
 Begin iteration            6
 PASSED partial verification test
 Begin iteration            7
 PASSED partial verification test
 Begin iteration            8
 PASSED partial verification test
 Begin iteration            9
 PASSED partial verification test
 Begin iteration           10
 PASSED partial verification test
 Performed           10 rankings in time:    3309.050    
 writing out key sequence
 reading in 1st half of rank array
 reading in 1st quarter of key array
 reading in 2nd quarter of key array
 reading in 2nd half of rank array
 reading in 3rd quarter of key array
 reading in 4th quarter of key array
            0 keys with val -1
   
 PASSED:   0 out of place.
