OPAL (Object Oriented Parallel Accelerator Library) 2022.1
OPAL
Optimizer.h
Go to the documentation of this file.
1//
2// Class Optimizer
3// An abstract class defining the interface for all optimizer
4// components.
5//
6// Copyright (c) 2010 - 2013, Yves Ineichen, ETH Zürich
7// All rights reserved
8//
9// Implemented as part of the PhD thesis
10// "Toward massively parallel multi-objective optimization with application to
11// particle accelerators" (https://doi.org/10.3929/ethz-a-009792359)
12//
13// This file is part of OPAL.
14//
15// OPAL is free software: you can redistribute it and/or modify
16// it under the terms of the GNU General Public License as published by
17// the Free Software Foundation, either version 3 of the License, or
18// (at your option) any later version.
19//
20// You should have received a copy of the GNU General Public License
21// along with OPAL. If not, see <https://www.gnu.org/licenses/>.
22//
23#ifndef __OPTIMIZER_H__
24#define __OPTIMIZER_H__
25
26#include <vector>
27
28#include "Util/Types.h"
29#include "Pilot/Poller.h"
30
31class Optimizer : protected Poller {
32
33public:
34
35 Optimizer(MPI_Comm comm) : Poller(comm) {}
36 virtual ~Optimizer() {}
37
39 typedef std::vector< std::pair<double, double> > bounds_t;
40
42 virtual void initialize() = 0;
43
44protected:
45
46 // propagate poller hooks
47 virtual void setupPoll() = 0;
48 virtual void prePoll() = 0;
49 virtual void postPoll() = 0;
50 virtual void onStop() = 0;
51 virtual bool onMessage(MPI_Status status, size_t length) = 0;
52
53private:
54
55};
56
57#endif
virtual void postPoll()=0
executed after handling (if any) new request
virtual void setupPoll()=0
executed before starting polling loop
std::vector< std::pair< double, double > > bounds_t
type of bounds for design variables
Definition: Optimizer.h:39
Optimizer(MPI_Comm comm)
Definition: Optimizer.h:35
virtual void prePoll()=0
executed before checking for new request
virtual ~Optimizer()
Definition: Optimizer.h:36
virtual void onStop()=0
enable implementation to react to STOP tag
virtual bool onMessage(MPI_Status status, size_t length)=0
virtual void initialize()=0
entry point for optimizer
Definition: Poller.h:35