|
Zoltan2
|
Namespaces | |
| namespace | Details |
Classes | |
| class | AlgSerialGreedy |
| struct | GMWM_triplet |
| class | AlgAMD |
| class | AlgNatural |
| class | AlgRandom |
| class | AlgRCM |
| class | AlgSortedDegree |
| class | SortPairs |
| class | AlgBlock |
| class | uMultiSortItem |
| Class for sorting items with multiple values. First sorting with respect to val[0], then val[1] then ... val[count-1]. The last tie breaking is done with index values. Used for task mapping partitioning where the points on a cut line needs to be distributed consistently. More... | |
| struct | uSortItem |
| Sort items for quick sort function. More... | |
| class | AlgMJ |
| Multi Jagged coordinate partitioning algorithm. More... | |
| class | Zoltan2_AlgMJ |
| Multi Jagged coordinate partitioning algorithm. More... | |
| class | AlgParMETIS |
| class | AlgRCB |
| Recursive coordinate bisection algorithm. More... | |
| class | AlgPTScotch |
| class | AlgWolf |
| The boolean parameters of interest to the Block algorithm. More... | |
| class | GNO_LNO_PAIR |
| class | KmeansHeap |
| KmeansHeap Class, max heap, but holds the minimum values. More... | |
| class | KMeansCluster |
| KMeansCluster Class. More... | |
| class | KMeansAlgorithm |
| KMeansAlgorithm Class that performs clustering of the coordinates, and returns the closest set of coordinates. Useful to filter the processors, when there are more processors than needed. More... | |
| class | CommunicationModel |
| CommunicationModel Base Class that performs mapping between the coordinate partitioning result. More... | |
| class | CoordinateCommunicationModel |
| CoordinateModelInput Class that performs mapping between the coordinate partitioning result and mpi ranks base on the coordinate results and mpi physical coordinates. More... | |
| class | CoordinateTaskMapper |
| class | Algorithm |
| Algorithm defines the base class for all algorithms. More... | |
| struct | TPL_Traits |
| struct | TPL_Traits< tpl_t, tpl_t > |
| 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 | MachineRepresentation |
| MachineRepresentation Class Finds the coordinate of the processor. Used to find the processor coordinates or graph. More... | |
| class | MetricOutputManager |
| MetricOutputManager handles output of profiling messages. More... | |
| class | TimerManager |
| class | BaseAdapter |
| BaseAdapter defines methods required by all Adapters. More... | |
| class | BasicIdentifierAdapter |
| This class represents a collection of global Identifiers and their associated weights, if any. More... | |
| class | BasicVectorAdapter |
| BasicVectorAdapter represents a vector (plus optional weights) supplied by the user as pointers to strided arrays. More... | |
| class | GraphAdapter |
| GraphAdapter defines the interface for graph-based user data. More... | |
| class | IdentifierAdapter |
| IdentifierAdapter defines the interface for identifiers. More... | |
| class | MatrixAdapter |
| MatrixAdapter defines the adapter interface for matrices. More... | |
| class | MeshAdapter |
| MeshAdapter defines the interface for mesh input. More... | |
| class | PamgenMeshAdapter |
| This class represents a mesh. More... | |
| class | VectorAdapter |
| VectorAdapter defines the interface for vector input. More... | |
| class | XpetraCrsGraphAdapter |
| Provides access for Zoltan2 to Xpetra::CrsGraph data. More... | |
| class | XpetraCrsMatrixAdapter |
| Provides access for Zoltan2 to Xpetra::CrsMatrix data. More... | |
| class | XpetraMultiVectorAdapter |
| An adapter for Xpetra::MultiVector. More... | |
| class | XpetraRowMatrixAdapter |
| Provides access for Zoltan2 to Xpetra::RowMatrix data. More... | |
| struct | XpetraTraits |
| Defines the traits required for Tpetra, Eptra and Xpetra objects. 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 | ColoringProblem |
| ColoringProblem sets up coloring problems for the user. More... | |
| class | ColoringSolution |
| The class containing coloring solution. More... | |
| class | OrderingProblem |
| OrderingProblem sets up ordering problems for the user. More... | |
| class | OrderingSolution |
| The class containing ordering solutions. 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 | PartitionMapping |
| PartitionMapping maps a solution or an input distribution to ranks. 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 | coordinateModelPartBox |
| coordinateModelPartBox Class, represents the boundaries of the box which is a result of a geometric partitioning algorithm. More... | |
| class | GridHash |
| GridHash Class, Hashing Class for part boxes. 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 int | default_part_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 KokkosClassic::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_rectilinear, 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 | BaseAdapterType { InvalidAdapterType = 0, IdentifierAdapterType, CoordinateAdapterType, VectorAdapterType, MatrixAdapterType, GraphAdapterType, MeshAdapterType } |
| An enum to identify general types of adapters. More... | |
| enum | GraphEntityType { GRAPH_VERTEX, GRAPH_EDGE } |
| Enumerated entity type for graphs: Vertices or Edges. More... | |
| enum | MatrixEntityType { MATRIX_ROW, MATRIX_COLUMN, MATRIX_NONZERO } |
| enum | MeshEntityType { MESH_REGION, MESH_FACE, MESH_EDGE, MESH_VERTEX } |
| Enumerate entity types for meshes: Regions, Faces, Edges, or Vertices. More... | |
| enum | ModelType { HypergraphModelType, GraphModelType, CoordinateModelType, IdentifierModelType, MAX_NUM_MODEL_TYPES } |
| 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 vtx_t , typename wgt_t > | |
| static bool | compare_triplets (GMWM_triplet< vtx_t, wgt_t > a, GMWM_triplet< vtx_t, wgt_t > b) |
| template<typename vtx_t , typename wgt_t > | |
| vtx_t | GreedyMWM (int *idx, vtx_t *adj, wgt_t *wgt, vtx_t tnVtx, vtx_t *match) |
| template<typename Adapter > | |
| int | AlgSpectral (const RCP< GraphModel< Adapter > > &model, const RCP< OrderingSolution< typename Adapter::zgid_t, typename Adapter::lno_t > > &solution, const RCP< Teuchos::ParameterList > &pl, const RCP< const Teuchos::Comm< int > > &comm) |
| template<typename T > | |
| T * | allocMemory (size_t size) |
| Allocates memory for the given size. | |
| template<typename T > | |
| void | freeArray (T *&array) |
| Frees the given array. | |
| template<typename tt > | |
| std::string | toString (tt obj) |
| Converts the given object to string. | |
| template<class IT , class WT > | |
| void | uqsort (IT n, uSortItem< IT, WT > *arr) |
| Quick sort function. Sorts the arr of uSortItems, with respect to increasing vals. | |
| template<typename Adapter > | |
| void | getFractionLeft (const RCP< const Environment > &env, typename Adapter::part_t part0, typename Adapter::part_t part1, const RCP< PartitioningSolution< Adapter > > &solution, ArrayRCP< double > &fractionLeft, typename Adapter::part_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 > ¶ms, int numTestCuts, typename mvector_t::scalar_type tolerance, int cutDim, int coordDim, int nWeightsPerCoord, const RCP< mvector_t > &vectors, ArrayView< typename mvector_t::local_ordinal_type > index, ArrayView< double > fractionLeft, 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 > ¶ms, int numTestCuts, typename mvector_t::scalar_type tolerance, int coordDim, int nWeightsPerCoord, const RCP< mvector_t > &vectors, multiCriteriaNorm mcnorm, const RCP< PartitioningSolution< Adapter > > &solution, typename Adapter::part_t part0, typename Adapter::part_t part1, ArrayView< unsigned char > lrflags, int &cutDimension, typename mvector_t::scalar_type &cutValue, typename mvector_t::scalar_type &imbalance, typename Adapter::part_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 > ¶ms, int numTestCuts, typename mvector_t::scalar_type tolerance, int coordDim, int nWeightsPerCoord, const RCP< mvector_t > &vectors, ArrayView< typename mvector_t::local_ordinal_type > index, const RCP< PartitioningSolution< Adapter > > &solution, typename Adapter::part_t part0, typename Adapter::part_t part1, ArrayView< typename Adapter::part_t > partNum) |
| Perform RCB on the local process only. | |
| template<typename it > | |
| it | z2Fact (it x) |
| template<typename IT > | |
| void | ithPermutation (const IT n, IT i, IT *perm) |
| template<typename part_t > | |
| void | getGridCommunicationGraph (part_t taskCount, part_t *&task_comm_xadj, part_t *&task_comm_adj, vector< int > grid_dims) |
| template<typename Adapter , typename scalar_t , typename part_t > | |
| void | getSolutionCenterCoordinates (const Environment *envConst, const Teuchos::Comm< int > *comm, const Zoltan2::CoordinateModel< typename Adapter::base_adapter_t > *coords, const Zoltan2::PartitioningSolution< Adapter > *soln_, int coordDim, part_t ntasks, scalar_t **partCenters) |
| template<typename T > | |
| void | fillContinousArray (T *arr, size_t arrSize, T *val) |
| fillContinousArray function | |
| template<typename part_t , typename pcoord_t , typename tcoord_t > | |
| void | coordinateTaskMapperInterface (RCP< const Teuchos::Comm< int > > problemComm, int proc_dim, int num_processors, pcoord_t **machine_coords, int task_dim, part_t num_tasks, tcoord_t **task_coords, part_t *task_comm_xadj, part_t *task_comm_adj, pcoord_t *task_communication_edge_weight_, part_t *proc_to_task_xadj, part_t *proc_to_task_adj, int recursion_depth, part_t *part_no_array, part_t *machine_dimensions) |
| Constructor The interface function that calls CoordinateTaskMapper which will also perform the mapping operation. The result mapping can be obtained by. | |
| 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) |
| static ssize_t | in_list (const int value, size_t count, int *vector) |
| template<typename User > | |
| size_t | removeUndesiredEdges (const RCP< const Environment > &env, int myRank, bool removeSelfEdges, bool removeOffProcessEdges, bool removeOffGroupEdges, ArrayView< const typename InputTraits< User >::zgid_t > &gids, ArrayView< const typename InputTraits< User >::zgid_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 >::zgid_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, const RCP< const Comm< int > > &comm, size_t numLocalEdges, size_t numLocalGraphEdges, RCP< const IdentifierMap< User > > &idMap, ArrayRCP< const typename InputTraits< User >::zgid_t > &allEdgeIds, ArrayRCP< const typename InputTraits< User >::gno_t > &allEdgeGnos, 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 std::string > &sendBuf, const ArrayView< const int > &sendCount, ArrayRCP< std::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 *nVwgts, float **vweights, int *nEwgts, 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 , typename part_t > | |
| void | normedPartWeights (const RCP< const Environment > &env, part_t 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 , typename part_t > | |
| void | globalSumsByPart (const RCP< const Environment > &env, const RCP< const Comm< int > > &comm, const ArrayView< const pnum_t > &part, int vwgtDim, const ArrayView< StridedData< lno_t, scalar_t > > &vwgts, multiCriteriaNorm mcNorm, part_t &numParts, part_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 , typename part_t > | |
| void | computeImbalances (part_t numParts, part_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 , typename part_t > | |
| void | computeImbalances (part_t numParts, part_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, typename Adapter::part_t &numParts, typename Adapter::part_t &numNonemptyParts, ArrayRCP< MetricValues< typename Adapter::scalar_t > > &metrics) |
| Compute imbalance metrics for a distribution. | |
| template<typename scalar_t , typename part_t > | |
| void | printMetrics (std::ostream &os, part_t targetNumParts, part_t numParts, part_t numNonemptyParts, const ArrayView< MetricValues< scalar_t > > &infoList) |
| Print out a header and the values for a list of metrics. | |
| template<typename scalar_t , typename part_t > | |
| void | printMetrics (std::ostream &os, part_t targetNumParts, part_t numParts, part_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 int Zoltan2::default_lno_t |
Definition at line 67 of file Zoltan2_InputTraits.hpp.
| typedef int Zoltan2::default_part_t |
Definition at line 69 of file Zoltan2_InputTraits.hpp.
| typedef double Zoltan2::default_scalar_t |
Definition at line 92 of file Zoltan2_InputTraits.hpp.
| typedef int Zoltan2::default_gno_t |
Definition at line 93 of file Zoltan2_InputTraits.hpp.
| typedef std::bitset<NUM_MODEL_FLAGS> Zoltan2::modelFlag_t |
Definition at line 93 of file Zoltan2_Model.hpp.
| typedef size_t Zoltan2::global_size_t |
Definition at line 117 of file Zoltan2_Standards.hpp.
| typedef KokkosClassic::DefaultNode::DefaultNodeType Zoltan2::default_node_t |
Definition at line 146 of file Zoltan2_Standards.hpp.
| enum Zoltan2::blockParams |
The boolean parameters of interest to the Block algorithm.
Definition at line 64 of file Zoltan2_AlgBlock.hpp.
| enum Zoltan2::rcbParams |
The boolean parameters of interest to the RCB algorithm.
Definition at line 138 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.)
Definition at line 157 of file Zoltan2_AlgRCB_methods.hpp.
| enum Zoltan2::RangeType |
Codes that indicate how to interpret the Array<int> representing the user's integer range list.
| 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 76 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.
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.
Definition at line 98 of file Zoltan2_Parameters.hpp.
| enum Zoltan2::TimerType |
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.
Definition at line 118 of file Zoltan2_Parameters.hpp.
| enum Zoltan2::OSType |
Output stream types.
| 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.
| 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 adapters.
Definition at line 73 of file Zoltan2_Adapter.hpp.
Enumerated entity type for graphs: Vertices or Edges.
Definition at line 61 of file Zoltan2_GraphAdapter.hpp.
Definition at line 58 of file Zoltan2_MatrixAdapter.hpp.
Enumerate entity types for meshes: Regions, Faces, Edges, or Vertices.
Definition at line 62 of file Zoltan2_MeshAdapter.hpp.
| enum Zoltan2::ModelType |
An identifier for the general type of model.
| HypergraphModelType | |
| GraphModelType | |
| CoordinateModelType | |
| IdentifierModelType | |
| MAX_NUM_MODEL_TYPES |
Definition at line 61 of file Zoltan2_Model.hpp.
| enum Zoltan2::ModelFlags |
Flags are set by a Problem to tell a Model what transformations it may need to do on the user's input.
Definition at line 75 of file Zoltan2_Model.hpp.
Identifier translations available from IdentifierMap.
| 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.
| static bool Zoltan2::compare_triplets | ( | GMWM_triplet< vtx_t, wgt_t > | a, |
| GMWM_triplet< vtx_t, wgt_t > | b | ||
| ) | [static] |
Definition at line 76 of file Zoltan2_GreedyMWM.hpp.
| vtx_t Zoltan2::GreedyMWM | ( | int * | idx, |
| vtx_t * | adj, | ||
| wgt_t * | wgt, | ||
| vtx_t | tnVtx, | ||
| vtx_t * | match | ||
| ) |
Definition at line 84 of file Zoltan2_GreedyMWM.hpp.
| int Zoltan2::AlgSpectral | ( | const RCP< GraphModel< Adapter > > & | model, |
| const RCP< OrderingSolution< typename Adapter::zgid_t, typename Adapter::lno_t > > & | solution, | ||
| const RCP< Teuchos::ParameterList > & | pl, | ||
| const RCP< const Teuchos::Comm< int > > & | comm | ||
| ) |
Definition at line 62 of file Zoltan2_AlgSpectral.hpp.
| T* Zoltan2::allocMemory | ( | size_t | size | ) |
Allocates memory for the given size.
Definition at line 110 of file Zoltan2_AlgMultiJagged.hpp.
| void Zoltan2::freeArray | ( | T *& | array | ) |
Frees the given array.
Definition at line 127 of file Zoltan2_AlgMultiJagged.hpp.
| std::string Zoltan2::toString | ( | tt | obj | ) |
Converts the given object to string.
Definition at line 138 of file Zoltan2_AlgMultiJagged.hpp.
| void Zoltan2::uqsort | ( | IT | n, |
| uSortItem< IT, WT > * | arr | ||
| ) |
Quick sort function. Sorts the arr of uSortItems, with respect to increasing vals.
Definition at line 259 of file Zoltan2_AlgMultiJagged.hpp.
| void Zoltan2::getFractionLeft | ( | const RCP< const Environment > & | env, |
| typename Adapter::part_t | part0, | ||
| typename Adapter::part_t | part1, | ||
| const RCP< PartitioningSolution< Adapter > > & | solution, | ||
| ArrayRCP< double > & | fractionLeft, | ||
| typename Adapter::part_t & | numPartsLeftHalf | ||
| ) |
Determine the fraction of work in the left half.
| env | the Environment for the application. |
| part0 | is the first part of the parts to bisected. |
| part1 | is the last part of the parts to bisected. |
| solution | which contains the part sizes. |
| fractionLeft | on return fractionLeft[w] is the fraction of work wanted in the left half for weight dimension w. |
| numPartsLeftHalf | on return is the number of parts in the left half. |
Definition at line 181 of file Zoltan2_AlgRCB_methods.hpp.
| 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.
| env | the Environment for the application. |
| comm | the communicator |
| coordDim | the first coordDim vectors in the vectors list are coordinates, the rest are weights. |
| vectors | lists of coordinates and weights |
| index | is the index into the vectors arrays for the coordinates to be included in the partitioning. If index.size() is zero, then include all coordinates. |
| dimension | on return is the dimension to cut |
| minCoord | on the return is the minimum coordinate value in this dimension. |
| maxCoord | on the return is the maximum coordinate value in this dimension. |
Definition at line 243 of file Zoltan2_AlgRCB_methods.hpp.
| 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.
| env | the Environment for the application. |
| comm | the communicator for this step. |
| lrflags | each 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. |
| vectors | is 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. |
Definition at line 352 of file Zoltan2_AlgRCB_methods.hpp.
| scalar_t Zoltan2::getCoordWeight | ( | lno_t | id, |
| multiCriteriaNorm | mcnorm, | ||
| ArrayView< StridedData< lno_t, scalar_t > > | weights | ||
| ) |
Definition at line 478 of file Zoltan2_AlgRCB_methods.hpp.
| 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.
| fractionLeft | amount of work in left half |
| minCoord | minimum coordinate value |
| maxCoord | maximum coordinate value |
| lrf | on return, if one side is empty, lrf will be leftFlag or rightFlag to indicate which side is empty. |
| imbalance | on return, if one half is empty, the imbalance will be set to 0.0 (perfect balance) |
| cutValue | on return, if one half is empty, the cutValue will be set to minCoord or maxCoord depending on which half is empty. |
Definition at line 518 of file Zoltan2_AlgRCB_methods.hpp.
| 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.
| env | the environment |
| comm | the communicator |
| totalWeightLeft | the total weight in the left region at the end of the last iteration. |
| targetWeightLeft | the ideal weight for the left part. |
| cutLocation | index into sums of boundary sum. each boundary. |
Definition at line 572 of file Zoltan2_AlgRCB_methods.hpp.
| 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, | ||
| int | nWeightsPerCoord, | ||
| const RCP< mvector_t > & | vectors, | ||
| ArrayView< typename mvector_t::local_ordinal_type > | index, | ||
| ArrayView< double > | fractionLeft, | ||
| 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.
| env | the Environment for the application. |
| comm | the communicator for this step. |
| params | a bit map of boolean parameters. |
| numTestCuts | the number of test cuts to make in one round. |
| tolerance | the maximum acceptable imbalance (0,1). |
| cutDim | the dimension of the coordinates to cut. |
| coordDim | the first coordDim vectors in the vectors list are coordinates, the rest are weights. |
| nWeightsPerCoord | the number of weights provided for each coordinate |
| vectors | lists of coordinates and weights |
| index | is 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. |
| fractionLeft | the size of the left part for each weight, the right part should measure 1.0 - fractionLeft. |
| coordGlobalMin | the global minimum of coordinates in dimension cutDim |
| coordGlobalMax | the global maximum of coordinates in dimension cutDim |
| cutValue | on return this is the computed cut location. |
| lrflags | on 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]. |
| totalWeightLeft | on return is the global total weight left of the cut. |
| totalWeightRight | on return is the global total weight right of the cut. |
| localCountLeft | on return is the local number of objects left of the cut. |
| imbalance | on return is the imbalance for the computed partitioning (0, 1). |
a separate simpler function when nWeightsPerCoord <= 1
During the first global comm, ensure all procs have same values for cutDim and fractionLeft.
Definition at line 713 of file Zoltan2_AlgRCB_methods.hpp.
| 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, | ||
| int | nWeightsPerCoord, | ||
| const RCP< mvector_t > & | vectors, | ||
| multiCriteriaNorm | mcnorm, | ||
| const RCP< PartitioningSolution< Adapter > > & | solution, | ||
| typename Adapter::part_t | part0, | ||
| typename Adapter::part_t | part1, | ||
| ArrayView< unsigned char > | lrflags, | ||
| int & | cutDimension, | ||
| typename mvector_t::scalar_type & | cutValue, | ||
| typename mvector_t::scalar_type & | imbalance, | ||
| typename Adapter::part_t & | numPartsLeftHalf, | ||
| typename mvector_t::scalar_type & | weightLeftHalf, | ||
| typename mvector_t::scalar_type & | weightRightHalf | ||
| ) |
Divide the coordinates into a "left" half and "right" half.
| env | the Environment for the application. |
| comm | the communicator for this step. |
| params | a bit map of boolean parameters. |
| numTestCuts | the number of test cuts to make in one round. |
| tolerance | the maximum acceptable imbalance (0,1). |
| coordDim | the first coordDim vectors in the vectors list are coordinates, the rest are weights. |
| nWeightsPerCoord | the number of weights provided for each coordinate |
| vectors | lists of coordinates and weights |
| solution | for obtaining the part sizes |
| part0 | is the first part of the parts to bisected. |
| part1 | is the last part of the parts to bisected. |
| lrflags | on 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. |
| cutDimension | on return coordinate dimension that was cut. |
| cutValue | on return this is the computed cut location. |
| imbalance | on return is the imbalance for the computed partitioning for cutDim and fractionLeft (0,1). |
| numPartsLeftHalf | on return the number of parts in the left half. |
| weightLeftHalf | on return the total weight in the left half. |
| weightRightHalf | on return the total weight in the right half. |
Definition at line 1217 of file Zoltan2_AlgRCB_methods.hpp.
| 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, | ||
| int | nWeightsPerCoord, | ||
| const RCP< mvector_t > & | vectors, | ||
| ArrayView< typename mvector_t::local_ordinal_type > | index, | ||
| const RCP< PartitioningSolution< Adapter > > & | solution, | ||
| typename Adapter::part_t | part0, | ||
| typename Adapter::part_t | part1, | ||
| ArrayView< typename Adapter::part_t > | partNum | ||
| ) |
Perform RCB on the local process only.
| env | the Environment for the application. |
| depth | depth of recursion, for debugging, call with "1" first time. |
| params | a bit map of boolean parameters. |
| numTestCuts | the number of test cuts to make in one round. |
| tolerance | the maximum acceptable imbalance (0,1). |
| coordDim | the first coordDim vectors in the vectors list are coordinates, the rest are weights. |
| nWeightsPerCoord | the number of weights provided for each coordinate |
| vectors | lists of coordinates and weights |
| index | is 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. |
| solution | for obtaining part sizes. |
| part0 | is the first part of the parts to bisected. |
| part1 | is the last part of the parts to bisected. |
| partNum | on return partNum[i] is the new part number for coordinate i. |
Definition at line 1372 of file Zoltan2_AlgRCB_methods.hpp.
| it Zoltan2::z2Fact | ( | it | x | ) | [inline] |
Definition at line 62 of file Zoltan2_TaskMapping.hpp.
| void Zoltan2::ithPermutation | ( | const IT | n, |
| IT | i, | ||
| IT * | perm | ||
| ) |
Definition at line 75 of file Zoltan2_TaskMapping.hpp.
| void Zoltan2::getGridCommunicationGraph | ( | part_t | taskCount, |
| part_t *& | task_comm_xadj, | ||
| part_t *& | task_comm_adj, | ||
| vector< int > | grid_dims | ||
| ) |
Definition at line 104 of file Zoltan2_TaskMapping.hpp.
| void Zoltan2::getSolutionCenterCoordinates | ( | const Environment * | envConst, |
| const Teuchos::Comm< int > * | comm, | ||
| const Zoltan2::CoordinateModel< typename Adapter::base_adapter_t > * | coords, | ||
| const Zoltan2::PartitioningSolution< Adapter > * | soln_, | ||
| int | coordDim, | ||
| part_t | ntasks, | ||
| scalar_t ** | partCenters | ||
| ) |
Definition at line 130 of file Zoltan2_TaskMapping.hpp.
| void Zoltan2::fillContinousArray | ( | T * | arr, |
| size_t | arrSize, | ||
| T * | val | ||
| ) |
fillContinousArray function
| arr | array to be filled in with values. |
| arrSize | the size of the array. |
| val | the pointer to the value to be filled. if given NULL, the filling performs arr[i] = i. |
Definition at line 568 of file Zoltan2_TaskMapping.hpp.
| void Zoltan2::coordinateTaskMapperInterface | ( | RCP< const Teuchos::Comm< int > > | problemComm, |
| int | proc_dim, | ||
| int | num_processors, | ||
| pcoord_t ** | machine_coords, | ||
| int | task_dim, | ||
| part_t | num_tasks, | ||
| tcoord_t ** | task_coords, | ||
| part_t * | task_comm_xadj, | ||
| part_t * | task_comm_adj, | ||
| pcoord_t * | task_communication_edge_weight_, | ||
| part_t * | proc_to_task_xadj, | ||
| part_t * | proc_to_task_adj, | ||
| int | recursion_depth, | ||
| part_t * | part_no_array, | ||
| part_t * | machine_dimensions | ||
| ) |
Constructor The interface function that calls CoordinateTaskMapper which will also perform the mapping operation. The result mapping can be obtained by.
--proc_to_task_xadj: which holds the beginning and end indices of tasks on proc_to_task_adj that is assigned to a processor. the tasks assigned to processor i are between proc_to_task_xadj[i-1] and proc_to_task_xadj[i] on proc_to_task_adj.
--proc_to_task_adj: holds the task adj array.
-task_comm_xadj, task_comm_adj, task_communication_edge_weight_ can be provided NULL. In this case all processors will calculate the same mapping. -If task_comm_xadj, task_comm_adj and provided, algorithm will perform rotations, and processors will calculate different mappings, and best one will be reduced. -If task_communication_edge_weight_ is provided with task_comm_xadj, task_comm_adj this will be used when cost is calculated. -recursion_depth is a mandatory argument. In the case part_no_array is not null, this parameter should represent the length of part_no_array. If part_no_array is given as NULL, then this will give the recursion depth for the algorith, Maximum number is ceil(log_2(min(num_processors, num_tasks))), and providing a higher number will be equivalant to this. Partitioning algorithm will work as RCB when maximum number is given, which performs the best mapping results. -part_no_array: The best results are obtained when this parameter is given as NULL. But if this is provided, partitioning will use this array for partitioning each dimension to the given numbers. The multiplication of these numbers should be equal to min(num_processors, num_tasks). -machine_dimensions: This can be NULL, but if provided the algorithm will perform shift of the machine coords so that the largest gap is treated as wrap-around link.
| problemComm | is the communication object. |
| proc_dim | dimensions of the processor coordinates. |
| num_processors | is the number of processors |
| machine_coords | is the coordinates of the processors. |
| task_dim | is the dimension of the tasks. |
| num_tasks | is the number of tasks. |
| task_coords | is the coordinates of the tasks. |
| task_comm_xadj | is the task communication graphs xadj array. (task-i adjacency is between task_comm_xadj[i-1] and task_comm_xadj[i]) |
| task_comm_adj | is task communication graphs adj array. |
| task_communication_edge_weight_ | is the weight of the communication in task graph. |
| proc_to_task_xadj | is is the output for tasks showing which proc has the which parts. (proc-i will own the tasks from proc_to_task_xadj[i-1] to proc_to_task_xadj[i]) |
| proc_to_task_adj | is the ouput list of tasks pointed by proc_to_task_xadj |
| recursion_depth | is the recursion depth that will be applied to partitioning. If part_no_array is provided, then it is the length of this array. |
| part_no_array | if part_no_array is provided, partitioning algorithm will be forced to use this array for partitioning. However, the multiplication of each entries in this array should be equal to min(num_processors, num_tasks). |
| *machine_dimensions,: | the dimensions of the machine network. For example for hopper 17x8x24 This can be NULL, but if provided the algorithm will perform shift of the machine coords so that the largest gap is treated as wrap-around link. |
Definition at line 1877 of file Zoltan2_TaskMapping.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.
| rank | the MPI rank of the calling process in the application |
| iPrint | true if this process should output information |
| fname | name of file to which output is to be appended, or or Z2_UNSET_STRING |
| ost | output stream type |
| mgr | on return, a pointer to the created output manager |
Definition at line 77 of file Zoltan2_Environment.cpp.
| 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.
| rank | the MPI rank of the calling process in the application |
| iPrint | true if this process should print metric information |
| fname | name of file to which output is to be appended, or or Z2_UNSET_STRING |
| ost | output stream type |
| mgr | on return, a pointer to the created output manager |
| fptr | on 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 638 of file Zoltan2_Environment.hpp.
| bool Zoltan2::validIntegralRangeList | ( | const Teuchos::Array< Integral > & | vals | ) |
A helper function that indicates whether an array is a valid integer range list.
| vals | An array that may encode an integer range list. |
Definition at line 96 of file Zoltan2_IntegerRangeList.hpp.
| bool Zoltan2::allValuesAreInRangeList | ( | const Teuchos::Array< Integral > & | vals | ) |
A helper function that determines if all values are in the list.
| vals | An array encoding an integer range list. |
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 126 of file Zoltan2_IntegerRangeList.hpp.
| bool Zoltan2::allValuesAreInRangeList | ( | const Teuchos::ParameterEntry & | e | ) |
A helper function that determines if all values are in the list.
| e | A parameter entry |
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 148 of file Zoltan2_IntegerRangeList.hpp.
| bool Zoltan2::noValuesAreInRangeList | ( | const Teuchos::Array< Integral > & | vals | ) |
A helper function that determines if no values are in the list.
| vals | An array encoding an integer range list. |
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 173 of file Zoltan2_IntegerRangeList.hpp.
| bool Zoltan2::noValuesAreInRangeList | ( | const Teuchos::ParameterEntry & | e | ) |
A helper function that determines if no values are in the list.
| e | A parameter entry |
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 195 of file Zoltan2_IntegerRangeList.hpp.
| 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.
| val | A value that could be in the list. |
| vals | An array encoding an integer range list. |
| sorted | Set to false if the integer range list is not sorted |
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 220 of file Zoltan2_IntegerRangeList.hpp.
| bool Zoltan2::IsInRangeList | ( | const Integral | val, |
| const Teuchos::ParameterEntry & | e | ||
| ) |
A helper function that determines if a value is in the list.
| val | A value that could be in the list. |
| e | A parameter entry |
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 255 of file Zoltan2_IntegerRangeList.hpp.
| Teuchos::ArrayView<Integral> Zoltan2::getList | ( | Teuchos::Array< Integral > & | irl | ) |
A helper function that returns a view of the list.
| irl | The value of an integer range list parameter after it has been validated |
Definition at line 297 of file Zoltan2_IntegerRangeList.hpp.
| void Zoltan2::printIntegralRangeList | ( | std::ostream & | os, |
| Teuchos::Array< Integral > & | irl | ||
| ) |
A helper function that prints the meaning of an encoded integer range list.
| os | An output stream to which the list will be printed. |
| val | A value of an integer range list parameter after it has been validated. |
Definition at line 317 of file Zoltan2_IntegerRangeList.hpp.
| void Zoltan2::createAllParameters | ( | Teuchos::ParameterList & | pList | ) |
Create a list of all Zoltan2 parameters and validators.
| pList | on 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.
| plSome | the user's parameter list |
| plAll | a parameter list with all Zoltan2 parameters and their validators |
| plVal | on 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.
| plIn | the user's parameter list |
| plOut | a 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.
| static ssize_t Zoltan2::in_list | ( | const int | value, |
| size_t | count, | ||
| int * | vector | ||
| ) | [static] |
Definition at line 268 of file Zoltan2_PamgenMeshAdapter.hpp.
| size_t Zoltan2::removeUndesiredEdges | ( | const RCP< const Environment > & | env, |
| int | myRank, | ||
| bool | removeSelfEdges, | ||
| bool | removeOffProcessEdges, | ||
| bool | removeOffGroupEdges, | ||
| ArrayView< const typename InputTraits< User >::zgid_t > & | gids, | ||
| ArrayView< const typename InputTraits< User >::zgid_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 >::zgid_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.
| env | the environment |
| myRank | is my rank in the problem communicator |
| removeSelfEdges | true if self-edges (edges such that both vertices are the same) should be removed. If true then gids must be set. |
| removeOffProcessEdges | true if edges belonging to processes other than my process should be removed (in which case procIds must be set). |
| removeOffGroupEdges | true if edges belonging to processes outside of our communicator should be removed (in which case procIds must be set). |
| gids | vertex global Id list |
| gidNbors | list of vertex neighbor global ids (edges) |
| procIds | is the list of processes owning the vertices in the gidNbors list. |
| edgeWeights | weights for edges in gidNbors list |
| offsets | offset into above lists for each vertex in gids. |
| newGidNbors | on return a list of the desired neighbors |
| newWeights | if wdim is the number of weights per edge 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| newOffsets | on return a list of offsets into the above list for the start of the neighbors for each vertex |
The template parameter is an Adapter type.
Definition at line 106 of file Zoltan2_GraphModel.hpp.
| size_t Zoltan2::computeLocalEdgeList | ( | const RCP< const Environment > & | env, |
| const RCP< const Comm< int > > & | comm, | ||
| size_t | numLocalEdges, | ||
| size_t | numLocalGraphEdges, | ||
| RCP< const IdentifierMap< User > > & | idMap, | ||
| ArrayRCP< const typename InputTraits< User >::zgid_t > & | allEdgeIds, | ||
| ArrayRCP< const typename InputTraits< User >::gno_t > & | allEdgeGnos, | ||
| 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 257 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.
| comm | The communicator for the process group involved |
| env | The environment, required for error messages |
| sendCount | The number to send to process p is in sendCount[p]. |
| recvCount | On 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.
| void Zoltan2::AlltoAllv | ( | const Comm< int > & | comm, |
| const Environment & | env, | ||
| const ArrayView< const std::string > & | sendBuf, | ||
| const ArrayView< const int > & | sendCount, | ||
| ArrayRCP< std::string > & | recvBuf, | ||
| const ArrayView< int > & | recvCount | ||
| ) |
Definition at line 131 of file Zoltan2_AlltoAll.cpp.
| 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.
| 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.
| 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.
| comm | The communicator for the process group involved |
| env | The environment, required for error messages |
| sendBuf | The data to be sent, in destination process rank order |
| sendCount | The number of Ts to send to process p is in sendCount[p]. |
| recvBuf | On return, recvBuf has been allocated and contains the packets sent to this process by others. |
| recvCount | On 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 * | nVwgts, | ||
| float ** | vweights, | ||
| int * | nEwgts, | ||
| float ** | eweights | ||
| ) |
read a Chaco graph file Reader code was copied from zoltan1 test driver code. File is closed when read is completed.
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.
Definition at line 542 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.
| 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.
| void Zoltan2::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
Definition at line 118 of file Zoltan2_IdentifierTraits.hpp.
| 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.
| std::string Zoltan2::stringifyOrdinal | ( | T | 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.
| number | the number (such as process rank) to add |
| fname | the file name to modify |
| newf | on 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.
| 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.
| v | a list of values |
| stride | the value such that v[offset + stride*i] will be included in the calculation for all possible i. |
| offset | the offset at which calculation will begin. |
| min | on return, min will hold the minimum of the values. |
| max | on return, max will hold the maximum of the values. |
| sum | on return, max will hold the sum of the values. |
Definition at line 263 of file Zoltan2_Metric.hpp.
| void Zoltan2::normedPartWeights | ( | const RCP< const Environment > & | env, |
| part_t | 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.
| env | the Environment for error messages |
| numberOfParts | the number of Parts with respect to which weights should be computed. |
| parts | the part Id for each object, which may range from 0 to one less than numberOfParts |
| vwgts | vwgts[w] is the StridedData object representing weight index w. vwgts[w][i] is the w'th weight for object i. |
| mcNorm | the multiCriteria norm, to be used if the number of weights is greater than one. |
| weights | on return, weights[p] is the total weight for part p. weights is allocated by the caller |
< 1-norm = Manhattan norm
< 2-norm = sqrt of sum of squares
< inf-norm = maximum norm
Definition at line 295 of file Zoltan2_Metric.hpp.
| void Zoltan2::globalSumsByPart | ( | const RCP< const Environment > & | env, |
| const RCP< const Comm< int > > & | comm, | ||
| const ArrayView< const pnum_t > & | part, | ||
| int | vwgtDim, | ||
| const ArrayView< StridedData< lno_t, scalar_t > > & | vwgts, | ||
| multiCriteriaNorm | mcNorm, | ||
| part_t & | numParts, | ||
| part_t & | numNonemptyParts, | ||
| ArrayRCP< MetricValues< scalar_t > > & | metrics, | ||
| ArrayRCP< scalar_t > & | globalSums | ||
| ) |
Given the local partitioning, compute the global sums in each part.
| env | Environment for error handling |
| comm | communicator |
| part | part[i] is the part ID for local object i |
| vwgts | vwgts[w] is the StridedData object representing weight index w. The number of weights (which must be at least one TODO WHY?) is taken to be vwgts.size(). |
| mcNorm | the multiCriteria norm, to be used if the number of weights is greater than one. |
| numParts | on return this is the global number of parts. |
| numNonemptyParts | on return this is the number of those parts that are non-empty. |
| metrics | on 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 set 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. |
| globalSums | If weights are uniform, the globalSums is the numParts totals of global number of objects in each part. Suppose the number of weights 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 index 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 403 of file Zoltan2_Metric.hpp.
| void Zoltan2::computeImbalances | ( | part_t | numParts, |
| part_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.
| numParts | the number of parts supplied, which is the length of the vals array. |
| targetNumParts | the number of parts desired, which is the length of the psizes array if it is defined. |
| psizes | if 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. |
| sumVals | is 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. |
| min | on return, min will be the minimum (best) imbalance of all the parts. |
| max | on return, max will be the maximum imbalance of all the parts. |
| avg | on 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 646 of file Zoltan2_Metric.hpp.
| void Zoltan2::computeImbalances | ( | part_t | numParts, |
| part_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.
| numParts | the number of parts supplied, which is the length of the vals array. |
| targetNumParts | the number of parts desired, which is the length of the psizes array if it is defined. |
| numSizes | the number of part size arrays |
| psizes | is an array of numSizes pointers to part size arrays. If the part sizes for index w are uniform, then psizes[w] should be NULL. Otherwise it should point to targetNumParts sizes, and the sizes for each index should sum to one. |
| sumVals | is 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. |
| min | on return, min will be the minimum (best) imbalance of all the parts. |
| max | on return, max will be the maximum imbalance of all the parts. |
| avg | on 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 734 of file Zoltan2_Metric.hpp.
| 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, | ||
| typename Adapter::part_t & | numParts, | ||
| typename Adapter::part_t & | numNonemptyParts, | ||
| ArrayRCP< MetricValues< typename Adapter::scalar_t > > & | metrics | ||
| ) |
Compute imbalance metrics for a distribution.
| env | The problem environment. |
| comm | The problem communicator. |
| ia | the InputAdapter object which corresponds to the Solution. |
| solution | the PartitioningSolution to be evaluated. |
| mcNorm | is the multicriteria norm to use if the number of weights is greater than one. See the multiCriteriaNorm enumerator for mcNorm values. |
| numParts | on return is the global number of parts in the solution |
| numNonemptyParts | on return is the global number of parts to which objects are assigned. |
| metrics | on 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 set 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.
Definition at line 869 of file Zoltan2_Metric.hpp.
| void Zoltan2::printMetrics | ( | std::ostream & | os, |
| part_t | targetNumParts, | ||
| part_t | numParts, | ||
| part_t | numNonemptyParts, | ||
| const ArrayView< MetricValues< scalar_t > > & | infoList | ||
| ) |
Print out a header and the values for a list of metrics.
Definition at line 1015 of file Zoltan2_Metric.hpp.
| void Zoltan2::printMetrics | ( | std::ostream & | os, |
| part_t | targetNumParts, | ||
| part_t | numParts, | ||
| part_t | numNonemptyParts, | ||
| const MetricValues< scalar_t > & | info | ||
| ) |
Print out a header and the values for a single metric.
Definition at line 1041 of file Zoltan2_Metric.hpp.
| 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 1053 of file Zoltan2_Metric.hpp.
| 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 1102 of file Zoltan2_Metric.hpp.
| long Zoltan2::getProcessKilobytes | ( | ) |
Definition at line 70 of file Zoltan2_Util.cpp.
| 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.
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.
int Zoltan2::chaco_save_pnt [static] |
Definition at line 61 of file Zoltan2_ChacoReader.cpp.
1.7.6.1