8 #include "eckit/config/Configuration.h"
9 #include "ioda/distribution/DistributionFactory.h"
10 #include "oops/util/Logger.h"
18 throw std::runtime_error(
name +
" already registered in the distribution factory");
25 const eckit::Configuration & config) {
26 oops::Log::trace() <<
"Distribution::create starting" << std::endl;
27 const std::string
id = config.getString(
"distribution",
"RoundRobin");
28 typename std::map<std::string, DistributionFactory*>::iterator it =
getMakers().find(
id);
30 throw std::runtime_error(
id +
" does not exist in the distribution factory");
31 std::unique_ptr<Distribution> distribution = it->second->make(comm, config);
32 oops::Log::trace() <<
"Distribution::create done" << std::endl;
static std::map< std::string, DistributionFactory * > & getMakers()
DistributionFactory(const std::string &name)
static std::unique_ptr< Distribution > create(const eckit::mpi::Comm &comm, const eckit::Configuration &config)
Create a Distribution object implementing a particular method of distributing observations across mul...