Skip to main content
Ctrl+K

ODAT-SE API documentation

  • odatse
  • odatse

Section Navigation

  • odatse package
    • odatse.algorithm package
      • odatse.algorithm._algorithm module
      • odatse.algorithm._iterator module
      • odatse.algorithm.bayes module
      • odatse.algorithm.exchange module
      • odatse.algorithm.gather module
      • odatse.algorithm.global_search module
      • odatse.algorithm.mapper_mpi module
      • odatse.algorithm.mapper_mpi_base module
      • odatse.algorithm.min_search module
      • odatse.algorithm.montecarlo module
      • odatse.algorithm.pamc module
      • odatse.algorithm.random_search module
      • odatse.algorithm.state module
      • odatse.algorithm.ttopt module
    • odatse.domain package
      • odatse.domain._domain module
      • odatse.domain.meshgrid module
      • odatse.domain.region module
    • odatse.scripts package
      • odatse.scripts.extract_combined module
      • odatse.scripts.plt_1D_histogram module
      • odatse.scripts.plt_2D_histogram module
      • odatse.scripts.plt_model_evidence module
      • odatse.scripts.separateT module
      • odatse.scripts.summarize_each_T module
    • odatse.solver package
      • odatse.solver._solver module
      • odatse.solver.analytical module
      • odatse.solver.function module
    • odatse.util package
      • odatse.util.data_writer module
      • odatse.util.graph module
      • odatse.util.limitation module
      • odatse.util.logger module
      • odatse.util.mapping module
      • odatse.util.neighborlist module
      • odatse.util.read_matrix module
      • odatse.util.read_ts module
      • odatse.util.resampling module
      • odatse.util.separateT module
      • odatse.util.toml module
      • odatse.util.version module
    • odatse.__main__ module
    • odatse._info module
    • odatse._initialize module
    • odatse._main module
    • odatse._runner module
    • odatse._version module
    • odatse.exception module
    • odatse.mpi module
  • odatse
  • odatse package
  • odatse.algorithm package
  • odatse.algorithm.global_search module

odatse.algorithm.global_search module#

class odatse.algorithm.global_search.Algorithm(info: Info, runner: Runner = None, domain=None, run_mode: str = 'initial')[source]#

Bases: AlgorithmBase

Algorithm class for global optimization using scipy.optimize routines.

The optimization method is selected by the method parameter in the [algorithm.global_search] section. Currently implemented:

  • “DE” / “differential_evolution”: scipy.optimize.differential_evolution

  • “shgo”: scipy.optimize.shgo

  • “direct”: scipy.optimize.direct

  • “dual_annealing”: scipy.optimize.dual_annealing

The per-method differences (aliases, seed and workers handling, callback signature, defaults, output files) are described by the module-level _METHODS table.

All other entries of the section are passed verbatim as arguments of the selected scipy routine; argument names the routine does not accept abort before the optimization starts.

MPI parallelization uses a master-worker layout over the algorithm communicator: algorithm rank 0 drives the scipy optimizer, whose workers hook scatters candidate points (for DE, a whole generation at a time) to all algorithm ranks; the other ranks run an evaluation-server loop, evaluating their share of the points with their own solver group. This composes with solver-side parallelism (nsolve): the total parallelism is algsize (points) x nsolve (per point). The direct and dual_annealing methods do not support parallel evaluation and run entirely on rank 0.

Initialize the Algorithm class.

Parameters:
  • info (Info) – Information object containing algorithm settings.

  • runner (Runner) – Runner object for submitting jobs.

  • domain – Domain object defining the search space.

  • run_mode (str) – Mode of running the algorithm.

__init__(info: Info, runner: Runner = None, domain=None, run_mode: str = 'initial') → None[source]#

Initialize the Algorithm class.

Parameters:
  • info (Info) – Information object containing algorithm settings.

  • runner (Runner) – Runner object for submitting jobs.

  • domain – Domain object defining the search space.

  • run_mode (str) – Mode of running the algorithm.

_initialize() → None[source]#

Set up initial state for a fresh run.

The global search does not use checkpointing, so this is a no-op.

_output_results()[source]#

Output the results of the optimization to files.

Every algorithm rank writes the history of its own function evaluations; the iteration history and the result summary exist only on rank 0, which drove the optimizer.

_post()[source]#

Post-process the results after optimization.

_prepare() → None[source]#

Algorithm-specific preparation, called after dispatch.

Override in subclasses to perform setup that must happen after the checkpoint state is established (e.g. initialising timer entries).

_run() → None[source]#

Run the global optimization.

Algorithm rank 0 drives the scipy optimizer; the other algorithm ranks serve function evaluations until rank 0 signals completion.

class odatse.algorithm.global_search._Method(func: Callable | None, requires: str | None, aliases: tuple, uses_seed: bool, supports_workers: bool, callback_style: str, defaults: dict, iter_file: str, iter_header: str)[source]#

Bases: object

Declarative description of one scipy.optimize global routine.

All per-method differences of the algorithm live here, so that adding a method amounts to adding one entry to the _METHODS table (plus tests and documentation); __init__, _run and _output_results are table-driven.

previous

odatse.algorithm.gather module

next

odatse.algorithm.mapper_mpi module

On this page
  • Algorithm
    • Algorithm.__init__()
    • Algorithm._initialize()
    • Algorithm._output_results()
    • Algorithm._post()
    • Algorithm._prepare()
    • Algorithm._run()
  • _Method
Show Source

© Copyright 2020-, ISSP, UTokyo.

Created using Sphinx 9.0.4.

Built with the PyData Sphinx Theme 0.20.0.