/usr/include/trilinos/Zoltan2_Algorithm.hpp is in libtrilinos-zoltan2-dev 12.10.1-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 | // @HEADER
//
// ***********************************************************************
//
// Zoltan2: A package of combinatorial algorithms for scientific computing
// Copyright 2012 Sandia Corporation
//
// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
// the U.S. Government retains certain rights in this software.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// 1. Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
//
// 3. Neither the name of the Corporation nor the names of the
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// Questions? Contact Karen Devine (kddevin@sandia.gov)
// Erik Boman (egboman@sandia.gov)
// Siva Rajamanickam (srajama@sandia.gov)
//
// ***********************************************************************
//
// @HEADER
/*! \file Zoltan2_BaseAdapter.hpp
\brief Defines the Adapter interface for accessing user data.
*/
#ifndef _ZOLTAN2_ALGORITHM_HPP_
#define _ZOLTAN2_ALGORITHM_HPP_
namespace Zoltan2 {
template <typename Adapter>
class Algorithm;
}
#include <Zoltan2_Standards.hpp>
#include <Zoltan2_ColoringSolution.hpp>
#include <Zoltan2_OrderingSolution.hpp>
#include <Zoltan2_PartitioningSolution.hpp>
#include <Zoltan2_MappingSolution.hpp>
#include <Zoltan2_CoordinatePartitioningGraph.hpp>
namespace Zoltan2 {
//! \brief Algorithm defines the base class for all algorithms.
//
// Algorithms do not have to implement all methods in the Algorithm base
// class. They should implement only those methods that are relevant.
// For example AlgScotch might implement partition() and order(), while
// AlgMJ might implement partition() and boxAssign().
// Default implementations throw a "not implemented" error
template <typename Adapter>
class Algorithm {
public:
typedef typename Adapter::lno_t lno_t;
typedef typename Adapter::gno_t gno_t;
typedef typename Adapter::scalar_t scalar_t;
typedef typename Adapter::part_t part_t;
// Virtual destructor needed to avoid undefined behavior and compiler warnings
virtual ~Algorithm() {}
//! \brief Ordering method
virtual int order(const RCP<OrderingSolution<lno_t, gno_t> > &solution)
{
Z2_THROW_NOT_IMPLEMENTED
}
//! \brief Coloring method
virtual void color(const RCP<ColoringSolution<Adapter> > &solution)
{
Z2_THROW_NOT_IMPLEMENTED
}
//! \brief Matching method
virtual void match() {
Z2_THROW_NOT_IMPLEMENTED
}
//! \brief Partitioning method
virtual void partition(const RCP<PartitioningSolution<Adapter> > &solution)
{
Z2_THROW_NOT_IMPLEMENTED
}
//! \brief Mapping method
virtual void map(const RCP<MappingSolution<Adapter> > &solution)
{
Z2_THROW_NOT_IMPLEMENTED
}
//! \brief for partitioning methods, return bounding boxes of the
// computed parts
// Not all partitioning algorithms will support
// this method.
//
virtual std::vector<coordinateModelPartBox<scalar_t, part_t> > &
getPartBoxesView() const
{
Z2_THROW_NOT_IMPLEMENTED
}
//! \brief pointAssign method: Available only for some partitioning algorithms
// when a point lies on a part boundary, the lowest part
// number on that boundary is returned.
// Not all partitioning algorithms will support
// this method.
//
// \param dim : the number of dimensions specified for the point in space
// \param point : the coordinates of the point in space; array of size dim
// \return the part number of a part overlapping the given point
virtual part_t pointAssign(int dim, scalar_t *point) const
{
Z2_THROW_NOT_IMPLEMENTED
}
//! \brief boxAssign method: Available only for some partitioning algorithms
// Return an array of all parts overlapping a given box in space.
// This method allocates memory for the return argument, but does not
// control that memory. The user is responsible for freeing the
// memory.
//
// \param dim : (in) the number of dimensions specified for the box
// \param ptLower : (in) the coordinates of the lower corner of the box;
// array of size dim
// \param ptUpper : (in) the coordinates of the upper corner of the box;
// array of size dim
// \param nParts : (out) the number of parts overlapping the box
// \param parts : (out) array of parts overlapping the box
virtual void boxAssign(int dim, scalar_t *lower, scalar_t *upper,
size_t &nParts, part_t **partsFound) const
{
Z2_THROW_NOT_IMPLEMENTED
}
//! \brief returns serial communication graph of a computed partition
// Returned graph is identical on all processors, and represents the
// global communication pattern in the partition.
//
// \param comXAdj: (out) the offset array: offsets into comAdj
// Format is standard CSR format:
// # nbor parts of part i = comXAdj[i+1]-comXAdj[i]
// That is, comXAdj[i] = Sum of # nbor parts of parts
// 0 through i-1
// \param comAdj (out) the neighboring parts
virtual void getCommunicationGraph(
const PartitioningSolution<Adapter> *solution,
ArrayRCP<part_t> &comXAdj,
ArrayRCP<part_t> &comAdj)
// TODO: Should the return args be ArrayViews?
{
Z2_THROW_NOT_IMPLEMENTED
}
//! \brief In mapping, returns the rank to which a part is assigned
// \param p: (in) the part for which the rank is sought
// This method need not be implemented by every algorithm or, indeed,
// for every mapping algorithm. Mapping algorithms may provide this
// function to prevent additional memory use in MappingSolution.
// For example, AlgContiguousMapping can compute this function implicitly,
// with no additional storage. However, Mapping algorithms can skip this
// function and, instead, register their results in MappingSolution.
virtual int getRankForPart(part_t p)
{
Z2_THROW_NOT_IMPLEMENTED
}
//! \brief In mapping, returns a view of parts assigned to the current rank
// \param numParts: (out) the number of parts assigned to the current rank
// \param parts: (out) a view of the assigned parts
//
// This method need not be implemented by every algorithm or, indeed,
// for every mapping algorithm. Mapping algorithms may provide this
// function to prevent additional memory use in MappingSolution.
// For example, AlgContiguousMapping can compute this function implicitly,
// with no additional storage. However, Mapping algorithms can skip this
// function and, instead, register their results in MappingSolution.
virtual void getMyPartsView(part_t &numParts, part_t *&parts)
{
Z2_THROW_NOT_IMPLEMENTED
}
private:
};
} //namespace Zoltan2
#endif
|