Multithreaded BFE#
New in version 2.11.
#include <pagmo/batch_evaluators/thread_bfe.hpp>
-
class thread_bfe#
This class is a user-defined batch fitness evaluator (UDBFE) that can be used to construct a
bfe.thread_bfewill use multiple threads of execution to parallelise the evaluation of the fitnesses of a batch of input decision vectors.-
vector_double operator()(problem p, const vector_double &dvs) const#
Call operator.
The call operator will use the input problem p to evaluate the fitnesses of the decision vectors stored contiguously in dvs. The fitness evaluation will be run in parallel using multiple threads of execution. Because of this, the input problem p must provide at least the
basicthread safety level, otherwise an exception will be raised (seepagmo::problem::get_thread_safety()).If p provides at least the
constantthread safety level, then p will be shared across multiple threads and itsfitness()function will be called simultaneously from different threads. Otherwise, copies of p will be created and thefitness()function will be called on these copies.- Parameters
p – the input
problem.dvs – the input decision vectors that will be evaluated.
- Returns
the fitness vectors corresponding to the input decision vectors in dvs.
- Throws
-
std::string get_name() const#
- Returns
a human-readable name for this
thread_bfe.
-
vector_double operator()(problem p, const vector_double &dvs) const#