IODA
DistributionFactory.cc
Go to the documentation of this file.
1 /*
2  * (C) Copyright 2017 UCAR
3  *
4  * This software is licensed under the terms of the Apache Licence Version 2.0
5  * which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
6  */
7 
8 #include "ioda/distribution/DistributionFactory.h"
9 
10 #include "ioda/distribution/InefficientDistribution.h"
11 #include "ioda/distribution/RoundRobin.h"
12 
13 namespace ioda {
14 // -----------------------------------------------------------------------------
15 /*!
16  * \brief create a Distribution object
17  *
18  * \details This method creates a Distribution object from a specified subclass
19  * of the Distribution base class. The purpose of instantiating a subclass
20  * is to get access to a particular method of distributing obs across
21  * multiple process elements.
22  *
23  * \param[in] Comm Local MPI communicator
24  * \param[in] Method Name of the method of distribution of obs.
25  */
26 Distribution * DistributionFactory::createDistribution(const eckit::mpi::Comm & Comm,
27  const std::string & Method) {
28  if (Method == "RoundRobin") {
29  return new RoundRobin(Comm);
30  } else if (Method == "InefficientDistribution") {
31  return new InefficientDistribution(Comm);
32  } else {
33  return NULL;
34  }
35 }
36 
37 // -----------------------------------------------------------------------------
38 
39 } // namespace ioda
ioda::Distribution
class for distributing obs across multiple process elements
Definition: src/distribution/Distribution.h:30
ioda::DistributionFactory::createDistribution
Distribution * createDistribution(const eckit::mpi::Comm &Comm, const std::string &Method)
create a Distribution object
Definition: DistributionFactory.cc:26
ioda
Definition: IodaUtils.cc:13
ioda::InefficientDistribution
Inefficient distribution.
Definition: InefficientDistribution.h:29
ioda::RoundRobin
Round robin distribution.
Definition: RoundRobin.h:29