Zoltan2  Version of the Day
Classes | Namespaces | Macros | Functions
Zoltan2_AlgPQJagged.hpp File Reference

Contains the PQ-jagged algorthm. More...

#include <Zoltan2_AlgRCB_methods.hpp>
#include <Zoltan2_CoordinateModel.hpp>
#include <Zoltan2_Metric.hpp>
#include <Tpetra_Distributor.hpp>
#include <Teuchos_ParameterList.hpp>
#include <Zoltan2_CoordinatePartitioningGraph.hpp>
#include <new>
#include <algorithm>
#include <bitset>
Include dependency graph for Zoltan2_AlgPQJagged.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  Teuchos::PQJaggedCombinedReductionOp< Ordinal, T >
 
class  Teuchos::PQJaggedCombinedMinMaxTotalReductionOp< Ordinal, T >
 
class  Zoltan2::pqJagged_PartVertices< lno_t, partId_t >
 A helper class containing array representation of coordinate linked lists. More...
 
class  Zoltan2::uMultiSortItem< IT, CT, WT >
 
struct  Zoltan2::uSortItem< IT, WT >
 

Namespaces

 Teuchos
 
 Zoltan2
 

Macros

#define EPS_SCALE   1
 
#define LEAST_SIGNIFICANCE   0.0001
 
#define SIGNIFICANCE_MUL   1000
 
#define FUTURE_REDUCEALL_CUTOFF   1500000
 
#define MIN_WORK_LAST_DIM   4000
 
#define ABS(x)   ((x) >= 0 ? (x) : -(x))
 
#define LEAF_IMBALANCE_FACTOR   0.1
 
#define BINARYCUTOFF   32
 
#define imbalanceOf(Wachieved, totalW, expectedRatio)   (Wachieved) / ((totalW) * (expectedRatio)) - 1
 
#define imbalanceOf2(Wachieved, wExpected)   (Wachieved) / (wExpected) - 1
 
#define MAXOF   (a,b) (((a)>(b))?(a):(b))
 
#define KCUTOFF   0.80
 
#define forceMigration   1500000
 
#define Z2_DEFAULT_CON_PART_COUNT   16
 
#define SWAP(a, b, temp)   temp=(a);(a)=(b);(b)=temp;
 

Functions

template<typename T >
void Zoltan2::firstTouch (T *arrayName, size_t arraySize)
 
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, scalar_t _EPSILON)
 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. More...
 
template<typename T >
void Zoltan2::get_partitioning_params (const Teuchos::ParameterList &pl, T &imbalanceTolerance, multiCriteriaNorm &mcnorm, std::bitset< NUM_RCB_PARAMS > &params, int &numTestCuts, bool &ignoreWeights)
 
template<typename T >
void Zoltan2::pqJagged_getParameters (const Teuchos::ParameterList &pl, bool &allowNonrectilinear, partId_t &concurrentPartCount, int &migration_actualMigration_option, int &migration_check_option, int &migration_all2all_option, T &migration_imbalance_cut_off, int &migration_assignment_type, int &keep_part_boxes, int &enable_rcb, int &recursion_depth)
 Returns the parameters such as: Partitioning problem parameters of interest: Partitioning objective imbalance_tolerance. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
template<typename partId_t >
partId_t Zoltan2::getPartCount (partId_t numFuture, float root, float fEpsilon)
 
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. More...
 
template<typename scalar_t >
void Zoltan2::pqJagged_getCutCoord_Weights (scalar_t minCoordinate, scalar_t maxCoordinate, bool pqJagged_uniformParts, bool pqJagged_uniformWeights, scalar_t *pqJagged_partSizes, partId_t noCuts, scalar_t globalTotalWeight, scalar_t *cutCoordinates, scalar_t *cutPartRatios, int numThreads, vector< partId_t > *currentPartitions, vector< partId_t > *futurePartitions, partId_t partIndex, partId_t futureArrayIndex)
 Function that calculates the new coordinates for the cut lines. Function is called inside the parallel region. More...
 
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 *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. More...
 
template<typename scalar_t , typename lno_t >
void Zoltan2::pqJagged_1DPart_getPartWeights (size_t total_part_count, partId_t noCuts, scalar_t maxCoordinate, scalar_t minCoordinate, 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. More...
 
template<typename scalar_t >
void Zoltan2::accumulateThreadResults (const vector< partId_t > &pVector, partId_t vBegin, partId_t concurrentPartCount, int numThreads, bool *isDone, scalar_t **leftClosestPoints, scalar_t **rightClosestPoints, double **partWeights, 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. More...
 
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, int numThreads, 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, vector< partId_t > &pVector)
 Function that is responsible from 1D partitioning of the given range of coordinates. More...
 
template<typename T >
T * Zoltan2::allocMemory (size_t size)
 
template<typename T >
void Zoltan2::freeArray (T *&array)
 
template<typename tt >
std::string Zoltan2::toString (tt obj)
 
template<class IT , class WT >
void Zoltan2::uqsort (IT n, uSortItem< IT, WT > *arr)
 
template<typename scalar_t , typename partId_t >
partId_t Zoltan2::getPartitionArrays (const partId_t *partNo, vector< partId_t > &pAlongI, vector< partId_t > *currentPartitions, vector< partId_t > *newFuturePartitions, partId_t &futurePartNumbers, partId_t currentPartitionCount, int partArraySize, int i, partId_t maxPartNo, int keep_part_boxes, RCP< vector< coordinateModelPartBox< scalar_t, partId_t > > > inPartBoxes, RCP< vector< coordinateModelPartBox< scalar_t, partId_t > > > outPartBoxes)
 
template<typename scalar_t , typename lno_t , typename partId_t >
void Zoltan2::getInitialPartAssignments (scalar_t &maxCoordinate, scalar_t &minCoordinate, partId_t &currentPart, lno_t *inTotalCounts, lno_t *partitionedPointCoordinates, scalar_t *pqCoord, partId_t *partIds, scalar_t _EPSILON, partId_t &partition)
 Function that calculates the new coordinates for the cut lines. Function is called inside the parallel region. More...
 
template<typename partId_t >
void Zoltan2::getPartSpecifications (const partId_t *partNo, int partArraySize, size_t &numGlobalParts, partId_t &totalDimensionCut, partId_t &totalPartCount, partId_t &maxPartNo, partId_t &reduceAllCount, partId_t &maxTotalCumulativePartCount, partId_t &maxCutNo, size_t &maxTotalPartCount)
 
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, bool isSequentialAndPricise, scalar_t **pqJaggedAllCoordinates, int pqCoordDim, int currentCoord)
 Function that determines the permutation indices of the coordinates. More...
 
template<typename scalar_t , typename lno_t , typename partId_t >
void Zoltan2::sequentialTaskPartitioning (const RCP< const Environment > &env, lno_t numLocalCoords, lno_t actualNumCoords, size_t numGlobalParts, int coordDim, scalar_t **pqJagged_coordinates, lno_t *output_permutation, lno_t *output_partIndices)
 
template<typename Adapter >
void Zoltan2::AlgPQJagged (const RCP< const Environment > &env, RCP< Comm< int > > &problemComm, const RCP< const CoordinateModel< typename Adapter::base_adapter_t > > &coords, RCP< PartitioningSolution< Adapter > > &solution)
 PQJagged coordinate partitioning algorithm. More...
 

Detailed Description

Contains the PQ-jagged algorthm.

Definition in file Zoltan2_AlgPQJagged.hpp.

Macro Definition Documentation

#define EPS_SCALE   1

Definition at line 75 of file Zoltan2_AlgPQJagged.hpp.

#define LEAST_SIGNIFICANCE   0.0001

Definition at line 76 of file Zoltan2_AlgPQJagged.hpp.

#define SIGNIFICANCE_MUL   1000

Definition at line 77 of file Zoltan2_AlgPQJagged.hpp.

#define FUTURE_REDUCEALL_CUTOFF   1500000

Definition at line 78 of file Zoltan2_AlgPQJagged.hpp.

#define MIN_WORK_LAST_DIM   4000

Definition at line 79 of file Zoltan2_AlgPQJagged.hpp.

#define ABS (   x)    ((x) >= 0 ? (x) : -(x))

Definition at line 84 of file Zoltan2_AlgPQJagged.hpp.

#define LEAF_IMBALANCE_FACTOR   0.1

Definition at line 86 of file Zoltan2_AlgPQJagged.hpp.

#define BINARYCUTOFF   32

Definition at line 87 of file Zoltan2_AlgPQJagged.hpp.

#define imbalanceOf (   Wachieved,
  totalW,
  expectedRatio 
)    (Wachieved) / ((totalW) * (expectedRatio)) - 1

Definition at line 90 of file Zoltan2_AlgPQJagged.hpp.

#define imbalanceOf2 (   Wachieved,
  wExpected 
)    (Wachieved) / (wExpected) - 1

Definition at line 92 of file Zoltan2_AlgPQJagged.hpp.

#define MAXOF   (a,b) (((a)>(b))?(a):(b))

Definition at line 94 of file Zoltan2_AlgPQJagged.hpp.

#define KCUTOFF   0.80

Definition at line 96 of file Zoltan2_AlgPQJagged.hpp.

#define forceMigration   1500000

Definition at line 97 of file Zoltan2_AlgPQJagged.hpp.

#define Z2_DEFAULT_CON_PART_COUNT   16

Definition at line 98 of file Zoltan2_AlgPQJagged.hpp.

#define SWAP (   a,
  b,
  temp 
)    temp=(a);(a)=(b);(b)=temp;