Zoltan2
Loading...
Searching...
No Matches
Zoltan2_EvaluateMapping.hpp
Go to the documentation of this file.
1// @HEADER
2// *****************************************************************************
3// Zoltan2: A package of combinatorial algorithms for scientific computing
4//
5// Copyright 2012 NTESS and the Zoltan2 contributors.
6// SPDX-License-Identifier: BSD-3-Clause
7// *****************************************************************************
8// @HEADER
9
14#ifndef ZOLTAN2_EVALUATEMAPPING_HPP
15#define ZOLTAN2_EVALUATEMAPPING_HPP
16
20
21namespace Zoltan2{
22
30template<typename Adapter,
31 typename MachineRep = // Default MachineRep type
32 MachineRepresentation<typename Adapter::scalar_t,
33 typename Adapter::part_t> >
34class EvaluateMapping : public EvaluatePartition<Adapter> {
35
36
37 const RCP <const MachineRep> machine;
38public:
39
49 const Adapter *ia,
50 ParameterList *p,
51 const RCP<const Comm<int> > &ucomm_,
52 const MappingSolution<Adapter> *soln,
53 const MachineRep *machine_ ,
54 const RCP<const GraphModel<typename Adapter::base_adapter_t> > &graphModel= Teuchos::null):
55 EvaluatePartition<Adapter>(ia, p, ucomm_, soln, false, graphModel),
56 machine(Teuchos::rcp(machine_, false)){
57 this->sharedConstructor(ia, p, ucomm_, soln, graphModel);
58 }
59
60 virtual ~EvaluateMapping(){}
61
62protected:
64 const RCP<const Environment> &_env,
65 const RCP<const Comm<int> > &_problemComm,
66 const RCP<const GraphModel<typename Adapter::base_adapter_t> > &_graph,
67 const ArrayView<const typename Adapter::part_t> &_partArray,
68 typename Adapter::part_t &_numGlobalParts,
69 ArrayRCP<RCP<BaseClassMetrics<typename Adapter::scalar_t> > > &_metricsBase,
70 ArrayRCP<typename Adapter::scalar_t> &_globalSums) {
71 globalWeightedByPart <Adapter,MachineRep>(_env,
72 _problemComm, _graph, _partArray, _numGlobalParts, _metricsBase,
73 _globalSums, true, this->machine);
74 }
75};
76
77} // namespace Zoltan2
78
79#endif
Defines the EvaluatePartition class.
Defines the MappingSolution class.
A class that computes and returns quality metrics.
EvaluateMapping(const Adapter *ia, ParameterList *p, const RCP< const Comm< int > > &ucomm_, const MappingSolution< Adapter > *soln, const MachineRep *machine_, const RCP< const GraphModel< typename Adapter::base_adapter_t > > &graphModel=Teuchos::null)
Constructor where communicator is Teuchos default.
virtual void calculate_graph_metrics(const RCP< const Environment > &_env, const RCP< const Comm< int > > &_problemComm, const RCP< const GraphModel< typename Adapter::base_adapter_t > > &_graph, const ArrayView< const typename Adapter::part_t > &_partArray, typename Adapter::part_t &_numGlobalParts, ArrayRCP< RCP< BaseClassMetrics< typename Adapter::scalar_t > > > &_metricsBase, ArrayRCP< typename Adapter::scalar_t > &_globalSums)
A class that computes and returns quality metrics.
void sharedConstructor(const Adapter *ia, ParameterList *p, const RCP< const Comm< int > > &problemComm, const PartitioningSolution< Adapter > *soln, const RCP< const GraphModel< typename Adapter::base_adapter_t > > &graphModel)
GraphModel defines the interface required for graph models.
PartitionMapping maps a solution or an input distribution to ranks.
Created by mbenlioglu on Aug 31, 2020.