[READ.ME]

This subdirectory contains the version of the BTN software suitable for both
scalar (ordinary) computers and for the Sequent Balance and Symmetry (shared
memory) parallel computers.  The commands that control parallelism on the
Sequent will be interpreted as comments by Fortran compilers.

THE FOLLOWING FILES ARE INCLUDED:

   read.me      - this file
   btnlib.f     - subroutines for optimization
   chklib.f     - subroutines for checking derivatives
   basics.f     - lower-level routines
   d1mach.f     - routine to evaluate machine constants
   main1.f      - sample main program 1
   main2.f      - sample main program 2
   main3.f      - sample main program 3
   main3.d      - data file for main3.f
   main4.f      - sample main program 4
   makep        - "make" file for parallel execution on the Sequent computers
   makes        - "make" file for scalar   execution on the Sequent computers
   makeu        - "make" file for scalar   execution on many Unix computers
   install.com  - "command" file to compile and link a main program for
                  VAX VMS computers

Main programs 1-4 are analogs of the sample programs in the guide to the BTN
software.

TO RUN THE SOFTWARE:

   On a Unix system:  Set the machine constants in d1mach.f [see below]
                      Copy the appropriate "make" file to "makefile"
                      Copy the desired main program to "main.f"
                      Type "make"
                      Type "main"
   On a VMS system:   Set the machine constants in d1mach.f [see below]
                      Copy the desired main program to "main.f"
                      Type "@install"
                      Type "run main"


SETTING THE MACHINE CONSTANTS:

Routine D1MACH in file d1mach.f sets five machine constants associated with
double-precision arithmetic.  Constants for many computers are already listed
in the file - if yours is there, you need only "uncomment" the DATA statements
for your computer and "comment out" the DATA statements for the Sequent
Balance.

If your computer is not listed, then you must determine the appropriate
machine constants.  BTN only used D1MACH(3), and (on binary computers) an
adequate value for D1MACH(3) can usually be determined using the following
Fortran program:
      IMPLICIT DOUBLE PRECISION (A-H,O-Z)
      EPS    = 5.D-1
      OLDEPS = 1.0D0
10    EPS1   = 1.D0 + EPS
      IF (EPS1 .EQ. 1.D0) GO TO 20
      OLDEPS = EPS
      EPS    = EPS * 5.D-1
      GO TO 10
20    WRITE (*,*) ' D1MACH(3) = ', OLDEPS
      STOP
      END

WARNINGS:

1.  If run on a "scalar" computer, BTN will be simulating the performance of a
parallel computer, with the work of multiple processors being done
sequentially by a single processor.
2.  When run in parallel, two consecutive runs of the same program can produce
different results, since different rounding errors can occur.  This does not
indicate a problem with the program, but is rather an artifact of parallel
computing.
3.  The parallel computing software was prepared using version 3.0 of the
Dynix operating system on the Sequent Balance computer (Dynix V3.0.17.9).
It was compiled using the ATS fortran compiler (version 1.8.0). The "parallel"
commands are not part of the Fortran 77 language and are not standardized.
They may not work correctly under different versions of the operating system,
or with different fortran compilers.
4.  The fortran compiler mentioned in item 3 did not always produce correct
executable code when the floating-point accelerator on the Sequent Symmetry
was used.  In particular, it did not compile correctly when the following
three compiler options were simultaneously selected (however, any two of these
options can be selected without problems):
    a) [-mp] parallel processing
    b) [-fpa] the floating point accelerator
    c) [-O1 or higher] optimized compiling at higher than level 0 (since
       default optimization is at higher than level 0, you must compile
       using (say): fortran -c main.f -mp -fpa -O0, if you want to run
       in parallel using the floating-point accelerator)
5.  The sample main programs declare work arrays for problems with at most 100
variables, and for computers with at most 10 processors.  The PARAMETER
statements should be adjusted, increasing the values of N and NDMX, if these
values are not appropriate.
6.  Usage of the CUBE and SEQUENT versions is slightly different.  A list of
differences is given below.

DIFFERENCES BETWEEN CUBE AND SEQUENT VERSIONS

1.  The CUBE version requires an integer work array: INTEGER IW(3*NDMX)
    [NDMX is the maximum number of processors available]
2.  The CUBE version requires a real work array of different length:
    CUBE:    REAL W(14*N+NDMX*(4*NDMX+9))
    SEQUENT: REAL W((3+7*NDMX)*(N+NDMX))
    [N is the number of variables in the problem]
3.  The calls to the subroutines are slightly different:
    CUBE:
        CALL CHKEZ  (N, X, F, G, W, LW, IW, SFUN, IFLAG, ERRMAX, IMAX)
        CALL CHKDER (N, X, F, G, W, LW, IW, SFUN, IFLAG, NDMX, KMAX, ...)
        CALL BTNEZ  (N, X, F, G, W, LW, IW, SFUN, IFLAG)
        CALL BTNPAR (NODEMX, KMAX, MAXIT, MSGLVL, PID, IPREC, ...)
        CALL BTN    (N, X, F, G, W, LW, IW, SFUN, IFLAG,
                     NODEMX, KMAX, MAXIT, MSGLVL, PID, IPREC, ...
    SEQUENT:
        CALL CHKEZ  (N, X, F, G, W, LW,     SFUN, IFLAG, ERRMAX, IMAX)
        CALL CHKDER (N, X, F, G, W, LW,     SFUN, IFLAG,       KMAX, ...)
        CALL BTNEZ  (N, X, F, G, W, LW,     SFUN, IFLAG)
        CALL BTNPAR (NODEMX, KMAX, MAXIT, MSGLVL,      IPREC, ...)
        CALL BTN    (N, X, F, G, W, LW,     SFUN, IFLAG,
                     NODEMX, KMAX, MAXIT, MSGLVL,      IPREC, ...
4. The calling sequence for the user-supplied subroutine is different:
   CUBE:
        SUBROUTINE SFUN (N ,X, F, G, ACTIVE, KBLOCK)
   SEQUENT
        SUBROUTINE SFUN (N ,X, F, G)
   In addition, on the Sequent computers, the SFUN routine must contain the
   line
   C$    PRIVATE
   before its first executable statement.

CONVERSION TO OTHER (SHARED MEMORY) PARALLEL COMPUTERS:

All the commands involving parallelism have the characters "C$" in columns 1
and 2.  Virtually all of them are "DOACROSS" commands, meaning that the
iterations of a Fortran DO loop are to be spread among the processors.  These
"C$" commands must be appropriately converted to corresponding commands on the
target computer.  No other changes should be required.

[END OF FILE READ.ME]
=========================================================================
