Documentation for module cp_lbfgs_optimizer_gopt

routines that optimize a functional using the limited memory bfgs quasi-newton method. The process set up so that a master runs the real optimizer and the others help then to calculate the objective function. The arguments for the objective function are physicaly present in every processor (nedeed in the actual implementation of pao). In the future tha arguments themselves could be distributed.

source: cp_lbfgs_optimizer_gopt.F
Loading...

public Types:

cp_lbfgs_opt_gopt_type
info for the optimizer (see the description of this module)

public Subroutines/Functions:

initializes the optimizer
goes to the next optimal point (after an optimizer iteration) returns true if converged
releases the optimizer (see doc/ReferenceCounting.html)
stops the optimization

public Types:

TYPE :: cp_lbfgs_opt_gopt_type

info for the optimizer (see the description of this module)


CHARACTER(60)
:: task the actual task of the optimizer (in the master it is up to date, in case of error also the slaves one get updated.
CHARACTER(60)
:: csave internal character string used by the lbfgs optimizer, meaningful only in the master
LOGICAL
:: lsave logical array used by the lbfgs optimizer, updated only in the master On exit with task = 'NEW_X', the following information is available: lsave(1) = .true. the initial x did not satisfy the bounds; lsave(2) = .true. the problem contains bounds; lsave(3) = .true. each variable has upper and lower bounds.
INTEGER
:: m the dimension of the subspace used to approximate the second derivative
INTEGER
:: print_every every how many iterations output should be written. if 0 only at end, if print_every<0 never
INTEGER
:: master the pid of the master processor
INTEGER
:: max_f_per_iter the maximum number of function evaluations per iteration
INTEGER
:: status 0: just initialized, 1: f g calculation, 2: begin new iteration, 3: ended iteration, 4: normal (converged) exit, 5: abnormal (error) exit, 6: daellocated
INTEGER
:: n_iter the actual iteration number
INTEGER
:: ref_count reference count (see doc/ReferenceCounting.html)
INTEGER
:: id_nr identification number (unique)
INTEGER,
DIMENSION(:), POINTER :: kind_of_bound an array with 0 (no bound), 1 (lower bound), 2 (both bounds), 3 (upper bound), to describe the bounds of every variable
INTEGER,
DIMENSION(:), POINTER :: i_work_array an integer workarray of dimension 3*n, present only in the master
INTEGER,
DIMENSION(:), POINTER :: isave (39) = the number of active constraints at the current iteration;
REAL(dp)
:: f the actual best value of the object function
REAL(dp)
:: wanted_relative_f_delta the wanted relative error on f (to be multiplied by epsilon), 0.0 -> no check
REAL(dp)
:: wanted_projected_gradient the wanted error on the projected gradient (hessian times the gradient), 0.0 -> no check
REAL(dp)
:: last_f the value of f in the last iteration
REAL(dp)
:: projected_gradient the value of the sup norm of the projected gradient
REAL(dp)
:: eold ...
REAL(dp)
:: emin ...
REAL(dp)
:: trust_radius ...
REAL(dp),
DIMENSION(:), POINTER :: x the actual evaluation point (best one if converged or stopped)
REAL(dp),
DIMENSION(:), POINTER :: lower_bound the lower bounds
REAL(dp),
DIMENSION(:), POINTER :: upper_bound the upper bounds
REAL(dp),
DIMENSION(:), POINTER :: gradient the actual gradient
REAL(dp),
DIMENSION(:), POINTER :: dsave info date for lbfgs (master only)
REAL(dp),
DIMENSION(:), POINTER :: work_array a work array for lbfgs (master only)
POINTER :: para_env the parallel environment for this optimizer
POINTER :: obj_funct the objective function to be optimized

SUBROUTINEcp_opt_gopt_create(optimizer, para_env, obj_funct, x0, m, print_every, wanted_relative_f_delta, wanted_projected_gradient, lower_bound, upper_bound, kind_of_bound, master, max_f_per_iter, trust_radius)

initializes the optimizer

Arguments:
POINTER
:: optimizer ...
POINTER
:: para_env ...
POINTER
:: obj_funct ...
REAL(dp),
INTENT(in)
:: x0(:) ...
INTEGER,
INTENT(in),
OPTIONAL
:: m ...
INTEGER,
INTENT(in),
OPTIONAL
:: print_every ...
REAL(dp),
INTENT(in),
OPTIONAL
:: wanted_relative_f_delta ...
REAL(dp),
INTENT(in),
OPTIONAL
:: wanted_projected_gradient ...
REAL(dp),
INTENT(in),
OPTIONAL
:: lower_bound(size(x0)) ...
REAL(dp),
INTENT(in),
OPTIONAL
:: upper_bound(size(x0)) ...
INTEGER,
INTENT(in),
OPTIONAL
:: kind_of_bound(size(x0)) ...
INTEGER,
INTENT(in),
OPTIONAL
:: master ...
INTEGER,
INTENT(in),
OPTIONAL
:: max_f_per_iter ...
REAL(dp),
INTENT(in),
OPTIONAL
:: trust_radius ...

RECURSIVE FUNCTIONcp_opt_gopt_next(optimizer, n_iter, f, last_f, projected_gradient, converged, geo_section, force_env, gopt_param)

goes to the next optimal point (after an optimizer iteration) returns true if converged

Return Value ::
LOGICAL
Arguments:
POINTER
:: optimizer the optimizer that goes to the next point
INTEGER,
INTENT(out),
OPTIONAL
:: n_iter ...
REAL(dp),
INTENT(out),
OPTIONAL
:: f ...
REAL(dp),
INTENT(out),
OPTIONAL
:: last_f ...
REAL(dp),
INTENT(out),
OPTIONAL
:: projected_gradient ...
LOGICAL,
INTENT(out)
:: converged ...
POINTER
:: geo_section ...
POINTER
:: force_env ...
POINTER
:: gopt_param ...

SUBROUTINEcp_opt_gopt_release(optimizer)

releases the optimizer (see doc/ReferenceCounting.html)

Arguments:
POINTER
:: optimizer the object that should be released

SUBROUTINEcp_opt_gopt_stop(optimizer)

stops the optimization

Arguments:
POINTER
:: optimizer ...