// @HEADER // ***************************************************************************** // Zoltan2: A package of combinatorial algorithms for scientific computing // // Copyright 2012 NTESS and the Zoltan2 contributors. // SPDX-License-Identifier: BSD-3-Clause // ***************************************************************************** // @HEADER /*! \file Zoltan2_EvaluatePartition.hpp * \brief Defines the EvaluatePartition class. */ #ifndef ZOLTAN2_EVALUATEMAPPING_HPP #define ZOLTAN2_EVALUATEMAPPING_HPP #include #include #include namespace Zoltan2{ /*! \brief A class that computes and returns quality metrics. * \todo For some problems it will be necessary to build the * Model again in order to compute metrics. For now * we don't have any problems like that. \todo write a unit test for this class */ template > class EvaluateMapping : public EvaluatePartition { const RCP machine; public: /*! \brief Constructor where communicator is Teuchos default. \param ia the problem input adapter \param p the parameter list \param soln the solution \param graphModel the graph model The constructor does global communication to compute the metrics. The rest of the methods are local. */ EvaluateMapping( const Adapter *ia, ParameterList *p, const RCP > &ucomm_, const MappingSolution *soln, const MachineRep *machine_ , const RCP > &graphModel= Teuchos::null): EvaluatePartition(ia, p, ucomm_, soln, false, graphModel), machine(Teuchos::rcp(machine_, false)){ this->sharedConstructor(ia, p, ucomm_, soln, graphModel); } virtual ~EvaluateMapping(){} protected: virtual void calculate_graph_metrics( const RCP &_env, const RCP > &_problemComm, const RCP > &_graph, const ArrayView &_partArray, typename Adapter::part_t &_numGlobalParts, ArrayRCP > > &_metricsBase, ArrayRCP &_globalSums) { globalWeightedByPart (_env, _problemComm, _graph, _partArray, _numGlobalParts, _metricsBase, _globalSums, true, this->machine); } }; } // namespace Zoltan2 #endif