User Guide
The package
QNSTOP
is a suite of serial and parallel Fortran 95/2003 codes
for deterministic global optimization and stochastic optimization, with
the serial driver subroutine QNSTOPS
and the parallel driver subroutine QNSTOPP
Due to the limitations of OpenMP
threads, the logic in the parallel
code QNSTOPP
is rather different from that
in the serial code QNSTOPS
without any OpenMP
directives.
The subroutines QNSTOP{S|P}
are
Fortran 95/2003 implementations of the bound constrained
quasi-Newton stochastic optimization algorithm QNSTOP
from Indiana University.
The subroutines QNSTOP{S|P}
use the module
REAL_PRECISION
from HOMPACK90
(ACM TOMS Algorithm 777) for specifying the real data type,
and the module ZIGARRAY
to provide normally
distributed random numbers using the ziggurat algorithm.
The modules QNSTOP{S|P}_MOD
(files
qnstop{s|p}.f95
) contain the driver
subroutines QNSTOP{S|P}
, data type declarations, and
auxiliary subroutines and functions.
Comments at the beginning of the driver subroutines
QNSTOP{S|P}
document the arguments and usage.
The physical organization into files is as follows.
- The file
qnstops.f95
contains the moduleQNSTOPS_MOD
, which includes the serial driver subroutineQNSTOPS
and auxiliary procedures. - The file
qnstopp.f95
contains the moduleQNSTOPP_MOD
, which includes the parallel driver subroutineQNSTOPP
and auxiliary procedures. - The file
real_precision.f95
contains the moduleREAL_PRECISION
. - The file
zigarray.f95
contains the moduleZIGARRAY
. - The file
sample_main_s.f95
contains a sample main program illustrating the usage ofQNSTOPS
, and also verifies the installation by callingQNSTOPS
to minimize the Griewank function, defined within this file. - The file
sample_main_p.f95
contains a sample main program illustrating the usage ofQNSTOPP
, and also verifies the installation by callingQNSTOPP
to minimize the Griewank function, defined within this file. - The files
blas.f
andlapack.f
contain just the necessaryBLAS
andLAPACK
routines, in case the completeBLAS
andLAPACK
libraries are not available.
The modules REAL_PRECISION
and ZIGARRAY
are
in separate files because they may be of interest independent of
QNSTOP
.
To compile and link, use the command (where {s|p}
means either
s
(serial) or p
(parallel))
$f95 $OPTS real_precision.f95 zigarray.f95 qnstop{s|p}.f95 sample_main_{s|p}.f95 -o sample_main_{s|p} $LIB
where $f95
is the name of the Fortran 95/2003 compiler,
$OPTS
are compiler options, and $LIB
are
flags to link LAPACK
and BLAS
. If the
LAPACK
and BLAS
libraries are not available
on your system, then replace $LIB
with the filenames
blas.f lapack.f
; these provided files contain just the
necessary routines from the BLAS
and LAPACK
libraries. Then execute
./sample_main_{s|p}
to test the installation.
To call QNSTOP{S|P}
from your program, include the
Fortran statement USE QNSTOP{S|P}_MOD
and provide an
interface block to your objective function similar to that for the
Griewank function in sample_main_s.f95
.
Notes: the file duni_omp.f95
, unrelated to
QNSTOP{S|P}
, contains a parallel OpenMP
version of a high quality random number generator QNSTOPP
argument OMP > 0
and the objective
function evaluation involves a stochastic simulation.