Zoltan2 Version of the Day
Classes | Typedefs | Enumerations | Functions | Variables
Zoltan2 Namespace Reference

Classes

class  pqJagged_PartVertices
 A helper class containing array representation of coordinate linked lists. More...
class  DebugManager
 DebugManager contains the methods that perform output of debug and status messages. More...
class  Environment
 The user parameters, debug, timing and memory profiling output objects, and error checking methods. More...
class  BasicUserTypes
 A simple class that can be the User template argument for an InputAdapter. More...
struct  InputTraits
 The traits required of User input classes or structures. More...
class  IntegerRangeListValidator
 A ParameterList validator for integer range lists. More...
class  IntegerRangeListValidatorXMLConverter
 XML conversion code for IntegerRangeListValidator. More...
class  MetricOutputManager
 MetricOutputManager handles output of profiling messages. More...
class  TimerManager
class  BasicCoordinateInput
 BasicCoordinateInput represents geometric coordinates that are supplied by the user as pointers to strided arrays. More...
class  BasicIdentifierInput
 This class represents a collection of global Identifiers and their associated weights, if any. More...
class  BasicVectorInput
 BasicVectorInput represents a vector (plus optional weights) supplied by the user as pointers to strided arrays. More...
class  CoordinateInput
 CoordinateInput defines the interface for input geometric coordinates. More...
class  GraphInput
 GraphInput defines the interface for graph input adapters. More...
class  IdentifierInput
 IdentifierInput defines the interface for identifiers. More...
class  InputAdapter
 InputAdapter defines methods required by all InputAdapters. More...
class  MatrixInput
 MatrixInput defines the interface for input adapters for matrices. More...
class  MeshInput
 MeshInput defines the interface for mesh input adapters. More...
class  VectorInput
 VectorInput defines the interface for vector input adapters. More...
class  XpetraCrsGraphInput
 Provides access for Zoltan2 to Xpetra::CrsGraph data. More...
class  XpetraCrsMatrixInput
 Provides access for Zoltan2 to Xpetra::CrsMatrix data. More...
class  XpetraMultiVectorInput
 An input adapter for Xpetra::MultiVector. More...
class  XpetraRowMatrixInput
 Provides access for Zoltan2 to Xpetra::CRowatrix data. More...
struct  XpetraTraits
 Defines the traits required for Tpetra, Eptra and Xpetra objects. More...
class  XpetraVectorInput
 Provides access for Zoltan2 to an Xpetra::Vector. More...
class  CoordinateModel
 This class provides geometric coordinates with optional weights to the Zoltan2 algorithm. More...
class  GraphModel
 GraphModel defines the interface required for graph models. More...
class  IdentifierModel
 IdentifierModel defines the interface for all identifier models. More...
class  Model
 The base class for all model classes. More...
class  OrderingProblem
 OrderingProblem sets up ordering problems for the user. More...
class  OrderingSolution
 The class containing ordering solutions and metrics. More...
class  PartitioningProblem
 PartitioningProblem sets up partitioning problems for the user. More...
class  PartitioningSolution
 A PartitioningSolution is a solution to a partitioning problem. More...
class  Problem
 Problem base class from which other classes (PartitioningProblem, ColoringProblem, OrderingProblem, MatchingProblem, etc.) derive. More...
class  Solution
 Just a placeholder for now. More...
class  GidLookupHelper
 A class to do GID lookups. More...
class  IdentifierMap
 An IdentifierMap manages a global space of object identifiers. More...
class  Zoltan2_MinMaxOperation
 Teuchos reduction operation. More...
struct  UndefIdTraits
 Structure to catch invalid user ID types. More...
struct  IdentifierTraits
 The functions to be defined for users' global ID types. More...
class  MetricValues
 A class containing the metrics for one measurable item. More...
class  PartitioningSolutionQuality
 A class that computes and returns quality metrics. More...
class  StridedData
 The StridedData class manages lists of weights or coordinates. More...

Typedefs

typedef int default_lno_t
typedef double default_scalar_t
typedef int default_gno_t
typedef std::bitset
< NUM_MODEL_FLAGS > 
modelFlag_t
typedef size_t global_size_t
typedef zoltan2_partId_t partId_t
typedef
Kokkos::DefaultNode::DefaultNodeType 
default_node_t

Enumerations

enum  blockParams {
  block_balanceCount, block_balanceWeight, block_minTotalWeight, block_minMaximumWeight,
  block_balanceTotalMaximum, NUM_BLOCK_PARAMS
}
 The boolean parameters of interest to the Block algorithm. More...
enum  rcbParams {
  rcb_balanceCount, rcb_balanceWeight, rcb_minTotalWeight, rcb_minMaximumWeight,
  rcb_balanceTotalMaximum, rcb_averageCuts, rcb_rectilinearBlocks, rcb_multiplePartSizeSpecs,
  NUM_RCB_PARAMS
}
 The boolean parameters of interest to the RCB algorithm. More...
enum  leftRightFlag { unsetFlag = 0xfd, leftFlag = 0xfe, rightFlag = 0xff }
 During partitioning, flags are stored in unsigned char arrays. More...
enum  RangeType { RANGE_INCLUDES_ALL, RANGE_IS_EMPTY, RANGE_IS_LISTED, NUM_RANGE_TYPES }
 Codes that indicate how to interpret the Array<int> representing the user's integer range list. More...
enum  AssertionLevel {
  NO_ASSERTIONS, BASIC_ASSERTION, COMPLEX_ASSERTION, DEBUG_MODE_ASSERTION,
  NUM_ASSERTION_LEVELS
}
 Level of error checking or assertions desired. More...
enum  MessageOutputLevel {
  NO_STATUS, BASIC_STATUS, DETAILED_STATUS, VERBOSE_DETAILED_STATUS,
  NUM_STATUS_OUTPUT_LEVELS
}
 The amount of debugging or status output to print. More...
enum  TimerType {
  NO_TIMERS, MACRO_TIMERS, MICRO_TIMERS, BOTH_TIMERS,
  TEST_TIMERS, NUM_TIMING_OPTIONS
}
 The type of timers which should be active. More...
enum  OSType { COUT_STREAM, CERR_STREAM, NULL_STREAM, NUM_OUTPUT_STREAMS }
 Output stream types. More...
enum  multiCriteriaNorm { normMinimizeTotalWeight, normBalanceTotalMaximum, normMinimizeMaximumWeight, normNumNorms }
 Enumerator used in code for multicriteria norm choice. More...
enum  InputAdapterType {
  InvalidAdapterType = 0, IdentifierAdapterType, VectorAdapterType, CoordinateAdapterType,
  GraphAdapterType, MeshAdapterType, MatrixAdapterType
}
 An enum to identify general types of input adapters. More...
enum  ModelType {
  InvalidModel = 0, HypergraphModelType, GraphModelType, CoordinateModelType,
  IdentifierModelType
}
 An identifier for the general type of model. More...
enum  ModelFlags {
  IDS_MUST_BE_GLOBALLY_CONSECUTIVE, SYMMETRIZE_INPUT_TRANSPOSE, SYMMETRIZE_INPUT_BIPARTITE, VERTICES_ARE_MATRIX_ROWS,
  VERTICES_ARE_MATRIX_COLUMNS, VERTICES_ARE_MATRIX_NONZEROS, VERTICES_ARE_MESH_NODES, VERTICES_ARE_MESH_ELEMENTS,
  SELF_EDGES_MUST_BE_REMOVED, GRAPH_IS_A_SUBSET_GRAPH, NUM_MODEL_FLAGS
}
 Flags are set by a Problem to tell a Model what transformations it may need to do on the user's input. More...
enum  TranslationType { TRANSLATE_APP_TO_LIB, TRANSLATE_LIB_TO_APP }
 Identifier translations available from IdentifierMap. More...

Functions

template<typename Adapter >
int AlgAMD (const RCP< GraphModel< Adapter > > &model, const RCP< OrderingSolution< typename Adapter::gid_t, typename Adapter::lno_t > > &solution, const RCP< Teuchos::ParameterList > &pl, const RCP< Teuchos::Comm< int > > &comm)
template<typename Adapter >
int AlgIncDegree (const RCP< GraphModel< Adapter > > &model, const RCP< OrderingSolution< typename Adapter::gid_t, typename Adapter::lno_t > > &solution, const RCP< Teuchos::ParameterList > &pl, const RCP< Teuchos::Comm< int > > &comm)
template<typename Adapter >
int AlgNatural (const RCP< IdentifierModel< Adapter > > &model, const RCP< OrderingSolution< typename Adapter::gid_t, typename Adapter::lno_t > > &solution, const RCP< Teuchos::ParameterList > &pl, const RCP< Teuchos::Comm< int > > &comm)
template<typename Adapter >
int AlgRandom (const RCP< IdentifierModel< Adapter > > &model, const RCP< OrderingSolution< typename Adapter::gid_t, typename Adapter::lno_t > > &solution, const RCP< Teuchos::ParameterList > &pl, const RCP< Teuchos::Comm< int > > &comm)
template<typename Adapter >
int AlgRCM (const RCP< GraphModel< Adapter > > &model, const RCP< OrderingSolution< typename Adapter::gid_t, typename Adapter::lno_t > > &solution, const RCP< Teuchos::ParameterList > &pl, const RCP< Teuchos::Comm< int > > &comm)
template<typename Adapter >
int AlgSpectral (const RCP< GraphModel< Adapter > > &model, const RCP< OrderingSolution< typename Adapter::gid_t, typename Adapter::lno_t > > &solution, const RCP< Teuchos::ParameterList > &pl, const RCP< const Teuchos::Comm< int > > &comm)
template<typename Adapter >
void AlgBlock (const RCP< const Environment > &env, const RCP< Comm< int > > &problemComm, const RCP< const IdentifierModel< typename Adapter::base_adapter_t > > &ids, RCP< PartitioningSolution< Adapter > > &solution)
template<typename T >
void firstTouch (T *arrayName, size_t arraySize)
template<typename scalar_t >
scalar_t pivotPos (scalar_t *cutUpperBounds, scalar_t *cutLowerBounds, size_t currentCutIndex, scalar_t *cutUpperWeight, scalar_t *cutLowerWeight, scalar_t ew)
 Function that calculates the next pivot position, according to given coordinates of upper bound and lower bound, the weights at upper and lower bounds, and the expected weight.
template<typename T >
void pqJagged_getParameters (const Teuchos::ParameterList &pl, T &imbalanceTolerance, multiCriteriaNorm &mcnorm, std::bitset< NUM_RCB_PARAMS > &params, int &numTestCuts, bool &ignoreWeights, bool &allowNonrectilinear, partId_t &concurrentPartCount, bool &force_binary, bool &force_linear)
 Returns the parameters such as: Partitioning problem parameters of interest: Partitioning objective imbalance_tolerance.
template<typename Adapter >
void pqJagged_getCoordinateValues (const RCP< const CoordinateModel< typename Adapter::base_adapter_t > > &coords, int &coordDim, int &weightDim, size_t &numLocalCoords, global_size_t &numGlobalCoords, int &criteriaDim, const bool &ignoreWeights)
 Returns the input coordinate value parameters.
template<typename Adapter , typename scalar_t , typename gno_t >
void pqJagged_getInputValues (const RCP< const Environment > &env, const RCP< const CoordinateModel< typename Adapter::base_adapter_t > > &coords, RCP< PartitioningSolution< Adapter > > &solution, std::bitset< NUM_RCB_PARAMS > &params, const int &coordDim, const int &weightDim, const size_t &numLocalCoords, size_t &numGlobalParts, int &pqJagged_multiVectorDim, scalar_t **pqJagged_values, const int &criteriaDim, scalar_t **pqJagged_weights, ArrayView< const gno_t > &pqJagged_gnos, bool &ignoreWeights, bool *pqJagged_uniformWeights, bool *pqJagged_uniformParts, scalar_t **pqJagged_partSizes)
 Function returning the input values for the problem such as the coordinates, weights and desiredPartSizes.
template<typename scalar_t , typename gno_t >
void pqJagged_printInput (int coordDim, int weightDim, size_t numLocalCoords, global_size_t numGlobalCoords, int criteriaDim, scalar_t **pqJagged_values, scalar_t **pqJagged_weights, bool *pqJagged_uniformParts, bool *pqJagged_uniformWeights, gno_t *pqJagged_gnos, bool ignoreWeights, size_t numGlobalParts, scalar_t **pqJagged_partSizes)
 Printing the input values, to check configuration.
int pqJagged_getNumThreads ()
 Function returning the available thread number by the processor.
template<typename scalar_t , typename lno_t >
void pqJagged_getLocalMinMaxTotalCoord (lno_t *partitionedPointPermutations, scalar_t *pqJagged_coordinates, bool pqJagged_uniformWeights, scalar_t *pqJagged_weights, int numThreads, lno_t coordinateBegin, lno_t coordinateEnd, scalar_t *max_min_array, scalar_t maxScalar, scalar_t minScalar, scalar_t &minCoordinate, scalar_t &maxCoordinate, scalar_t &totalWeight)
 Function to determine the local minimum and maximum coordinate, and local total weight in the given set of local points.
template<typename scalar_t >
void pqJagged_getGlobalMinMaxTotalCoord (RCP< Comm< int > > &comm, const RCP< const Environment > &env, partId_t concurrentPartCount, scalar_t *localMinMaxTotal, scalar_t *globalMinMaxTotal)
 Function that reduces global minimum and maximum coordinates with global total weight from given local arrays.
template<typename scalar_t >
void pqJagged_getCutCoord_Weights (scalar_t minCoordinate, scalar_t maxCoordinate, bool pqJagged_uniformParts, scalar_t *pqJagged_partSizes, partId_t noCuts, scalar_t *cutCoordinates, scalar_t *cutPartRatios, int numThreads)
 Function that calculates the new coordinates for the cut lines. Function is called inside the parallel region.
template<typename scalar_t >
void getNewCoordinates (const RCP< const Environment > &env, RCP< Comm< int > > &comm, const size_t &total_part_count, const partId_t &noCuts, const scalar_t &maxCoordinate, const scalar_t &minCoordinate, const scalar_t &globalTotalWeight, const scalar_t &imbalanceTolerance, scalar_t maxScalar, const scalar_t *globalPartWeights, const scalar_t *localPartWeights, const scalar_t *targetPartWeightRatios, bool *isDone, scalar_t *cutCoordinates, scalar_t *cutUpperBounds, scalar_t *cutLowerBounds, scalar_t *leftClosestDistance, scalar_t *rightClosestDistance, scalar_t *cutLowerWeight, scalar_t *cutUpperWeight, scalar_t *newCutCoordinates, bool allowNonRectelinearPart, float *nonRectelinearPartRatios, partId_t *rectilinearCutCount, scalar_t *localCutWeights, scalar_t *globalCutWeights, partId_t &myNoneDoneCount)
 Function that calculates the new coordinates for the cut lines. Function is called inside the parallel region.
template<typename scalar_t , typename lno_t >
void pqJagged_1DPart_getPartWeights (size_t total_part_count, partId_t noCuts, scalar_t maxScalar, scalar_t _EPSILON, int numThreads, lno_t coordinateBegin, lno_t coordinateEnd, lno_t *partitionedPointPermutations, scalar_t *pqJagged_coordinates, bool pqJagged_uniformWeights, scalar_t *pqJagged_weights, scalar_t *cutCoordinates_tmp, bool *isDone, double *myPartWeights, scalar_t *myLeftClosest, scalar_t *myRightClosest, bool useBinarySearch, partId_t *partIds)
 Function that calculates the new coordinates for the cut lines. Function is called inside the parallel region.
template<typename scalar_t >
void accumulateThreadResults (partId_t noCuts, size_t total_part_count, partId_t concurrentPartCount, int numThreads, bool *isDone, scalar_t **leftClosestDistance, scalar_t **rightClosestDistance, double **partWeights, scalar_t *localMinMaxTotal, scalar_t *totalPartWeights_leftClosest_rightCloset)
 Function that reduces the result of multiple threads for left and right closest points and part weights in a single mpi.
template<typename scalar_t , typename lno_t >
void pqJagged_1D_Partition (const RCP< const Environment > &env, RCP< Comm< int > > &comm, lno_t *partitionedPointPermutations, scalar_t *pqJagged_coordinates, bool pqJagged_uniformWeights, scalar_t *pqJagged_weights, scalar_t *targetPartWeightRatios, scalar_t *globalMinMaxTotal, scalar_t *localMinMaxTotal, partId_t partNo, int numThreads, scalar_t maxScalar, scalar_t minScalar, scalar_t imbalanceTolerance, partId_t currentPartBeginIndex, partId_t concurrentPartCount, lno_t *inTotalCounts, scalar_t *cutCoordinates, scalar_t *cutCoordinatesWork, scalar_t **leftClosestDistance, scalar_t **rightClosestDistance, scalar_t *cutUpperBounds, scalar_t *cutLowerBounds, scalar_t *cutUpperWeight, scalar_t *cutLowerWeight, bool *isDone, double **partWeights, scalar_t *local_totalPartWeights_leftClosest_rightCloset, scalar_t *global_totalPartWeights_leftClosest_rightCloset, bool allowNonRectelinearPart, float *nonRectelinearPartRatios, scalar_t *localCutWeights, scalar_t *globalCutWeights, partId_t allDone, partId_t *myNonDoneCounts, bool useBinarySearch, partId_t *partIds)
 Function that is responsible from 1D partitioning of the given range of coordinates.
template<typename lno_t , typename scalar_t >
void getChunksFromCoordinates (partId_t partNo, int noThreads, lno_t *partitionedPointPermutations, scalar_t *pqJagged_coordinates, bool pqJagged_uniformWeights, scalar_t *coordWeights, scalar_t *cutCoordinates, lno_t coordinateBegin, lno_t coordinateEnd, bool allowNonRectelinearPart, float *actual_ratios, scalar_t *localPartWeights, double **partWeights, float **nonRectelinearRatios, lno_t **partPointCounts, lno_t *newpartitionedPointPermutations, lno_t *totalCounts, partId_t *partIds)
 Function that determines the permutation indices of the coordinates.
template<typename T >
T * allocMemory (size_t size)
template<typename T >
void freeArray (T *&array)
template<typename tt >
std::string toString (tt obj)
template<typename Adapter >
void AlgPQJagged (const RCP< const Environment > &env, RCP< Comm< int > > &comm, const RCP< const CoordinateModel< typename Adapter::base_adapter_t > > &coords, RCP< PartitioningSolution< Adapter > > &solution)
 PQJagged coordinate partitioning algorithm.
template<typename Adapter >
void AlgRCB (const RCP< const Environment > &env, RCP< Comm< int > > &problemComm, const RCP< const CoordinateModel< typename Adapter::base_adapter_t > > &coords, RCP< PartitioningSolution< Adapter > > &solution)
 Recursive coordinate bisection algorithm.
template<typename Adapter >
void getFractionLeft (const RCP< const Environment > &env, partId_t part0, partId_t part1, const RCP< PartitioningSolution< Adapter > > &solution, ArrayRCP< double > &fractionLeft, partId_t &numPartsLeftHalf)
 Determine the fraction of work in the left half.
template<typename mvector_t >
void getCutDimension (const RCP< const Environment > &env, const RCP< Comm< int > > &comm, int coordDim, const RCP< mvector_t > &vectors, ArrayView< typename mvector_t::local_ordinal_type > index, int &dimension, typename mvector_t::scalar_type &minCoord, typename mvector_t::scalar_type &maxCoord)
 Choose a coordinate dimension for the next cut.
template<typename mvector_t >
void migrateData (const RCP< const Environment > &env, const RCP< Comm< int > > &comm, ArrayView< unsigned char > lrflags, RCP< mvector_t > &vectors, int &leftNumProcs)
 Migrate coordinates and weights to new processes.
template<typename lno_t , typename scalar_t >
scalar_t getCoordWeight (lno_t id, multiCriteriaNorm mcnorm, ArrayView< StridedData< lno_t, scalar_t > > weights)
template<typename scalar_t >
bool emptyPartsCheck (const RCP< const Environment > &env, const ArrayView< double > fractionLeft, scalar_t minCoord, scalar_t maxCoord, leftRightFlag &lrf, scalar_t &cutValue)
 Solve partitioning if there are empty parts.
template<typename lno_t , typename gno_t , typename scalar_t >
void testCoordinatesOnRightBoundary (const RCP< const Environment > &env, const RCP< Comm< int > > &comm, scalar_t totalWeightLeft, scalar_t targetLeftScalar, int cutLocation, ArrayView< scalar_t > localSums, ArrayView< scalar_t > globalSums, ArrayView< lno_t > index, ArrayView< StridedData< lno_t, scalar_t > > weights, multiCriteriaNorm mcnorm, ArrayView< unsigned char > lrFlags, scalar_t &globalWeightMovedRight)
 Move boundary coordinates to the right.
template<typename mvector_t >
void BSPfindCut (const RCP< const Environment > &env, const RCP< Comm< int > > &comm, const std::bitset< NUM_RCB_PARAMS > &params, int numTestCuts, typename mvector_t::scalar_type tolerance, int cutDim, int coordDim, const RCP< mvector_t > &vectors, ArrayView< typename mvector_t::local_ordinal_type > index, ArrayView< double > fractionLeft, ArrayView< bool > uniformWeights, typename mvector_t::scalar_type coordGlobalMin, typename mvector_t::scalar_type coordGlobalMax, typename mvector_t::scalar_type &cutValue, ArrayView< unsigned char > lrFlags, typename mvector_t::scalar_type &totalWeightLeft, typename mvector_t::scalar_type &totalWeightRight, typename mvector_t::local_ordinal_type &localCountLeft, typename mvector_t::scalar_type &imbalance)
 Find the point in space that divides the data evenly with respect to the weights, part sizes, and the user's objective.
template<typename mvector_t , typename Adapter >
void determineCut (const RCP< const Environment > &env, const RCP< Comm< int > > &comm, const std::bitset< NUM_RCB_PARAMS > &params, int numTestCuts, typename mvector_t::scalar_type tolerance, int coordDim, const RCP< mvector_t > &vectors, const ArrayView< bool > uniformWeights, multiCriteriaNorm mcnorm, const RCP< PartitioningSolution< Adapter > > &solution, partId_t part0, partId_t part1, ArrayView< unsigned char > lrflags, int &cutDimension, typename mvector_t::scalar_type &cutValue, typename mvector_t::scalar_type &imbalance, partId_t &numPartsLeftHalf, typename mvector_t::scalar_type &weightLeftHalf, typename mvector_t::scalar_type &weightRightHalf)
 Divide the coordinates into a "left" half and "right" half.
template<typename mvector_t , typename Adapter >
void serialRCB (const RCP< const Environment > &env, int depth, const std::bitset< NUM_RCB_PARAMS > &params, int numTestCuts, typename mvector_t::scalar_type tolerance, int coordDim, const RCP< mvector_t > &vectors, ArrayView< typename mvector_t::local_ordinal_type > index, const ArrayView< bool > uniformWeights, const RCP< PartitioningSolution< Adapter > > &solution, partId_t part0, partId_t part1, ArrayView< partId_t > partNum)
 Perform RCB on the local process only.
template<typename Adapter >
void AlgPTScotch (const RCP< const Environment > &env, const RCP< const Comm< int > > &problemComm, const RCP< GraphModel< typename Adapter::base_adapter_t > > &model, RCP< PartitioningSolution< Adapter > > &solution)
void makeDebugManager (int rank, bool iPrint, int level, std::string fname, int ost, Teuchos::RCP< DebugManager > &mgr)
 Create an output manager for debugging or status information.
template<typename metric_t >
void makeMetricOutputManager (int rank, bool iPrint, std::string fname, int ost, Teuchos::RCP< MetricOutputManager< metric_t > > &mgr, std::string units, int fieldWidth, RCP< std::ofstream > &fptr)
 Create an output manager for a metric value.
template<typename Integral >
bool validIntegralRangeList (const Teuchos::Array< Integral > &vals)
 A helper function that indicates whether an array is a valid integer range list.
template<typename Integral >
bool allValuesAreInRangeList (const Teuchos::Array< Integral > &vals)
 A helper function that determines if all values are in the list.
template<typename Integral >
bool allValuesAreInRangeList (const Teuchos::ParameterEntry &e)
 A helper function that determines if all values are in the list.
template<typename Integral >
bool noValuesAreInRangeList (const Teuchos::Array< Integral > &vals)
 A helper function that determines if no values are in the list.
template<typename Integral >
bool noValuesAreInRangeList (const Teuchos::ParameterEntry &e)
 A helper function that determines if no values are in the list.
template<typename Integral >
bool IsInRangeList (const Integral val, const Teuchos::Array< Integral > &valList, bool sorted=true)
 A helper function that determines if a value is in the list.
template<typename Integral >
bool IsInRangeList (const Integral val, const Teuchos::ParameterEntry &e)
 A helper function that determines if a value is in the list.
template<typename Integral >
Teuchos::ArrayView< Integral > getList (Teuchos::Array< Integral > &irl)
 A helper function that returns a view of the list.
template<typename Integral >
void printIntegralRangeList (std::ostream &os, Teuchos::Array< Integral > &irl)
 A helper function that prints the meaning of an encoded integer range list.
void createAllParameters (Teuchos::ParameterList &pList)
 Create a list of all Zoltan2 parameters and validators.
static void setValidatorsInList (const Teuchos::ParameterList &plSome, const Teuchos::ParameterList &plAll, Teuchos::ParameterList &plVal)
 Create a parameter list that can validate a specific list of parameters.
void createValidatorList (const Teuchos::ParameterList &plIn, Teuchos::ParameterList &plOut)
 Create a list by adding validators to the users parameter list.
void printListDocumentation (const Teuchos::ParameterList &pl, std::ostream &os, std::string listNames)
void printListDocumentation (const Teuchos::ParameterList &pl, ostream &os, string listNames=string(""))
template<typename User >
size_t removeUndesiredEdges (const RCP< const Environment > &env, int myRank, bool removeSelfEdges, bool removeOffProcessEdges, bool removeOffGroupEdges, ArrayView< const typename InputTraits< User >::gid_t > &gids, ArrayView< const typename InputTraits< User >::gid_t > &gidNbors, ArrayView< const int > &procIds, ArrayView< StridedData< typename InputTraits< User >::lno_t, typename InputTraits< User >::scalar_t > > &edgeWeights, ArrayView< const typename InputTraits< User >::lno_t > &offsets, ArrayRCP< const typename InputTraits< User >::gid_t > &newGidNbors, typename InputTraits< User >::scalar_t **&newWeights, ArrayRCP< const typename InputTraits< User >::lno_t > &newOffsets)
 Helper function to remove undesired edges from a graph.
template<typename User >
size_t computeLocalEdgeList (const RCP< const Environment > &env, int rank, size_t numLocalEdges, size_t numLocalGraphEdges, RCP< const IdentifierMap< User > > &idMap, ArrayRCP< const typename InputTraits< User >::gid_t > &allEdgeIds, ArrayRCP< int > &allProcs, ArrayRCP< const typename InputTraits< User >::lno_t > &allOffs, ArrayRCP< StridedData< typename InputTraits< User >::lno_t, typename InputTraits< User >::scalar_t > > &allWeights, ArrayRCP< const typename InputTraits< User >::lno_t > &edgeLocalIds, ArrayRCP< const typename InputTraits< User >::lno_t > &offsets, ArrayRCP< StridedData< typename InputTraits< User >::lno_t, typename InputTraits< User >::scalar_t > > &eWeights)
 Helper function to create new edges lists containing only edges connected to a neighbor on this process.
void AlltoAllCount (const Comm< int > &comm, const Environment &env, const ArrayView< const int > &sendCount, const ArrayView< int > &recvCount)
 Each process sends a value to every process, an all-to-all.
template<>
void AlltoAllv (const Comm< int > &comm, const Environment &env, const ArrayView< const string > &sendBuf, const ArrayView< const int > &sendCount, ArrayRCP< string > &recvBuf, const ArrayView< int > &recvCount)
template<>
void AlltoAllv (const Comm< int > &comm, const Environment &env, const ArrayView< const unsigned short > &sendBuf, const ArrayView< const int > &sendCount, ArrayRCP< unsigned short > &recvBuf, const ArrayView< int > &recvCount)
template<>
void AlltoAllv (const Comm< int > &comm, const Environment &env, const ArrayView< const unsigned char > &sendBuf, const ArrayView< const int > &sendCount, ArrayRCP< unsigned char > &recvBuf, const ArrayView< int > &recvCount)
template<typename T >
void AlltoAllv (const Comm< int > &comm, const Environment &env, const ArrayView< const T > &sendBuf, const ArrayView< const int > &sendCount, ArrayRCP< T > &recvBuf, const ArrayView< int > &recvCount)
 AlltoAllv sends/receives data to/from all processes.
static void chaco_flush_line (FILE *infile)
 helper function for zoltan1 chaco reader code Reader code was copied from zoltan1 test driver code.
double chaco_read_val (FILE *infile, int *end_flag)
 read a double from a file Reader code was copied from zoltan1 test driver code.
int chaco_read_int (FILE *infile, int *end_flag)
 read a int from a file Reader code was copied from zoltan1 test driver code.
int chaco_input_graph (FILE *fin, char *inname, int **start, int **adjacency, int *nvtxs, int *vwgt_dim, float **vweights, int *ewgt_dim, float **eweights)
 read a Chaco graph file Reader code was copied from zoltan1 test driver code. File is closed when read is completed.
int chaco_input_geom (FILE *fingeom, char *geomname, int nvtxs, int *igeom, float **x, float **y, float **z)
 read a Chaco coordinates file Reader code was copied from zoltan1 test driver code. File is closed when read is completed.
int getHashCode (const unsigned char *a, size_t len)
 helper to hash values larger than int to an int. Hash values do not need to be unique, but there should be as few overlaps as possible.
template<typename T >
std::pair< T, T > z2LocalMinMax (const T *val, size_t n)
 helper function to find min and max of array of user Ids
template<typename T >
void z2GlobalMinMax (const Comm< int > &comm, bool noLocalValues, T localMin, T localMax, T &globalMin, T &globalMax)
 helper function to find global min and max of array of user Ids
template<typename T >
bool z2AreConsecutive (const T *val, size_t n)
 helper function to determine if list of user Ids are consecutive
template<typename T >
std::string stringifyOrdinal (T ordinal)
 helper function write a user ID to a string
void addNumberToFileName (int number, std::string fname, std::string &newf)
 Helper method to add number to a file name.
template<typename scalar_t >
void getStridedStats (const ArrayView< scalar_t > &v, int stride, int offset, scalar_t &min, scalar_t &max, scalar_t &sum)
 Find min, max and sum of metric values.
template<typename scalar_t , typename pnum_t , typename lno_t >
void normedPartWeights (const RCP< const Environment > &env, int numberOfParts, const ArrayView< const pnum_t > &parts, const ArrayView< StridedData< lno_t, scalar_t > > &vwgts, multiCriteriaNorm mcNorm, scalar_t *weights)
 Compute the total weight in each part on this process.
template<typename scalar_t , typename pnum_t , typename lno_t >
void globalSumsByPart (const RCP< const Environment > &env, const RCP< const Comm< int > > &comm, const ArrayView< const pnum_t > &part, const ArrayView< StridedData< lno_t, scalar_t > > &vwgts, multiCriteriaNorm mcNorm, partId_t &numParts, partId_t &numNonemptyParts, ArrayRCP< MetricValues< scalar_t > > &metrics, ArrayRCP< scalar_t > &globalSums)
 Given the local partitioning, compute the global sums in each part.
template<typename scalar_t >
void computeImbalances (partId_t numParts, partId_t targetNumParts, const scalar_t *psizes, scalar_t sumVals, const scalar_t *vals, scalar_t &min, scalar_t &max, scalar_t &avg)
 Compute the imbalance.
template<typename scalar_t >
void computeImbalances (partId_t numParts, partId_t targetNumParts, int numSizes, ArrayView< ArrayRCP< scalar_t > > psizes, scalar_t sumVals, const scalar_t *vals, scalar_t &min, scalar_t &max, scalar_t &avg)
 Compute the imbalance in the case of multiple part sizes.
template<typename Adapter >
void objectMetrics (const RCP< const Environment > &env, const RCP< const Comm< int > > &comm, multiCriteriaNorm mcNorm, const RCP< const Adapter > &ia, const RCP< const PartitioningSolution< Adapter > > &solution, partId_t &numParts, partId_t &numNonemptyParts, ArrayRCP< MetricValues< typename Adapter::scalar_t > > &metrics)
 Compute imbalance metrics for a distribution.
template<typename scalar_t >
void printMetrics (ostream &os, partId_t targetNumParts, partId_t numParts, partId_t numNonemptyParts, const ArrayView< MetricValues< scalar_t > > &infoList)
 Print out a header and the values for a list of metrics.
template<typename scalar_t >
void printMetrics (ostream &os, partId_t targetNumParts, partId_t numParts, partId_t numNonemptyParts, const MetricValues< scalar_t > &info)
 Print out a header and the values for a single metric.
template<typename scalar_t >
scalar_t normedWeight (ArrayView< scalar_t > weights, multiCriteriaNorm norm)
 Compute the norm of the vector of weights.
template<typename lno_t , typename scalar_t >
scalar_t normedWeight (ArrayView< StridedData< lno_t, scalar_t > > weights, lno_t idx, multiCriteriaNorm norm)
 Compute the norm of the vector of weights stored as StridedData.
long getProcessKilobytes ()
template<typename scalar_t >
bool outsideRegion (scalar_t val, scalar_t mark, double epsilon)
std::string Zoltan2_Version ()

Variables

static char chaco_line [LINE_LENGTH]
static int chaco_offset = 0
static int chaco_break_pnt = LINE_LENGTH
static int chaco_save_pnt

Typedef Documentation

Definition at line 67 of file Zoltan2_InputTraits.hpp.

typedef double Zoltan2::default_scalar_t

Definition at line 85 of file Zoltan2_InputTraits.hpp.

Definition at line 86 of file Zoltan2_InputTraits.hpp.

typedef std::bitset<NUM_MODEL_FLAGS> Zoltan2::modelFlag_t

Definition at line 90 of file Zoltan2_Model.hpp.

typedef size_t Zoltan2::global_size_t

Definition at line 119 of file Zoltan2_Standards.hpp.

Definition at line 140 of file Zoltan2_Standards.hpp.

typedef Kokkos::DefaultNode::DefaultNodeType Zoltan2::default_node_t

Definition at line 163 of file Zoltan2_Standards.hpp.


Enumeration Type Documentation

The boolean parameters of interest to the Block algorithm.

Enumerator:
block_balanceCount 

objective = balance_object_count

block_balanceWeight 

objective = balance_object_weight

block_minTotalWeight 

objective = mc_minimize_total_weight

block_minMaximumWeight 

objective = mc_minimize_maximum_weight

block_balanceTotalMaximum 

objective = mc_balance_total_maximum

NUM_BLOCK_PARAMS 

Definition at line 65 of file Zoltan2_AlgBlock.hpp.

The boolean parameters of interest to the RCB algorithm.

Enumerator:
rcb_balanceCount 

objective = balance_object_count

rcb_balanceWeight 

objective = balance_object_weight

rcb_minTotalWeight 

objective = mc_minimize_total_weight

rcb_minMaximumWeight 

objective = mc_minimize_maximum_weight

rcb_balanceTotalMaximum 

objective = mc_balance_total_maximum

rcb_averageCuts 

averageCuts = yes

rcb_rectilinearBlocks 

rectilinearBlocks = yes

rcb_multiplePartSizeSpecs 

multicriteria w/differing part sizes

NUM_RCB_PARAMS 

Definition at line 136 of file Zoltan2_AlgRCB_methods.hpp.

During partitioning, flags are stored in unsigned char arrays.

Flag is also used to store a region number, but there are at most 251 regions. Therefore region number will not conflict with leftFlag and rightFlag. (Number of regions is number of test cuts plus one.)

Enumerator:
unsetFlag 

253

leftFlag 

254

rightFlag 

255

Definition at line 155 of file Zoltan2_AlgRCB_methods.hpp.

Codes that indicate how to interpret the Array<int> representing the user's integer range list.

Enumerator:
RANGE_INCLUDES_ALL 

all values were listed

RANGE_IS_EMPTY 

no values were listed

RANGE_IS_LISTED 

the listed values are in the Array<int>

NUM_RANGE_TYPES 

Definition at line 71 of file Zoltan2_IntegerRangeList.hpp.

Level of error checking or assertions desired.

Each assertion in the code must have a level. Tests for logic errors should always be level DEBUG_MODE_ASSERTION. Quick tests are BASIC, longer tests for input errors are COMPLEX.

The user sets the assertion level with the parameter error_check_level.

If compiled with Z2_OMIT_ALL_ERROR_CHECKING, error checks don't happen.

Enumerator:
NO_ASSERTIONS 

no assertion checks will be done

BASIC_ASSERTION 

fast typical checks for valid arguments

COMPLEX_ASSERTION 

more involved, like validate a graph

DEBUG_MODE_ASSERTION 

checks for logic errors

NUM_ASSERTION_LEVELS 

Definition at line 81 of file Zoltan2_Parameters.hpp.

The amount of debugging or status output to print.

Each debug/status message must have an output level. The user specfies the level desired with the debug_level parameter.

If Zoltan2 is compiled with Z2_OMIT_ALL_STATUS_MESSAGES, no messages will be processed.

Enumerator:
NO_STATUS 

don't display status/debug messages

BASIC_STATUS 

the status at each high level step

DETAILED_STATUS 

sub-steps, each method's entry and exit

VERBOSE_DETAILED_STATUS 

include more detail about sub-steps

NUM_STATUS_OUTPUT_LEVELS 

Definition at line 98 of file Zoltan2_Parameters.hpp.

The type of timers which should be active.

If timing is requested, timer_type can specify MACRO timing or MICRO timing. For example, a MACRO timer would time an algorithm. A MICRO timer would time steps in the algorithm. You can also ask for BOTH, but be aware that your MACRO timer is also timing the MICRO timers as well as the algorithm.

If Zoltan2 is compiled with Z2_OMIT_ALL_PROFILING timing messages are ignored.

Enumerator:
NO_TIMERS 

No timing data will be collected (the default).

MACRO_TIMERS 

Time an algorithm (or other entity) as a whole.

MICRO_TIMERS 

Time the substeps of an entity.

BOTH_TIMERS 

Run both MACRO and MICRO timers.

TEST_TIMERS 

Timers added while testing, removed later.

NUM_TIMING_OPTIONS 

Definition at line 118 of file Zoltan2_Parameters.hpp.

Output stream types.

Enumerator:
COUT_STREAM 

std::cout

CERR_STREAM 

std::cerr

NULL_STREAM 

/dev/null: do actions but don't output results

NUM_OUTPUT_STREAMS 

Definition at line 130 of file Zoltan2_Parameters.hpp.

Enumerator used in code for multicriteria norm choice.

Enumerator:
normMinimizeTotalWeight 

1-norm = Manhattan norm

normBalanceTotalMaximum 

2-norm = sqrt of sum of squares

normMinimizeMaximumWeight 

inf-norm = maximum norm

normNumNorms 

Definition at line 139 of file Zoltan2_Parameters.hpp.

An enum to identify general types of input adapters.

If you change this, update inputAdapterTypeName().

Enumerator:
InvalidAdapterType 

unused value

IdentifierAdapterType 

plain identifier input, just a list of Ids

VectorAdapterType 

vector input

CoordinateAdapterType 

coordinate input

GraphAdapterType 

graph input

MeshAdapterType 

mesh input

MatrixAdapterType 

matrix input

Definition at line 62 of file Zoltan2_InputAdapter.hpp.

An identifier for the general type of model.

Enumerator:
InvalidModel 
HypergraphModelType 
GraphModelType 
CoordinateModelType 
IdentifierModelType 

Definition at line 61 of file Zoltan2_Model.hpp.

Flags are set by a Problem to tell a Model what transformations it may need to do on the user's input.

Enumerator:
IDS_MUST_BE_GLOBALLY_CONSECUTIVE 

algorithm requires consecutive ids

SYMMETRIZE_INPUT_TRANSPOSE 

model must symmetrize input

SYMMETRIZE_INPUT_BIPARTITE 

model must symmetrize input

VERTICES_ARE_MATRIX_ROWS 

use matrix rows as graph vertices

VERTICES_ARE_MATRIX_COLUMNS 

use columns as graph vertices

VERTICES_ARE_MATRIX_NONZEROS 

use nonzeros as graph vertices

VERTICES_ARE_MESH_NODES 

use mesh nodes as vertices

VERTICES_ARE_MESH_ELEMENTS 

use mesh elements as vertices

SELF_EDGES_MUST_BE_REMOVED 

algorithm requires no self edges

GRAPH_IS_A_SUBSET_GRAPH 

ignore invalid neighbors

NUM_MODEL_FLAGS 

Definition at line 72 of file Zoltan2_Model.hpp.

Identifier translations available from IdentifierMap.

Enumerator:
TRANSLATE_APP_TO_LIB 

convert user ids to internal ids

TRANSLATE_LIB_TO_APP 

convert internal ids to user ids

Definition at line 71 of file Zoltan2_IdentifierMap.hpp.


Function Documentation

template<typename Adapter >
int Zoltan2::AlgAMD ( const RCP< GraphModel< Adapter > > &  model,
const RCP< OrderingSolution< typename Adapter::gid_t, typename Adapter::lno_t > > &  solution,
const RCP< Teuchos::ParameterList > &  pl,
const RCP< Teuchos::Comm< int > > &  comm 
)

Definition at line 61 of file Zoltan2_AlgAMD.hpp.

template<typename Adapter >
int Zoltan2::AlgIncDegree ( const RCP< GraphModel< Adapter > > &  model,
const RCP< OrderingSolution< typename Adapter::gid_t, typename Adapter::lno_t > > &  solution,
const RCP< Teuchos::ParameterList > &  pl,
const RCP< Teuchos::Comm< int > > &  comm 
)

Definition at line 66 of file Zoltan2_AlgIncDegree.hpp.

template<typename Adapter >
int Zoltan2::AlgNatural ( const RCP< IdentifierModel< Adapter > > &  model,
const RCP< OrderingSolution< typename Adapter::gid_t, typename Adapter::lno_t > > &  solution,
const RCP< Teuchos::ParameterList > &  pl,
const RCP< Teuchos::Comm< int > > &  comm 
)

Definition at line 60 of file Zoltan2_AlgNatural.hpp.

template<typename Adapter >
int Zoltan2::AlgRandom ( const RCP< IdentifierModel< Adapter > > &  model,
const RCP< OrderingSolution< typename Adapter::gid_t, typename Adapter::lno_t > > &  solution,
const RCP< Teuchos::ParameterList > &  pl,
const RCP< Teuchos::Comm< int > > &  comm 
)

Definition at line 61 of file Zoltan2_AlgRandom.hpp.

template<typename Adapter >
int Zoltan2::AlgRCM ( const RCP< GraphModel< Adapter > > &  model,
const RCP< OrderingSolution< typename Adapter::gid_t, typename Adapter::lno_t > > &  solution,
const RCP< Teuchos::ParameterList > &  pl,
const RCP< Teuchos::Comm< int > > &  comm 
)

Definition at line 61 of file Zoltan2_AlgRCM.hpp.

template<typename Adapter >
int Zoltan2::AlgSpectral ( const RCP< GraphModel< Adapter > > &  model,
const RCP< OrderingSolution< typename Adapter::gid_t, typename Adapter::lno_t > > &  solution,
const RCP< Teuchos::ParameterList > &  pl,
const RCP< const Teuchos::Comm< int > > &  comm 
)

Definition at line 61 of file Zoltan2_AlgSpectral.hpp.

template<typename Adapter >
void Zoltan2::AlgBlock ( const RCP< const Environment > &  env,
const RCP< Comm< int > > &  problemComm,
const RCP< const IdentifierModel< typename Adapter::base_adapter_t > > &  ids,
RCP< PartitioningSolution< Adapter > > &  solution 
)

Block partitioning method.

Parameters:
envlibrary configuration and problem parameters
problemCommthe communicator for the problem
idsan Identifier model
solutiona Solution object, containing part information

Preconditions: The parameters in the environment have been processed (committed). No special requirements on the identifiers.

Todo:

Block partitioning uses one weight only

Block partitioning assumes one part per process.

check for memory allocation failures

The metrics come out really bad. Is it an error in algorithm or in metrics.

Definition at line 94 of file Zoltan2_AlgBlock.hpp.

template<typename T >
void Zoltan2::firstTouch ( T *  arrayName,
size_t  arraySize 
) [inline]

Definition at line 294 of file Zoltan2_AlgPQJagged.hpp.

template<typename scalar_t >
scalar_t Zoltan2::pivotPos ( scalar_t cutUpperBounds,
scalar_t cutLowerBounds,
size_t  currentCutIndex,
scalar_t cutUpperWeight,
scalar_t cutLowerWeight,
scalar_t  ew 
) [inline]

Function that calculates the next pivot position, according to given coordinates of upper bound and lower bound, the weights at upper and lower bounds, and the expected weight.

Parameters:
cutUpperBoundsis the pointer to the array holding the upper bounds coordinates of the cuts.
cutLowerBoundsis the pointer to the array holding the lower bound coordinates of the cuts.
currentCutIndexis the index of the current cut, the indices used for lower and upper bound arrays.
cutUpperWeightis the pointer to the array holding the weights at the upper bounds of each cut.
cutLowerWeightis the pointer to the array holding the weights at the lower bounds of each cut.
ewis the expected weight that should be placed on the left of the cut line.

Definition at line 314 of file Zoltan2_AlgPQJagged.hpp.

template<typename T >
void Zoltan2::pqJagged_getParameters ( const Teuchos::ParameterList &  pl,
T &  imbalanceTolerance,
multiCriteriaNorm &  mcnorm,
std::bitset< NUM_RCB_PARAMS > &  params,
int &  numTestCuts,
bool &  ignoreWeights,
bool &  allowNonrectilinear,
partId_t concurrentPartCount,
bool &  force_binary,
bool &  force_linear 
)

Returns the parameters such as: Partitioning problem parameters of interest: Partitioning objective imbalance_tolerance.

Geometric partitioning problem parameters of interest: average_cuts rectilinear_blocks bisection_num_test_cuts (experimental)

Parameters:
plis the ParameterList object read from the environment.
float-likevalue representing imbalance tolerance. An output of the function. (for imbalance 0.03, the user currently inputs 1.03. However, This function will return 0.03 for that case.)
mcnormmultiCriteriaNorm. An output of the function. //not used in pqJagged algorithm currently.
paramsholding the bits for objective problem description. An output of the function. //not used in pqJagged algorithm currently..
numTestCuts.An output of the function. //not used in pqJagged algorithm currently.
ignoreWeightsis the boolean value to treat the each coordinate as uniform regardless of the given input weights. Output of the function.
concurrentPartCountis the number of parts whose cut lines will be calculated concurrently.

Definition at line 343 of file Zoltan2_AlgPQJagged.hpp.

template<typename Adapter >
void Zoltan2::pqJagged_getCoordinateValues ( const RCP< const CoordinateModel< typename Adapter::base_adapter_t > > &  coords,
int &  coordDim,
int &  weightDim,
size_t &  numLocalCoords,
global_size_t &  numGlobalCoords,
int &  criteriaDim,
const bool &  ignoreWeights 
)

Returns the input coordinate value parameters.

Parameters:
coordsis the coordinate model representing the input.
coordDimis the output of the function representing the dimension count of the input.
weightDimis the output of the function representing the dimension of the weights.
numLocalCoordsis the output representing the count of the local coordinates.
numGlobalCoordsis the output representing the count of the global coordinates.
criteriaDimis the output representing the multi-objective count.
ignoreWeightsis the boolean input of the function, to treat the each coordinate as uniform regardless of the given input weights. Output of the function.

Definition at line 456 of file Zoltan2_AlgPQJagged.hpp.

template<typename Adapter , typename scalar_t , typename gno_t >
void Zoltan2::pqJagged_getInputValues ( const RCP< const Environment > &  env,
const RCP< const CoordinateModel< typename Adapter::base_adapter_t > > &  coords,
RCP< PartitioningSolution< Adapter > > &  solution,
std::bitset< NUM_RCB_PARAMS > &  params,
const int &  coordDim,
const int &  weightDim,
const size_t &  numLocalCoords,
size_t &  numGlobalParts,
int &  pqJagged_multiVectorDim,
scalar_t **  pqJagged_values,
const int &  criteriaDim,
scalar_t **  pqJagged_weights,
ArrayView< const gno_t > &  pqJagged_gnos,
bool &  ignoreWeights,
bool *  pqJagged_uniformWeights,
bool *  pqJagged_uniformParts,
scalar_t **  pqJagged_partSizes 
)

Function returning the input values for the problem such as the coordinates, weights and desiredPartSizes.

Parameters:
envenvironment.
coordsis the coordinate model representing the input.
solutionis the partitioning solution object.
paramsis the bitset to represent multiple parameters. //not used currently by pqJagged.
coordDimis an integer value to represent the count of coordinate dimensions.
weightDimis an integer value to represent the count of weight dimensions.
numLocalCoordsis a size_t value to represent the count of local coordinates.
numGlobalPartsis a size_t value to represent the total part count. //not used currently inside the pqJagged algorithm.
pqJagged_multiVectorDim...//not used by pqJagged algorithm.
pqJagged_valuesis the output representing the coordinates of local points. Its size is coordDim x numLocalCoords and allocated before the function.
criteriaDim...//not used currently inside the pqJagged algorithm.
pqJagged_weightsis the two dimensional array output, representing the weights of coordinates in each weight dimension. Sized weightDim x numLocalCoords, and allocated before the function.
pqJagged_gnosis the ArrayView output representing the global indices of each vertex. No allocation is needed.
ignoreWeightsis the boolean input of the function, to treat the each coordinate
pqJagged_uniformWeightsis the boolean array representing whether or not coordinates have uniform weight in each weight dimension.
pqJagged_uniformPartsis the boolean array representing whether or not the desired part weights are uniform in each weight dimension.
pqJagged_partSizesis the two dimensional float-like array output that represents the ratio of each part.

Definition at line 495 of file Zoltan2_AlgPQJagged.hpp.

template<typename scalar_t , typename gno_t >
void Zoltan2::pqJagged_printInput ( int  coordDim,
int  weightDim,
size_t  numLocalCoords,
global_size_t  numGlobalCoords,
int  criteriaDim,
scalar_t **  pqJagged_values,
scalar_t **  pqJagged_weights,
bool *  pqJagged_uniformParts,
bool *  pqJagged_uniformWeights,
gno_t pqJagged_gnos,
bool  ignoreWeights,
size_t  numGlobalParts,
scalar_t **  pqJagged_partSizes 
)

Printing the input values, to check configuration.

Definition at line 607 of file Zoltan2_AlgPQJagged.hpp.

int Zoltan2::pqJagged_getNumThreads ( )

Function returning the available thread number by the processor.

Definition at line 669 of file Zoltan2_AlgPQJagged.hpp.

template<typename scalar_t , typename lno_t >
void Zoltan2::pqJagged_getLocalMinMaxTotalCoord ( lno_t partitionedPointPermutations,
scalar_t pqJagged_coordinates,
bool  pqJagged_uniformWeights,
scalar_t pqJagged_weights,
int  numThreads,
lno_t  coordinateBegin,
lno_t  coordinateEnd,
scalar_t max_min_array,
scalar_t  maxScalar,
scalar_t  minScalar,
scalar_t minCoordinate,
scalar_t maxCoordinate,
scalar_t totalWeight 
)

Function to determine the local minimum and maximum coordinate, and local total weight in the given set of local points.

Parameters:
partitionedPointPermutationsis the indices of coordinates in the given partition.
pqJagged_coordinatesfloat-like array representing the coordinates in a single dimension. Sized as numLocalCoords.
pqJagged_uniformWeightsboolean value whether each coordinate value has a uniform weight or not. If true, pqJagged_weights is not used.
pqJagged_weightsfloat-like array representing the weights of the coordinates in a single criteria dimension. Sized as numLocalCoords.
numThreadsis the integer value to represent the number of threads available for each processor.
coordinateBeginis the start index of the given partition on partitionedPointPermutations.
coordinateEndis the end index of the given partition on partitionedPointPermutations.
max_min_arrayprovided work array sized numThreads * 2.
maxScalarto initialize minimum coordinate if there are no points in the given range.
minScalarto initialize maximum coordinate if there are no points in the given range.
minCoordinateis the output to represent the local minimumCoordinate in given range of coordinates.
maxCoordinateis the output to represent the local maximum coordinate in the given range of coordinates.
totalWeightis the output to represent the local total weight in the coordinate in the given range of coordinates.

Definition at line 708 of file Zoltan2_AlgPQJagged.hpp.

template<typename scalar_t >
void Zoltan2::pqJagged_getGlobalMinMaxTotalCoord ( RCP< Comm< int > > &  comm,
const RCP< const Environment > &  env,
partId_t  concurrentPartCount,
scalar_t localMinMaxTotal,
scalar_t globalMinMaxTotal 
)

Function that reduces global minimum and maximum coordinates with global total weight from given local arrays.

Parameters:
commthe communicator for the problem
envlibrary configuration and problem parameters
concurrentPartCountis the number of parts whose cut lines will be calculated concurrently.
localMinMaxTotalis the array holding local min and max coordinate values with local total weight. First concurrentPartCount entries are minimums of the parts, next concurrentPartCount entries are max, and then the total weights.
localMinMaxTotalis the output array holding global min and global coordinate values with global total weight. The structure is same as localMinMaxTotal.

Definition at line 817 of file Zoltan2_AlgPQJagged.hpp.

template<typename scalar_t >
void Zoltan2::pqJagged_getCutCoord_Weights ( scalar_t  minCoordinate,
scalar_t  maxCoordinate,
bool  pqJagged_uniformParts,
scalar_t pqJagged_partSizes,
partId_t  noCuts,
scalar_t cutCoordinates,
scalar_t cutPartRatios,
int  numThreads 
)

Function that calculates the new coordinates for the cut lines. Function is called inside the parallel region.

Parameters:
minCoordinateminimum coordinate in the range.
maxCoordinatemaximum coordinate in the range.
pqJagged_uniformPartsis a boolean value holding whether the desired partitioning is uniform.
pqJagged_partSizesholds the desired parts sizes if desired partitioning is not uniform.
cutCoordinatesis the output array for the initial cut lines.
cutPartRatiosis the output array holding the cumulative ratios of parts in current partitioning. For partitioning to 4 uniformly, cutPartRatios will be (0.25, 0.5 , 0.75, 1).
numThreadshold the number of threads available per mpi.

Definition at line 877 of file Zoltan2_AlgPQJagged.hpp.

template<typename scalar_t >
void Zoltan2::getNewCoordinates ( const RCP< const Environment > &  env,
RCP< Comm< int > > &  comm,
const size_t &  total_part_count,
const partId_t noCuts,
const scalar_t maxCoordinate,
const scalar_t minCoordinate,
const scalar_t globalTotalWeight,
const scalar_t imbalanceTolerance,
scalar_t  maxScalar,
const scalar_t globalPartWeights,
const scalar_t localPartWeights,
const scalar_t targetPartWeightRatios,
bool *  isDone,
scalar_t cutCoordinates,
scalar_t cutUpperBounds,
scalar_t cutLowerBounds,
scalar_t leftClosestDistance,
scalar_t rightClosestDistance,
scalar_t cutLowerWeight,
scalar_t cutUpperWeight,
scalar_t newCutCoordinates,
bool  allowNonRectelinearPart,
float *  nonRectelinearPartRatios,
partId_t rectilinearCutCount,
scalar_t localCutWeights,
scalar_t globalCutWeights,
partId_t myNoneDoneCount 
)

Function that calculates the new coordinates for the cut lines. Function is called inside the parallel region.

Parameters:
envlibrary configuration and problem parameters
commthe communicator for the problem
total_part_countis the sum of number of cutlines and number of parts. Simply it is 2*P - 1.
noCutsis the number of cut lines. P - 1.
maxCoordinateis the maximum coordinate in the current range of coordinates and in the current dimension.
minCoordinateis the maximum coordinate in the current range of coordinates and in the current dimension.
globalTotalWeightis the global total weight in the current range of coordinates.
imbalanceToleranceis the maximum allowed imbalance ratio.
maxScalaris the maximum value that scalar_t can represent.
globalPartWeightsis the array holding the weight of parts. Assumes there are 2*P - 1 parts (cut lines are seperate parts).
localPartWeightsis the local totalweight of the processor.
targetPartWeightRatiosare the desired cumulative part ratios, sized P.
isDoneis the boolean array to determine if the correct position for a cut line is found.
cutCoordinatesis the array holding the coordinates of each cut line. Sized P - 1.
cutUpperBoundsis the array holding the upper bound coordinate for each cut line. Sized P - 1.
cutLowerBoundsis the array holding the lower bound coordinate for each cut line. Sized P - 1.
leftClosestDistanceis the array holding the distances to the closest points to the cut lines from left.
rightClosestDistanceis the array holding the distances to the closest points to the cut lines from right.
cutLowerWeightis the array holding the weight of the parts at the left of lower bound coordinates.
cutUpperWeightis the array holding the weight of the parts at the left of upper bound coordinates.
newCutCoordinatesis the work array, sized P - 1.
allowNonRectelinearPartis the boolean value whether partitioning should allow distributing the points on same coordinate to different parts.
nonRectelinearPartRatiosholds how much percentage of the coordinates on the cutline should be put on left side.
rectilinearCutCountis the count of cut lines whose balance can be achived via distributing the points in same coordinate to different parts.
localCutWeightsis the local weight of coordinates on cut lines.
globalCutWeightsis the global weight of coordinates on cut lines.
myNoneDoneCountis the number of cutlines whose position has not been determined yet. For K > 1 it is the count in a single part (whose cut lines are determined).

Definition at line 958 of file Zoltan2_AlgPQJagged.hpp.

template<typename scalar_t , typename lno_t >
void Zoltan2::pqJagged_1DPart_getPartWeights ( size_t  total_part_count,
partId_t  noCuts,
scalar_t  maxScalar,
scalar_t  _EPSILON,
int  numThreads,
lno_t  coordinateBegin,
lno_t  coordinateEnd,
lno_t partitionedPointPermutations,
scalar_t pqJagged_coordinates,
bool  pqJagged_uniformWeights,
scalar_t pqJagged_weights,
scalar_t cutCoordinates_tmp,
bool *  isDone,
double *  myPartWeights,
scalar_t myLeftClosest,
scalar_t myRightClosest,
bool  useBinarySearch,
partId_t partIds 
)

Function that calculates the new coordinates for the cut lines. Function is called inside the parallel region.

Parameters:
total_part_countis the sum of number of cutlines and number of parts. Simply it is 2*P - 1.
noCutsis the number of cut lines. P - 1.
maxScalaris the maximum value that scalar_t can represent.
_EPSILONis the smallest error value for scalar_t.
numThreadshold the number of threads available per processor.
coordinateBeginis the index of the first coordinate in current part.
coordinateEndis the index of the last coordinate in current part.
partitionedPointPermutationsis the indices of coordinates in the given partition.
pqJagged_coordinatesis 1 dimensional array holding coordinate values.
pqJagged_uniformWeightsis a boolean value if the points have uniform weights.
pqJagged_weightsis 1 dimensional array holding the weights of points.
globalPartWeightsis the array holding the weight of parts. Assumes there are 2*P - 1 parts (cut lines are seperate parts).
localPartWeightsis the local totalweight of the processor.
targetPartWeightRatiosare the desired cumulative part ratios, sized P.
cutCoordinates_tmpis the array holding the coordinates of each cut line. Sized P - 1.
isDoneis the boolean array to determine if the correct position for a cut line is found.
myPartWeightsis the array holding the part weights for the calling thread.
myLeftClosestis the array holding the distances to the closest points to the cut lines from left for the calling thread..
myRightClosestis the array holding the distances to the closest points to the cut lines from right for the calling thread.
useBinarySearchis boolean parameter whether to search for cut lines with binary search of linear search.
partIdsis the array that holds the part ids of the coordinates kddnote: The output of this function myPartWeights differs depending on whether kddnote: binary or linear search is used. Values in myPartWeights should be the kddnote: same only after accumulateThreadResults is done.

Definition at line 1255 of file Zoltan2_AlgPQJagged.hpp.

template<typename scalar_t >
void Zoltan2::accumulateThreadResults ( partId_t  noCuts,
size_t  total_part_count,
partId_t  concurrentPartCount,
int  numThreads,
bool *  isDone,
scalar_t **  leftClosestDistance,
scalar_t **  rightClosestDistance,
double **  partWeights,
scalar_t localMinMaxTotal,
scalar_t totalPartWeights_leftClosest_rightCloset 
)

Function that reduces the result of multiple threads for left and right closest points and part weights in a single mpi.

Parameters:
noCutsis the number of cut lines. P - 1.
total_part_countis the sum of number of cutlines and number of parts. Simply it is 2*P - 1.
concurrentPartCountis the number of parts whose cut lines will be calculated concurrently.
numThreadshold the number of threads available per processor.
isDoneis the boolean array to determine if the correct position for a cut line is found.
leftClosestDistanceis the 2 dimensional array holding the distances to the closest points to the cut lines from left for each thread.
rightClosestDistanceis the 2 dimensional array holding the distances to the closest points to the cut lines from right for each thread.
partWeightsis the array holding the weight of parts for each thread. Assumes there are 2*P - 1 parts (cut lines are seperate parts).
localMinMaxTotalis the array holding the local minimum and maximum coordinate and local total weight of each part.
totalPartWeights_leftClosest_rightClosetis the output array of accumulation, where total part weights (2P - 1), then left closest distances (P -1), then right closest distance (P -1) are stored.

Definition at line 1763 of file Zoltan2_AlgPQJagged.hpp.

template<typename scalar_t , typename lno_t >
void Zoltan2::pqJagged_1D_Partition ( const RCP< const Environment > &  env,
RCP< Comm< int > > &  comm,
lno_t partitionedPointPermutations,
scalar_t pqJagged_coordinates,
bool  pqJagged_uniformWeights,
scalar_t pqJagged_weights,
scalar_t targetPartWeightRatios,
scalar_t globalMinMaxTotal,
scalar_t localMinMaxTotal,
partId_t  partNo,
int  numThreads,
scalar_t  maxScalar,
scalar_t  minScalar,
scalar_t  imbalanceTolerance,
partId_t  currentPartBeginIndex,
partId_t  concurrentPartCount,
lno_t inTotalCounts,
scalar_t cutCoordinates,
scalar_t cutCoordinatesWork,
scalar_t **  leftClosestDistance,
scalar_t **  rightClosestDistance,
scalar_t cutUpperBounds,
scalar_t cutLowerBounds,
scalar_t cutUpperWeight,
scalar_t cutLowerWeight,
bool *  isDone,
double **  partWeights,
scalar_t local_totalPartWeights_leftClosest_rightCloset,
scalar_t global_totalPartWeights_leftClosest_rightCloset,
bool  allowNonRectelinearPart,
float *  nonRectelinearPartRatios,
scalar_t localCutWeights,
scalar_t globalCutWeights,
partId_t  allDone,
partId_t myNonDoneCounts,
bool  useBinarySearch,
partId_t partIds 
)

Function that is responsible from 1D partitioning of the given range of coordinates.

Parameters:
envlibrary configuration and problem parameters
commthe communicator for the problem
partitionedPointPermutationsis the indices of coordinates in the given partition.
pqJagged_coordinatesis 1 dimensional array holding coordinate values.
pqJagged_uniformWeightsis a boolean value if the points have uniform weights.
pqJagged_weightsis 1 dimensional array holding the weights of points.
targetPartWeightRatiosis the cumulative desired weight ratios for each part. Sized P.
globalMinMaxTotalis the array holding the global min,max and total weight. minimum of part k is on k, maximum is on k + concurrentPartcount, totalweight is on k + 2*concurrentPartCount
localMinMaxTotalis the array holding the local min,max and total weight. Structure is same with globalMinMaxTotal array.
partNois the total number of parts.
numThreadsis the number of available threads by each processor.
maxScalaris the maximum value that scalar_t can represent.
minScalaris the minimum value that scalar_t can represent.
imbalanceToleranceis the maximum allowed imbalance ratio.
currentPartBeginIndexis the beginning index of concurrentPartCount parts on inTotalCounts array.
concurrentPartCountis the number of parts whose cut lines will be calculated concurrently.
inTotalCountsis the array holding the beginning indices of the parts from previous dimension partitioning.
cutCoordinatesis the array holding the coordinates of the cut.
cutCoordinatesWorkis a work array sized P - 1.
leftClosestDistanceis the two dimensional array holding the distances to the closest points to the cut lines from left. One dimension for each thread.
rightClosestDistanceis the two dimensional array holding the distances to the closest points to the cut lines from right. One dimension for each thread.
cutUpperBoundsis the array holding the upper bound coordinate for each cut line. Sized P - 1.
cutLowerBoundsis the array holding the lower bound coordinate for each cut line. Sized P - 1.
cutUpperWeightis the array holding the weight of the parts at the left of upper bound coordinates.
cutLowerWeightis the array holding the weight of the parts at the left of lower bound coordinates.
isDoneis the boolean array to determine if the correct position for a cut line is found.
partWeightsis the two dimensional array holding the part weights. One dimension for each thread.
local_totalPartWeights_leftClosest_rightClosetis one dimensional array holding the local part weights, left and right closest points. Convenient for mpi-reduction.
global_totalPartWeights_leftClosest_rightClosetis one dimensional array holding the local part weights, left and right closest points. Convenient for mpi-reduction.
allowNonRectelinearPartis whether to allow distribution of points on same coordinate to different parts or not.
nonRectelinearPartRatiosis one dimensional array holding the ratio of the points on cut lines representing how many of them will be put to left of the line.
localCutWeightsis one dimensional array holding the local part weights only on cut lines.
globalCutWeightsis one dimensional array holding the global part weights only on cut lines.
allDoneis the number of cut lines whose positions should be calculated.
myNonDoneCountsis one dimensional array holding the number of cut lines in each part whose positions should be calculated.
useBinarySearchis boolean parameter whether to search for cut lines with binary search of linear search.
partIdsis the array that holds the part ids of the coordinates

Definition at line 1884 of file Zoltan2_AlgPQJagged.hpp.

template<typename lno_t , typename scalar_t >
void Zoltan2::getChunksFromCoordinates ( partId_t  partNo,
int  noThreads,
lno_t partitionedPointPermutations,
scalar_t pqJagged_coordinates,
bool  pqJagged_uniformWeights,
scalar_t coordWeights,
scalar_t cutCoordinates,
lno_t  coordinateBegin,
lno_t  coordinateEnd,
bool  allowNonRectelinearPart,
float *  actual_ratios,
scalar_t localPartWeights,
double **  partWeights,
float **  nonRectelinearRatios,
lno_t **  partPointCounts,
lno_t newpartitionedPointPermutations,
lno_t totalCounts,
partId_t partIds 
)

Function that determines the permutation indices of the coordinates.

Parameters:
partNois the number of parts.
noThreadsis the number of threads avaiable for each processor.
partitionedPointPermutationsis the indices of coordinates in the given partition.
pqJagged_coordinatesis 1 dimensional array holding the coordinate values.
pqJagged_uniformWeightsis a boolean value if the points have uniform weights.
pqJagged_weightsis 1 dimensional array holding the weights of points.
cutCoordinatesis 1 dimensional array holding the cut coordinates.
coordinateBeginis the start index of the given partition on partitionedPointPermutations.
coordinateEndis the end index of the given partition on partitionedPointPermutations.
numLocalCoordis the number of local coordinates.
allowNonRectelinearPartis the boolean value whether partitioning should allow distributing the points on same coordinate to different parts.
actual_ratiosholds how much percentage of the coordinates on the cutline should be put on left side.
localPartWeightsis the local totalweight of the processor.
partWeightsis the two dimensional array holding the weight of parts for each thread. Assumes there are 2*P - 1 parts (cut lines are seperate parts).
nonRectelinearRatiosis the two dimensional work array holding ratios of weights to be put left and right of the cut line.
partPointCountsis the two dimensional array holding the number of points in each part for each thread.
newpartitionedPointPermutationsis the indices of coordinates calculated for the partition on next dimension.
totalCountsare the number points in each output part.
partIdsis the array that holds the part ids of the coordinates

Definition at line 2262 of file Zoltan2_AlgPQJagged.hpp.

template<typename T >
T* Zoltan2::allocMemory ( size_t  size)

Definition at line 2660 of file Zoltan2_AlgPQJagged.hpp.

template<typename T >
void Zoltan2::freeArray ( T *&  array)

Definition at line 2674 of file Zoltan2_AlgPQJagged.hpp.

template<typename tt >
std::string Zoltan2::toString ( tt  obj)

Definition at line 2682 of file Zoltan2_AlgPQJagged.hpp.

template<typename Adapter >
void Zoltan2::AlgPQJagged ( const RCP< const Environment > &  env,
RCP< Comm< int > > &  comm,
const RCP< const CoordinateModel< typename Adapter::base_adapter_t > > &  coords,
RCP< PartitioningSolution< Adapter > > &  solution 
)

PQJagged coordinate partitioning algorithm.

Parameters:
envlibrary configuration and problem parameters
commthe communicator for the problem
coordsa CoordinateModel with user data
solutiona PartitioningSolution, on input it contains part information, on return it also contains the solution and quality metrics.

Definition at line 2704 of file Zoltan2_AlgPQJagged.hpp.

template<typename Adapter >
void Zoltan2::AlgRCB ( const RCP< const Environment > &  env,
RCP< Comm< int > > &  problemComm,
const RCP< const CoordinateModel< typename Adapter::base_adapter_t > > &  coords,
RCP< PartitioningSolution< Adapter > > &  solution 
)

Recursive coordinate bisection algorithm.

Parameters:
envlibrary configuration and problem parameters
commthe communicator for the problem
coordsa CoordinateModel with user data
solutiona PartitioningSolution, on input it contains part information, on return it also contains the solution and quality metrics.
Todo:

timing and memory usage profiling and debug messages

catch errors and pass back

write the rcb tree back to the solution

for "repartition", start with the tree in the solution

work on performance issues. Some of the global communication can probably be consolidated into fewer messages.

The algorithm is documented in Recursive Coordinate Bisection (RCB). Please document changes at this page.

Definition at line 83 of file Zoltan2_AlgRCB.hpp.

template<typename Adapter >
void Zoltan2::getFractionLeft ( const RCP< const Environment > &  env,
partId_t  part0,
partId_t  part1,
const RCP< PartitioningSolution< Adapter > > &  solution,
ArrayRCP< double > &  fractionLeft,
partId_t numPartsLeftHalf 
)

Determine the fraction of work in the left half.

Parameters:
envthe Environment for the application.
part0is the first part of the parts to bisected.
part1is the last part of the parts to bisected.
solutionwhich contains the part sizes.
fractionLefton return fractionLeft[w] is the fraction of work wanted in the left half for weight dimension w.
numPartsLeftHalfon return is the number of parts in the left half.

Definition at line 179 of file Zoltan2_AlgRCB_methods.hpp.

template<typename mvector_t >
void Zoltan2::getCutDimension ( const RCP< const Environment > &  env,
const RCP< Comm< int > > &  comm,
int  coordDim,
const RCP< mvector_t > &  vectors,
ArrayView< typename mvector_t::local_ordinal_type >  index,
int &  dimension,
typename mvector_t::scalar_type &  minCoord,
typename mvector_t::scalar_type &  maxCoord 
)

Choose a coordinate dimension for the next cut.

Parameters:
envthe Environment for the application.
commthe communicator
coordDimthe first coordDim vectors in the vectors list are coordinates, the rest are weights.
vectorslists of coordinates and non-uniform weights
indexis the index into the vectors arrays for the coordinates to be included in the partitioning. If index.size() is zero, then include all coordinates.
dimensionon return is the dimension to cut
minCoordon the return is the minimum coordinate value in this dimension.
maxCoordon the return is the maximum coordinate value in this dimension.

Definition at line 238 of file Zoltan2_AlgRCB_methods.hpp.

template<typename mvector_t >
void Zoltan2::migrateData ( const RCP< const Environment > &  env,
const RCP< Comm< int > > &  comm,
ArrayView< unsigned char >  lrflags,
RCP< mvector_t > &  vectors,
int &  leftNumProcs 
)

Migrate coordinates and weights to new processes.

Parameters:
envthe Environment for the application.
commthe communicator for this step.
lrflagseach element in this array must have the value leftFlag or rightFlag to indicate whether the corresponding coordinate is on the left of on the right of the cut.
vectorsis a list of the data to be migrated. On return, vectors contains the new data belonging to this process. param leftNumProcs on return is the number of processes receiving the left half.
Returns:
the number of processes in the left half is returned.

Definition at line 347 of file Zoltan2_AlgRCB_methods.hpp.

template<typename lno_t , typename scalar_t >
scalar_t Zoltan2::getCoordWeight ( lno_t  id,
multiCriteriaNorm  mcnorm,
ArrayView< StridedData< lno_t, scalar_t > >  weights 
)

Definition at line 473 of file Zoltan2_AlgRCB_methods.hpp.

template<typename scalar_t >
bool Zoltan2::emptyPartsCheck ( const RCP< const Environment > &  env,
const ArrayView< double >  fractionLeft,
scalar_t  minCoord,
scalar_t  maxCoord,
leftRightFlag &  lrf,
scalar_t cutValue 
)

Solve partitioning if there are empty parts.

Parameters:
fractionLeftamount of work in left half
minCoordminimum coordinate value
maxCoordmaximum coordinate value
lrfon return, if one side is empty, lrf will be leftFlag or rightFlag to indicate which side is empty.
imbalanceon return, if one half is empty, the imbalance will be set to 0.0 (perfect balance)
cutValueon return, if one half is empty, the cutValue will be set to minCoord or maxCoord depending on which half is empty.
Returns:
true if all coords were moved to one half because the other half is empty, false otherwise.

Definition at line 514 of file Zoltan2_AlgRCB_methods.hpp.

template<typename lno_t , typename gno_t , typename scalar_t >
void Zoltan2::testCoordinatesOnRightBoundary ( const RCP< const Environment > &  env,
const RCP< Comm< int > > &  comm,
scalar_t  totalWeightLeft,
scalar_t  targetLeftScalar,
int  cutLocation,
ArrayView< scalar_t localSums,
ArrayView< scalar_t globalSums,
ArrayView< lno_t index,
ArrayView< StridedData< lno_t, scalar_t > >  weights,
multiCriteriaNorm  mcnorm,
ArrayView< unsigned char >  lrFlags,
scalar_t globalWeightMovedRight 
)

Move boundary coordinates to the right.

Parameters:
envthe environment
commthe communicator
totalWeightLeftthe total weight in the left region at the end of the last iteration.
targetWeightLeftthe ideal weight for the left part.
cutLocationindex into sums of boundary sum. each boundary.
Todo:
document parameters

Definition at line 568 of file Zoltan2_AlgRCB_methods.hpp.

template<typename mvector_t >
void Zoltan2::BSPfindCut ( const RCP< const Environment > &  env,
const RCP< Comm< int > > &  comm,
const std::bitset< NUM_RCB_PARAMS > &  params,
int  numTestCuts,
typename mvector_t::scalar_type  tolerance,
int  cutDim,
int  coordDim,
const RCP< mvector_t > &  vectors,
ArrayView< typename mvector_t::local_ordinal_type >  index,
ArrayView< double >  fractionLeft,
ArrayView< bool >  uniformWeights,
typename mvector_t::scalar_type  coordGlobalMin,
typename mvector_t::scalar_type  coordGlobalMax,
typename mvector_t::scalar_type &  cutValue,
ArrayView< unsigned char >  lrFlags,
typename mvector_t::scalar_type &  totalWeightLeft,
typename mvector_t::scalar_type &  totalWeightRight,
typename mvector_t::local_ordinal_type &  localCountLeft,
typename mvector_t::scalar_type &  imbalance 
)

Find the point in space that divides the data evenly with respect to the weights, part sizes, and the user's objective.

Parameters:
envthe Environment for the application.
commthe communicator for this step.
paramsa bit map of boolean parameters.
numTestCutsthe number of test cuts to make in one round.
tolerancethe maximum acceptable imbalance (0,1).
cutDimthe dimension of the coordinates to cut.
coordDimthe first coordDim vectors in the vectors list are coordinates, the rest are weights.
vectorslists of coordinates and non-uniform weights
indexis the index into the vectors arrays for the coordinates to be included in the partitioning. If index.size() is zero, then all coordinates are included.
fractionLeftthe size of the left part for each weight, the right part should measure 1.0 - fractionLeft.
uniformWeightselement w is true if weights for weight dimension w are all 1.0.
coordGlobalMinthe global minimum of coordinates in dimension cutDim
coordGlobalMaxthe global maximum of coordinates in dimension cutDim
cutValueon return this is the computed cut location.
lrflagson return lists the values leftFlag or rightFlag to indicate whether the corresponding coordinate is on the left of on the right of the cut. Allocated by caller. In particular, if index.size() is non-zero, then lrflags[i] is the flag for coordinate vectors[index[i]]. Otherwise it is the flag for coordinate vectors[i].
totalWeightLefton return is the global total weight left of the cut.
totalWeightRighton return is the global total weight right of the cut.
localCountLefton return is the local number of objects left of the cut.
imbalanceon return is the imbalance for the computed partitioning (0, 1).
Todo:

a separate simpler function when weightDim <= 1

During the first global comm, ensure all procs have same values for cutDim and fractionLeft.

Definition at line 710 of file Zoltan2_AlgRCB_methods.hpp.

template<typename mvector_t , typename Adapter >
void Zoltan2::determineCut ( const RCP< const Environment > &  env,
const RCP< Comm< int > > &  comm,
const std::bitset< NUM_RCB_PARAMS > &  params,
int  numTestCuts,
typename mvector_t::scalar_type  tolerance,
int  coordDim,
const RCP< mvector_t > &  vectors,
const ArrayView< bool >  uniformWeights,
multiCriteriaNorm  mcnorm,
const RCP< PartitioningSolution< Adapter > > &  solution,
partId_t  part0,
partId_t  part1,
ArrayView< unsigned char >  lrflags,
int &  cutDimension,
typename mvector_t::scalar_type &  cutValue,
typename mvector_t::scalar_type &  imbalance,
partId_t numPartsLeftHalf,
typename mvector_t::scalar_type &  weightLeftHalf,
typename mvector_t::scalar_type &  weightRightHalf 
)

Divide the coordinates into a "left" half and "right" half.

Parameters:
envthe Environment for the application.
commthe communicator for this step.
paramsa bit map of boolean parameters.
numTestCutsthe number of test cuts to make in one round.
tolerancethe maximum acceptable imbalance (0,1).
coordDimthe first coordDim vectors in the vectors list are coordinates, the rest are weights.
vectorslists of coordinates and non-uniform weights
uniformWeightselement w is true if weights for weight dimension w are all 1.0.
solutionfor obtaining the part sizes
part0is the first part of the parts to bisected.
part1is the last part of the parts to bisected.
lrflagson return has the value leftFlag or rightFlag to indicate whether the corresponding coordinate is on the left of on the right of the cut. Allocated by caller.
cutDimensionon return coordinate dimension that was cut.
cutValueon return this is the computed cut location.
imbalanceon return is the imbalance for the computed partitioning for cutDim and fractionLeft (0,1).
numPartsLeftHalfon return the number of parts in the left half.
weightLeftHalfon return the total weight in the left half.
weightRightHalfon return the total weight in the right half.

Definition at line 1227 of file Zoltan2_AlgRCB_methods.hpp.

template<typename mvector_t , typename Adapter >
void Zoltan2::serialRCB ( const RCP< const Environment > &  env,
int  depth,
const std::bitset< NUM_RCB_PARAMS > &  params,
int  numTestCuts,
typename mvector_t::scalar_type  tolerance,
int  coordDim,
const RCP< mvector_t > &  vectors,
ArrayView< typename mvector_t::local_ordinal_type >  index,
const ArrayView< bool >  uniformWeights,
const RCP< PartitioningSolution< Adapter > > &  solution,
partId_t  part0,
partId_t  part1,
ArrayView< partId_t partNum 
)

Perform RCB on the local process only.

Parameters:
envthe Environment for the application.
depthdepth of recursion, for debugging, call with "1" first time.
paramsa bit map of boolean parameters.
numTestCutsthe number of test cuts to make in one round.
tolerancethe maximum acceptable imbalance (0,1).
coordDimthe first coordDim vectors in the vectors list are coordinates, the rest are weights.
vectorslists of coordinates and non-uniform weights
indexis the index into the vectors arrays for the coordinates to be included in the partitioning. If index.size() is zero then indexing will not be used.
uniformWeightselement w is true if weights for weight dimension w are all 1.0.
solutionfor obtaining part sizes.
part0is the first part of the parts to bisected.
part1is the last part of the parts to bisected.
partNumon return partNum[i] is the new part number for coordinate i.

Definition at line 1393 of file Zoltan2_AlgRCB_methods.hpp.

template<typename Adapter >
void Zoltan2::AlgPTScotch ( const RCP< const Environment > &  env,
const RCP< const Comm< int > > &  problemComm,
const RCP< GraphModel< typename Adapter::base_adapter_t > > &  model,
RCP< PartitioningSolution< Adapter > > &  solution 
)

Scotch partitioning method.

Parameters:
envparameters for the problem and library configuration
problemCommthe communicator for the problem
modela graph
solutiona Solution object

Preconditions: The parameters in the environment have been processed (committed).

Definition at line 73 of file Zoltan2_AlgScotch.hpp.

void Zoltan2::makeDebugManager ( int  rank,
bool  iPrint,
int  level,
std::string  fname,
int  ost,
Teuchos::RCP< DebugManager > &  mgr 
)

Create an output manager for debugging or status information.

Parameters:
rankthe MPI rank of the calling process in the application
iPrinttrue if this process should output information
fnamename of file to which output is to be appended, or or Z2_UNSET_STRING
ostoutput stream type
mgron return, a pointer to the created output manager

Definition at line 77 of file Zoltan2_Environment.cpp.

template<typename metric_t >
void Zoltan2::makeMetricOutputManager ( int  rank,
bool  iPrint,
std::string  fname,
int  ost,
Teuchos::RCP< MetricOutputManager< metric_t > > &  mgr,
std::string  units,
int  fieldWidth,
RCP< std::ofstream > &  fptr 
)

Create an output manager for a metric value.

Parameters:
rankthe MPI rank of the calling process in the application
iPrinttrue if this process should print metric information
fnamename of file to which output is to be appended, or or Z2_UNSET_STRING
ostoutput stream type
mgron return, a pointer to the created output manager
fptron return, an RCP to an ofstream if one was created.

The template parameter is the data type of the entity being measured.

Definition at line 614 of file Zoltan2_Environment.hpp.

template<typename Integral >
bool Zoltan2::validIntegralRangeList ( const Teuchos::Array< Integral > &  vals)

A helper function that indicates whether an array is a valid integer range list.

Parameters:
valsAn array that may encode an integer range list.
Returns:
true if the array encodes such a list, false otherwise.

Definition at line 91 of file Zoltan2_IntegerRangeList.hpp.

template<typename Integral >
bool Zoltan2::allValuesAreInRangeList ( const Teuchos::Array< Integral > &  vals)

A helper function that determines if all values are in the list.

Parameters:
valsAn array encoding an integer range list.
Returns:
true if the array encoding implies all values, false otherwise.

If the array is not a valid encoding of an integer range list, a std::runtime_error will be thrown.

If the user's parameter value was "all", then after validation the parameter value will be an array of size one containing a code that indicates all values are included, and this function will return true.

Definition at line 121 of file Zoltan2_IntegerRangeList.hpp.

template<typename Integral >
bool Zoltan2::allValuesAreInRangeList ( const Teuchos::ParameterEntry &  e)

A helper function that determines if all values are in the list.

Parameters:
eA parameter entry
Returns:
true if the entry value is an array encoding all values, false otherwise.

If the entry value is not a valid encoding of an integer range list, a std::runtime_error will be thrown.

If the user's parameter value was "all", then after validation the parameter value will be an array of size one containing a code that indicates all values are included, and this function will return true.

Definition at line 143 of file Zoltan2_IntegerRangeList.hpp.

template<typename Integral >
bool Zoltan2::noValuesAreInRangeList ( const Teuchos::Array< Integral > &  vals)

A helper function that determines if no values are in the list.

Parameters:
valsAn array encoding an integer range list.
Returns:
true if the array encoding implies no values, false otherwise.

If the array is not a valid encoding of an integer range list, a std::runtime_error will be thrown.

If the user's parameter value was empty, then after validation the parameter value will be an array of size one containing a code that indicates no values are included, and this function will return true.

Definition at line 168 of file Zoltan2_IntegerRangeList.hpp.

template<typename Integral >
bool Zoltan2::noValuesAreInRangeList ( const Teuchos::ParameterEntry &  e)

A helper function that determines if no values are in the list.

Parameters:
eA parameter entry
Returns:
true if the entry value is an array encoding no values, false otherwise.

If the entry value is not a valid encoding of an integer range list, a std::runtime_error will be thrown.

If the user's parameter value was empty, then after validation the parameter value will be an array of size one containing a code that indicates no values are included, and this function will return true.

Definition at line 190 of file Zoltan2_IntegerRangeList.hpp.

template<typename Integral >
bool Zoltan2::IsInRangeList ( const Integral  val,
const Teuchos::Array< Integral > &  valList,
bool  sorted = true 
)

A helper function that determines if a value is in the list.

Parameters:
valA value that could be in the list.
valsAn array encoding an integer range list.
sortedSet to false if the integer range list is not sorted
Returns:
true if the encoding of vals implies val is in the list, false otherwise.

If vals is not a valid encoding of an integer range list, a std::runtime_error will be thrown.

Definition at line 215 of file Zoltan2_IntegerRangeList.hpp.

template<typename Integral >
bool Zoltan2::IsInRangeList ( const Integral  val,
const Teuchos::ParameterEntry &  e 
)

A helper function that determines if a value is in the list.

Parameters:
valA value that could be in the list.
eA parameter entry
Returns:
true if the entry value implies val is in the list, false otherwise.

If the entry value is not a valid encoding of an integer range list, a std::runtime_error will be thrown.

Definition at line 250 of file Zoltan2_IntegerRangeList.hpp.

template<typename Integral >
Teuchos::ArrayView<Integral> Zoltan2::getList ( Teuchos::Array< Integral > &  irl)

A helper function that returns a view of the list.

Parameters:
irlThe value of an integer range list parameter after it has been validated
Returns:
If the user's parameter value did not imply "all" or "none", then a view of the array of integers implied by the value is returned. Otherwise an empty array is returned.

Definition at line 292 of file Zoltan2_IntegerRangeList.hpp.

template<typename Integral >
void Zoltan2::printIntegralRangeList ( std::ostream &  os,
Teuchos::Array< Integral > &  irl 
)

A helper function that prints the meaning of an encoded integer range list.

Parameters:
osAn output stream to which the list will be printed.
valA value of an integer range list parameter after it has been validated.

Definition at line 312 of file Zoltan2_IntegerRangeList.hpp.

void Zoltan2::createAllParameters ( Teuchos::ParameterList &  pList)

Create a list of all Zoltan2 parameters and validators.

Parameters:
pListon return, pList is the parameter list that was created.

This is the validating parameter list that can be used to process the user's parameter list.

Definition at line 76 of file Zoltan2_Parameters.cpp.

static void Zoltan2::setValidatorsInList ( const Teuchos::ParameterList &  plSome,
const Teuchos::ParameterList &  plAll,
Teuchos::ParameterList &  plVal 
) [static]

Create a parameter list that can validate a specific list of parameters.

Parameters:
plSomethe user's parameter list
plAlla parameter list with all Zoltan2 parameters and their validators
plValon return is a parameter list with all of the user's parameters, but with validators.

Environment::commitParameters() calls validateParametersAndSetDefaults() on the user's parameter list rather than validateParameters() because we want the validators' validateAndModify() methods to be called rather than the validate() methods. But unfortunately, validateAndModify() in addition to modifying the parameter if necessary also sets it to a default if the parameter does not appear in the user's parameter list.

We want the user's parameters to be modified, but we do not want unset parameters to appear in the validated user's parameter list. To achieve this, we create a validating list that contains only the parameters that appear in the user's parameter list.

Definition at line 145 of file Zoltan2_Parameters.cpp.

void Zoltan2::createValidatorList ( const Teuchos::ParameterList &  plIn,
Teuchos::ParameterList &  plOut 
)

Create a list by adding validators to the users parameter list.

Parameters:
plInthe user's parameter list
plOuta new parameter list which is the user's list with our validators added.

Definition at line 178 of file Zoltan2_Parameters.cpp.

void Zoltan2::printListDocumentation ( const Teuchos::ParameterList &  pl,
std::ostream &  os,
std::string  listNames 
)

Definition at line 194 of file Zoltan2_Parameters.cpp.

void Zoltan2::printListDocumentation ( const Teuchos::ParameterList &  pl,
ostream &  os,
string  listNames = string("") 
)
template<typename User >
size_t Zoltan2::removeUndesiredEdges ( const RCP< const Environment > &  env,
int  myRank,
bool  removeSelfEdges,
bool  removeOffProcessEdges,
bool  removeOffGroupEdges,
ArrayView< const typename InputTraits< User >::gid_t > &  gids,
ArrayView< const typename InputTraits< User >::gid_t > &  gidNbors,
ArrayView< const int > &  procIds,
ArrayView< StridedData< typename InputTraits< User >::lno_t, typename InputTraits< User >::scalar_t > > &  edgeWeights,
ArrayView< const typename InputTraits< User >::lno_t > &  offsets,
ArrayRCP< const typename InputTraits< User >::gid_t > &  newGidNbors,
typename InputTraits< User >::scalar_t **&  newWeights,
ArrayRCP< const typename InputTraits< User >::lno_t > &  newOffsets 
)

Helper function to remove undesired edges from a graph.

Parameters:
envthe environment
myRankis my rank in the problem communicator
removeSelfEdgestrue if self-edges (edges such that both vertices are the same) should be removed. If true then gids must be set.
removeOffProcessEdgestrue if edges belonging to processes other than my process should be removed (in which case procIds must be set).
removeOffGroupEdgestrue if edges belonging to processes outside of our communicator should be removed (in which case procIds must be set).
gidsvertex global Id list
gidNborslist of vertex neighbor global ids (edges)
procIdsis the list of processes owning the vertices in the gidNbors list.
edgeWeightsweights for edges in gidNbors list
offsetsoffset into above lists for each vertex in gids.
newGidNborson return a list of the desired neighbors
newWeightsif wdim is the edge weight dimension, then on return this points to wdim pointers to arrays of weights for the desired edges. If it is NULL on return, then one of these must be true:
  • wdim is zero
  • none of the edges are desired
  • all of the edges are desired, so you don't need new lists
Parameters:
newOffsetson return a list of offsets into the above list for the start of the neighbors for each vertex
Returns:
the number of edges left after removal of undesired edges

The template parameter is an InputAdapter type.

Definition at line 104 of file Zoltan2_GraphModel.hpp.

template<typename User >
size_t Zoltan2::computeLocalEdgeList ( const RCP< const Environment > &  env,
int  rank,
size_t  numLocalEdges,
size_t  numLocalGraphEdges,
RCP< const IdentifierMap< User > > &  idMap,
ArrayRCP< const typename InputTraits< User >::gid_t > &  allEdgeIds,
ArrayRCP< int > &  allProcs,
ArrayRCP< const typename InputTraits< User >::lno_t > &  allOffs,
ArrayRCP< StridedData< typename InputTraits< User >::lno_t, typename InputTraits< User >::scalar_t > > &  allWeights,
ArrayRCP< const typename InputTraits< User >::lno_t > &  edgeLocalIds,
ArrayRCP< const typename InputTraits< User >::lno_t > &  offsets,
ArrayRCP< StridedData< typename InputTraits< User >::lno_t, typename InputTraits< User >::scalar_t > > &  eWeights 
)

Helper function to create new edges lists containing only edges connected to a neighbor on this process.

Definition at line 259 of file Zoltan2_GraphModel.hpp.

void Zoltan2::AlltoAllCount ( const Comm< int > &  comm,
const Environment &  env,
const ArrayView< const int > &  sendCount,
const ArrayView< int > &  recvCount 
)

Each process sends a value to every process, an all-to-all.

Parameters:
commThe communicator for the process group involved
envThe environment, required for error messages
sendCountThe number to send to process p is in sendCount[p].
recvCountOn return, The number received from process p will be in recvCount[p].

Note: If Teuchos::Comm adds an AlltoAll method, we should use it instead of this function. TODO

Definition at line 72 of file Zoltan2_AlltoAll.cpp.

template<>
void Zoltan2::AlltoAllv ( const Comm< int > &  comm,
const Environment &  env,
const ArrayView< const string > &  sendBuf,
const ArrayView< const int > &  sendCount,
ArrayRCP< string > &  recvBuf,
const ArrayView< int > &  recvCount 
)

Definition at line 131 of file Zoltan2_AlltoAll.cpp.

template<>
void Zoltan2::AlltoAllv ( const Comm< int > &  comm,
const Environment &  env,
const ArrayView< const unsigned short > &  sendBuf,
const ArrayView< const int > &  sendCount,
ArrayRCP< unsigned short > &  recvBuf,
const ArrayView< int > &  recvCount 
)

Definition at line 250 of file Zoltan2_AlltoAll.cpp.

template<>
void Zoltan2::AlltoAllv ( const Comm< int > &  comm,
const Environment &  env,
const ArrayView< const unsigned char > &  sendBuf,
const ArrayView< const int > &  sendCount,
ArrayRCP< unsigned char > &  recvBuf,
const ArrayView< int > &  recvCount 
)

Definition at line 272 of file Zoltan2_AlltoAll.cpp.

template<typename T >
void Zoltan2::AlltoAllv ( const Comm< int > &  comm,
const Environment &  env,
const ArrayView< const T > &  sendBuf,
const ArrayView< const int > &  sendCount,
ArrayRCP< T > &  recvBuf,
const ArrayView< int > &  recvCount 
)

AlltoAllv sends/receives data to/from all processes.

Parameters:
commThe communicator for the process group involved
envThe environment, required for error messages
sendBufThe data to be sent, in destination process rank order
sendCountThe number of Ts to send to process p is in sendCount[p].
recvBufOn return, recvBuf has been allocated and contains the packets sent to this process by others.
recvCountOn return, The number of Ts received from process p will be in recvCount[p].

The data type T must be a type for which either Zoltan2::IdentifierTraits are defined or Teuchos::DirectSerializationTraits is defined.

AlltoAll uses only point-to-point messages. This is to avoid the MPI limitation of integer offsets and counters in collective operations. In other words, sendBuf.size() can exceed a value that fits into 32 bits. However each point to point message size must fit in an int.

It also avoids non-scalable MPI data structures that are associated with collective operations.

In addition it can be used for Zoltan2 global ID data types that are not serializable by Teuchos point-to-point messages.

Definition at line 93 of file Zoltan2_AlltoAll.hpp.

void Zoltan2::chaco_flush_line ( FILE *  infile) [static]

helper function for zoltan1 chaco reader code Reader code was copied from zoltan1 test driver code.

Definition at line 258 of file Zoltan2_ChacoReader.cpp.

double Zoltan2::chaco_read_val ( FILE *  infile,
int *  end_flag 
)

read a double from a file Reader code was copied from zoltan1 test driver code.

Definition at line 68 of file Zoltan2_ChacoReader.cpp.

int Zoltan2::chaco_read_int ( FILE *  infile,
int *  end_flag 
)

read a int from a file Reader code was copied from zoltan1 test driver code.

Definition at line 163 of file Zoltan2_ChacoReader.cpp.

int Zoltan2::chaco_input_graph ( FILE *  fin,
char *  inname,
int **  start,
int **  adjacency,
int *  nvtxs,
int *  vwgt_dim,
float **  vweights,
int *  ewgt_dim,
float **  eweights 
)

read a Chaco graph file Reader code was copied from zoltan1 test driver code. File is closed when read is completed.

Returns:
0 on success, 1 on failure

Definition at line 275 of file Zoltan2_ChacoReader.cpp.

int Zoltan2::chaco_input_geom ( FILE *  fingeom,
char *  geomname,
int  nvtxs,
int *  igeom,
float **  x,
float **  y,
float **  z 
)

read a Chaco coordinates file Reader code was copied from zoltan1 test driver code. File is closed when read is completed.

Returns:
0 on success, 1 on failure

Definition at line 548 of file Zoltan2_ChacoReader.cpp.

int Zoltan2::getHashCode ( const unsigned char *  a,
size_t  len 
)

helper to hash values larger than int to an int. Hash values do not need to be unique, but there should be as few overlaps as possible.

Definition at line 73 of file Zoltan2_IdentifierTraits.cpp.

template<typename T >
std::pair<T, T> Zoltan2::z2LocalMinMax ( const T *  val,
size_t  n 
)

helper function to find min and max of array of user Ids

Definition at line 82 of file Zoltan2_IdentifierTraits.hpp.

template<typename T >
void Zoltan2::z2GlobalMinMax ( const Comm< int > &  comm,
bool  noLocalValues,
localMin,
localMax,
T &  globalMin,
T &  globalMax 
)

helper function to find global min and max of array of user Ids

Definition at line 118 of file Zoltan2_IdentifierTraits.hpp.

template<typename T >
bool Zoltan2::z2AreConsecutive ( const T *  val,
size_t  n 
)

helper function to determine if list of user Ids are consecutive

Definition at line 148 of file Zoltan2_IdentifierTraits.hpp.

template<typename T >
std::string Zoltan2::stringifyOrdinal ( ordinal)

helper function write a user ID to a string

Definition at line 167 of file Zoltan2_IdentifierTraits.hpp.

void Zoltan2::addNumberToFileName ( int  number,
std::string  fname,
std::string &  newf 
)

Helper method to add number to a file name.

Parameters:
numberthe number (such as process rank) to add
fnamethe file name to modify
newfon return newf is fname with the rank added to the name.

If fname has no dot in it, then the rank is added to the end of the name. Otherwise the rank is added before the first dot in fname.

Definition at line 56 of file Zoltan2_IO.cpp.

template<typename scalar_t >
void Zoltan2::getStridedStats ( const ArrayView< scalar_t > &  v,
int  stride,
int  offset,
scalar_t min,
scalar_t max,
scalar_t sum 
)

Find min, max and sum of metric values.

Parameters:
va list of values
stridethe value such that v[offset + stride*i] will be included in the calculation for all possible i.
offsetthe offset at which calculation will begin.
minon return, min will hold the minimum of the values.
maxon return, max will hold the maximum of the values.
sumon return, max will hold the sum of the values.

Definition at line 262 of file Zoltan2_Metric.hpp.

template<typename scalar_t , typename pnum_t , typename lno_t >
void Zoltan2::normedPartWeights ( const RCP< const Environment > &  env,
int  numberOfParts,
const ArrayView< const pnum_t > &  parts,
const ArrayView< StridedData< lno_t, scalar_t > > &  vwgts,
multiCriteriaNorm  mcNorm,
scalar_t weights 
)

Compute the total weight in each part on this process.

Parameters:
envthe Environment for error messages
numberOfPartsthe number of Parts with respect to which weights should be computed.
partsthe part Id for each object, which may range from 0 to one less than numberOfParts
vwgtsvwgts[w] is the StridedData object representing weight dimension w. vwgts[w][i] is the w'th weight for object i.
mcNormthe multiCriteria norm, to be used if weight dimension is greater than one.
weightson return, weights[p] is the total weight for part p. weights is allocated by the caller
Todo:
  • Zoltan_norm() in Zoltan may scale the weight. Do we ever need this?

< 1-norm = Manhattan norm

< 2-norm = sqrt of sum of squares

< inf-norm = maximum norm

Definition at line 294 of file Zoltan2_Metric.hpp.

template<typename scalar_t , typename pnum_t , typename lno_t >
void Zoltan2::globalSumsByPart ( const RCP< const Environment > &  env,
const RCP< const Comm< int > > &  comm,
const ArrayView< const pnum_t > &  part,
const ArrayView< StridedData< lno_t, scalar_t > > &  vwgts,
multiCriteriaNorm  mcNorm,
partId_t numParts,
partId_t numNonemptyParts,
ArrayRCP< MetricValues< scalar_t > > &  metrics,
ArrayRCP< scalar_t > &  globalSums 
)

Given the local partitioning, compute the global sums in each part.

Parameters:
envEnvironment for error handling
commcommunicator
partpart[i] is the part ID for local object i
vwgtsvwgts[w] is the StridedData object representing weight dimension w. The weight dimension (which must be at least one) is taken to be vwgts.size(). If vwgts[wdim].size() == 0, we assume uniform weights for weight dimension wdim.
mcNormthe multiCriteria norm, to be used if weight dimension is greater than one.
numPartson return this is the global number of parts.
numNonemptyPartson return this is the number of those parts that are non-empty.
metricson return points to a list of named MetricValues objects that each contains the global min, max and avg over parts of the item being measured. The list may contain "object count", "normed weight", "weight 1", "weight 2" and so on in that order. If uniform weights were given, then only "object count" appears. If one dimension of non-uniform weights were given, then "object count" and "weight 1" appear. Finally, if multiple weights were given, we have "object count", then "normed weight", then the individual weights "weight 1", "weight 2", and so on.
globalSumsIf weights are uniform, the globalSums is the numParts totals of global number of objects in each part. Suppose the weight dimension is W. If W is 1, then on return this is an array of length 2*numParts . The first numParts entries are the count of objects in each part, and the second is the total weight in each part. If W is greater than one, then the length of this array is (2+W)*numParts . The first numParts entries are the count of objects in each part. The next numParts entries are the sum of the normed weights in each part. The final entries are the sum of the individual weights in each part, by weight dimension by part number. The array is allocated here.

globalSumsByPart() must be called by all processes in comm. The imbalance metrics are not yet set in the MetricValues objects, because they require part size information.

Definition at line 454 of file Zoltan2_Metric.hpp.

template<typename scalar_t >
void Zoltan2::computeImbalances ( partId_t  numParts,
partId_t  targetNumParts,
const scalar_t psizes,
scalar_t  sumVals,
const scalar_t vals,
scalar_t min,
scalar_t max,
scalar_t avg 
)

Compute the imbalance.

Parameters:
numPartsthe number of parts supplied, which is the length of the vals array.
targetNumPartsthe number of parts desired, which is the length of the psizes array if it is defined.
psizesif part sizes are not uniform then psizes[p] is the part size for part p, for p ranging from zero to one less than targetNumParts. Part sizes must sum to one. If part sizes are uniform, psizes should be NULL.
sumValsis the sum of the values in the vals list.
vals vals[p] is the amount in part p, for p ranging from zero to one less than numParts.
minon return, min will be the minimum (best) imbalance of all the parts.
maxon return, max will be the maximum imbalance of all the parts.
avgon return avg will be the average imbalance across the parts.

Imbalance is a value between zero and one. If target is the desired amount in part p and actual is the actual amount in part p, then the imbalance is:

           abs(target - actual) / target

If the part is supposed to be empty (target is zero), then no imbalance is computed for that part. If actual for that part is non-zero, then other parts are too small and the imbalance will be found in those other parts.

Definition at line 701 of file Zoltan2_Metric.hpp.

template<typename scalar_t >
void Zoltan2::computeImbalances ( partId_t  numParts,
partId_t  targetNumParts,
int  numSizes,
ArrayView< ArrayRCP< scalar_t > >  psizes,
scalar_t  sumVals,
const scalar_t vals,
scalar_t min,
scalar_t max,
scalar_t avg 
)

Compute the imbalance in the case of multiple part sizes.

Parameters:
numPartsthe number of parts supplied, which is the length of the vals array.
targetNumPartsthe number of parts desired, which is the length of the psizes array if it is defined.
numSizesthe number of part size arrays
psizesis an array of numSizes pointers to part size arrays. If the part sizes for dimension w are uniform, then psizes[w] should be NULL. Otherwise it should point to targetNumParts sizes, and the sizes for each dimension should sum to one.
sumValsis the sum of the values in the vals list.
vals vals[p] is the amount in part p, for p ranging from zero to one less than numParts.
minon return, min will be the minimum (best) imbalance of all the parts.
maxon return, max will be the maximum imbalance of all the parts.
avgon return avg will be the average imbalance across the parts.

Imbalance is a value between zero and one. If target is the desired amount in part p and actual is the actual amount in part p, then the imbalance is:

           abs(target - actual) / target

If the part is supposed to be empty (target is zero), then no imbalance is computed for that part. If actual for that part is non-zero, then other parts are too small and the imbalance will be found in those other parts.

Definition at line 789 of file Zoltan2_Metric.hpp.

template<typename Adapter >
void Zoltan2::objectMetrics ( const RCP< const Environment > &  env,
const RCP< const Comm< int > > &  comm,
multiCriteriaNorm  mcNorm,
const RCP< const Adapter > &  ia,
const RCP< const PartitioningSolution< Adapter > > &  solution,
partId_t numParts,
partId_t numNonemptyParts,
ArrayRCP< MetricValues< typename Adapter::scalar_t > > &  metrics 
)

Compute imbalance metrics for a distribution.

Parameters:
envThe problem environment.
commThe problem communicator.
iathe InputAdapter object which corresponds to the Solution.
solutionthe PartitioningSolution to be evaluated.
mcNormis the multicriteria norm to use if the weight dimension is greater than one. See the multiCriteriaNorm enumerator for mcNorm values.
numPartson return is the global number of parts in the solution
numNonemptyPartson return is the global number of parts to which objects are assigned.
metricson return points to a list of named MetricValues objects that each contains the global min, max and avg over parts and also imbalance measures of the item being measured. The list may contain "object count", "normed weight", "weight 1", "weight 2" and so on in that order. If uniform weights were given, then only "object count" appears. If one dimension of non-uniform weights were given, then "object count" and "weight 1" appear. Finally, if multiple weights were given, we have "object count", then "normed weight", then the individual weights "weight 1", "weight 2", and so on.

objectMetrics() must be called by all processes in comm. See the metricOffset enumerator in the MetricValues class for the interpretation of the metric quantities.

Todo:
check that part sizes sum to one if we're doing COMPLEX_ASSERTION

Definition at line 924 of file Zoltan2_Metric.hpp.

template<typename scalar_t >
void Zoltan2::printMetrics ( ostream &  os,
partId_t  targetNumParts,
partId_t  numParts,
partId_t  numNonemptyParts,
const ArrayView< MetricValues< scalar_t > > &  infoList 
)

Print out a header and the values for a list of metrics.

Definition at line 1069 of file Zoltan2_Metric.hpp.

template<typename scalar_t >
void Zoltan2::printMetrics ( ostream &  os,
partId_t  targetNumParts,
partId_t  numParts,
partId_t  numNonemptyParts,
const MetricValues< scalar_t > &  info 
)

Print out a header and the values for a single metric.

Definition at line 1095 of file Zoltan2_Metric.hpp.

template<typename scalar_t >
scalar_t Zoltan2::normedWeight ( ArrayView< scalar_t weights,
multiCriteriaNorm  norm 
)

Compute the norm of the vector of weights.

< 1-norm = Manhattan norm

< 2-norm = sqrt of sum of squares

< inf-norm = maximum norm

Definition at line 1107 of file Zoltan2_Metric.hpp.

template<typename lno_t , typename scalar_t >
scalar_t Zoltan2::normedWeight ( ArrayView< StridedData< lno_t, scalar_t > >  weights,
lno_t  idx,
multiCriteriaNorm  norm 
)

Compute the norm of the vector of weights stored as StridedData.

Definition at line 1156 of file Zoltan2_Metric.hpp.

long Zoltan2::getProcessKilobytes ( )

Definition at line 67 of file Zoltan2_Util.cpp.

template<typename scalar_t >
bool Zoltan2::outsideRegion ( scalar_t  val,
scalar_t  mark,
double  epsilon 
) [inline]

Definition at line 63 of file Zoltan2_Util.hpp.

std::string Zoltan2::Zoltan2_Version ( )

Definition at line 59 of file Zoltan2_Version.cpp.


Variable Documentation

char Zoltan2::chaco_line[LINE_LENGTH] [static]

Definition at line 58 of file Zoltan2_ChacoReader.cpp.

int Zoltan2::chaco_offset = 0 [static]

Definition at line 59 of file Zoltan2_ChacoReader.cpp.

int Zoltan2::chaco_break_pnt = LINE_LENGTH [static]

Definition at line 60 of file Zoltan2_ChacoReader.cpp.

Definition at line 61 of file Zoltan2_ChacoReader.cpp.