Home
METIS Manual
Contents
1. Computing a fill reducing ordering of a sparse matrix Converting a METIS stand alone programs I Inputhtl lormats x2 e Bae a em RU Ram a a ROB RU ES 411 Graph file oe ee eh DEAE REE DA Rt hoe ep Re e ho s 4 4 2 Mesh sek RR Rue ucla Poke Se IDE UA 4 1 3 Target partition weights file 4 2 Qutputfileformats 2 206 24 5 lx RR umm RE eI RA ADAM Partition cles s ecce ur PO Sex Renee REGE ORUN Berge e e Ree 42 2 Ordenngfile zig osse Regu mex d heise km 4 4 3 Programs 4 og Rom ee m o E og EUR GROS USUS E PURUS Supe Rue qae B aeu toe iem Eus S ne ws wc sweet RASA Wee HIR TS Geen caged ge NR Ge FR ett LAE NUR S suk y periere epe eue e dp pere uq e e ES esque A ee Cue ae de nde oe Ve nec wr s e grapnehkos d v e RAM fce Anto Soa etr DA UA AC ect dle Eae dp Sel E METIS API 24 Header MNES oh ee ee ais a RUE A ea dece PCR ot D ab oe lee C 5 2 Use of NULL parameters 4 204 9 Sb UR RR 23 3 C C and Fortran Support ses aes ese s m ee te REO RO SR mures depu 5 4 Options exce
2. Bee DE EA E opa m uer ES 5 Graph d atasstructure ob Big Rx up awe tique web 9 67 Mesh datastctute REOR UR RUE Pr pU E up ge RURSUS pre tle 5 7 Partitioning objectives os ha ek eR o RR Rui Mode eee eee 5 8 Graph partitioning routines lel rs ETISSPartGraphRecursiVW6 wu aide dux edem oe ee ee d ws 8 c edge omes Re x EQUO ee vehere Es 5 9 Mesh partitioning routines llle rns exuti d We a E Lo ats Serpette cA PR ile ROS EVP NS ETISJartMeshNOdGagLexg 2 8 wey y oU abe eS Anus e RUE RU 5 10 Sparse Matrix Reordering MELT SHNOGEND now s ende eh a ART UA a oe a eal qs cia ak te Beg A d O amp c 5 11 Mesh to graph conversion routines METIS MeshloBual uw EE sue Bete be See Se eee 31 METIS MeshTONOoGaL eee aeons VUE FE A ede i 32 2 12 Utility routines pe Eu EUIS uM aere uu RSS 33 METIS SetDetaulbtODtiolsS Boe ek A APR S 33 METISJEEGG A eal Se Cou WA ve Pee e 6 odd e 33 System requirements and contact information 34 Copyright a
3. dbglvl help Similar to the corresponding options of gpmet is Notes The current version of mpmet is supports only single constraint partitioning 15 ndmetis options graphfile Description Computes a fill reducing ordering of the vertices of the graph using multilevel nested dissection The computed ordering is stored in a file named graphfile iperm whose format is described in Section 4 2 2 Parameters graphfile The name of the file that stores the graph to be re ordered Section 4 1 1 Options ctype string Specifies the scheme to be used to match the vertices of the graph during the coarsening The possible values are rm Random matching default shem Sorted heavy edge matching iptype string applies only when ptype rb Specifies the scheme to be used to compute the initial vertex separator of the graph The possible values are edge Derive the separator from an edge cut default node Grow a bisection using a greedy node based strategy rtype string Specifies the scheme to be used for refinement The possible values are 1sided One sided node based refinement default 2sided Two sided node based refinement ufactor int Specifies the maximum allowed load imbalance between the left and right partitions during each bisection It is this described under METIS OPTION UFACTOR in Section 5 4 when the number of partitions Default is 30 indicating a load imbalance of 1 03 pfactor int Specifies the minimum degre
4. 6 are the weights of these edges The vertices 1 the various v entries are numbered starting from 1 not from 0 as is often done in C Furthermore the vertex sizes and vertex weights must be integers greater or equal to 0 whereas the edge weights must be strictly greater than 0 Vertex size versus vertex weights The graph format allows for the specification of both vertex sizes and vertex weights These two quantities are used by METIS for two entirely different purposes The vertex weights are used for ensuring that the computed partitionings satisfy the specified balancing constraints e g the sum of the weights of the vertices assigned to each partition is the same across the partitions On the other hand the vertex sizes are used for determining the total communication volume when gpmet is and mpmet is are invoked with the objtype vol option Additional details on how the vertex size is used to determine the communication volume are provided in Section 5 7 which provides the precise formula for computing the total communication volume Examples Figure 2 illustrates the format by providing some examples The simplest format for a graph G is when the size and weight of all vertices and the weight of all the edges is the same This format is illustrated in Figure 2 a Note the optional fmt parameter is skipped in this case However there are cases in which the edges in G have different weights This is accommodated as shown in Fi
5. t nn t idx t eind t numflag Description This function is used to generate the nodal graph of a mesh Parameters ne nn idx t xadj idx t adjncy The number of elements in the mesh The number of nodes in the mesh eptr eind The pair of arrays storing the mesh as described in Section 5 6 numflag Used to indicate which numbering scheme is used for eptr and eind The possible values are C style numbering is assumed that starts from 0 Fortran style numbering is assumed that starts from 1 xadj adjncy These arrays store the adjacency structure of the generated graph The format is of the adjacency structure is described in Section 5 5 Memory for these arrays is allocated by METIS API using the standard malloc function It is the responsibility of the application to free this memory by calling free METIS provides the 5 Free that is a wrapper to C s free function Returns METIS OK Indicates that the function returned normally METIS_ERROR_INPUT Indicates an input error METIS ERROR MEMORY Indicates that it could not allocate the required memory METIS ERROR Indicates some other type of error 32 5 12 Utility routines int METIS SetDefaultOptions idx t options METIS NOPTIONS Description Initializes the options array into its default values Parameters options The array of options that will be initialized It s size sho
6. 0 C style then the adjacency list of vertex 7 is stored in array adjncy starting at index 7 and ending at but not including index xadj i 4 1 i e adjncy xadj 2 through and including adjncy xadj 1 4 11 11 That is for each vertex 2 its adjacency list is stored in consecutive locations in the array ad jncy and the array is used to point to where it begins and where it ends Figure 3 b illustrates the CSR format for the 15 vertex graph shown in Figure 3 a 3 4 3 7 9 id ul id id d a A sample graph xadj 0258 11 13 16 20 24 28 31 33 36 39 42 44 adjncy 1502613724839061015711268 12379 1348 14 5 11 6 10 12 7 11 13 8 12 14 9 13 b CSR format Figure 3 An example of the CSR format for storing sparse graphs The weights of the vertices if any are stored in an additional array called vwgt If ncon is the number of weights associated with each vertex the array vwgt contains n ncon elements recall that n is the number of vertices The weights of the th vertex are stored in ncon consecutive entries starting at location vwgt 2 ncon Note that if each vertex has only a single weight then vwgt will contain n elements and vwgt 21 will store the weight of the 22 ith vertex The vertex weights must be integers greater or equal to zero If all the vertices of the graph have the same weight i e the graph is unweighted then the vwgt can be set to NULL The weights
7. 1 options METIS OPTION NSEPS Specifies the number of different separators that it will compute at each level of nested dissection The final separator that is used is the smallest one Default is 1 options METIS OPTION NUMBERING Used to indicate which numbering scheme is used for the adjacency structure of a graph or the element node structure of a mesh The possible values are C style numbering is assumed that starts from 0 Fortran style numbering is assumed that starts from 1 options METIS OPTION NITER Specifies the number of iterations for the refinement algorithms at each stage of the uncoarsening process Default is 10 options METIS OPTION SEED Specifies the seed for the random number generator 20 options METIS OPTION MINCONN Specifies that the partitioning routines should try to minimize the maximum degree of the subdomain graph i e the graph in which each partition is a node and edges connect subdomains with a shared interface options METIS OPTION CONTIG Specifies that the partitioning routines should try to produce partitions that are contiguous Note that if the input graph is not connected this option is ignored options METIS OPTION COMPRESS Specifies that the graph should be compressed by combining together vertices that have identical adjacency lists options METIS OPTION CCORDER Specifies if the connected components of the graph should first be identified and ordered separately o
8. OPTION NITER METIS OPTION SEED METIS OPTION UFACTOR ETIS OPTION NUMBERING METIS OPTION DBGLVL The following options are valid for METIS PartGraphKway 25 objval part r15 ETIS OP ION OBJTYPE METIS OPTION CTYPE METIS OPTION IPTYPE ETIS OP ION RTYPE ETIS OPTION NCUTS METIS OPTION NITER ETIS OP ION UFACTOR METIS OPTION MINCONN METIS OPTION CONTIG ETIS OP ION SEED METIS OPTION NUMBERING METIS OPTION DBGLVL Upon successful completion this variable stores the edge cut or the total communication volume of the partitioning solution The value returned depends on the partitioning s objective function This is a vector of size nvtxs that upon successful completion stores the partition vector of the graph The numbering of this vector starts from either or 1 depending on the value of options METIS OPTION NUMBERING OK IS ERROR INPUT TS ERROR MEMORY IS ERROR Indicates that the function returned normally Indicates an input error Indicates that it could not allocate the required memory Indicates some other type of error 26 5 9 Mesh partitioning routines int METIS PartMeshDual idx t ne idx t nn idx t eptr idx t eind idx t vwgt idx t vsize idx t ncommon idx t npar
9. array of size nparts that specifies the desired weight for each partition The target partition weight for the ith partition is specified at tpwgts i the numbering for the partitions starts from 0 The sum of the tpwgts 1 entries must be 1 0 A NULL value can be passed to indicate that the graph should be equally divided among the partitions options NULL This is the array of options as described in Section 5 4 The following options are valid METIS OPTION PTYPE METIS OPTION OBJTYPE ETIS OPTION CTYPE METIS OPTION IPTYPE ETIS OPTION RTYPE METIS OPTION NCUTS METIS OPTION NITER METIS OPTION SEED ETIS OPTION UFACTOR METIS OPTION NUMBERING METIS OPTION DBGLVL objval Upon successful completion this variable stores either the edgecut or the total communication vol ume of the nodal graph s partitioning epart This is a vector of size ne that upon successful completion stores the partition vector for the elements of the mesh The numbering of this vector starts from either 0 or 1 depending on the value of options METIS_OPTION_NUMBERING npart This is a vector of size nn that upon successful completion stores the partition vector for the nodes of the mesh The numbering of this vector starts from either 0 or 1 depending on the value of options METIS_OPTION_NUMBERING Returns METIS OK Indicates that the function returne
10. bisectioning 5 KWAY Multilevel k way partitioning options METIS OPTION OBJTYPE Specifies the type of objective Possible values are METIS OBJTYPE CUT Edge cut minimization METIS OBJTYPE VOL Total communication volume minimization options METIS OPTION CTYPE Specifies the matching scheme to be used during coarsening Possible values are METIS RM Random matching METIS CTYPE SHEM Sorted heavy edge matching options METIS OPTION IPTYPE Determines the algorithm used during initial partitioning Possible values are METIS IPTYPE GROW Grows a bisection using a greedy strategy METIS IPTYPE RANDOM Computes a bisection at random followed by a refinement METIS IPTYPE EDGE Derives a separator from an edge cut METIS IPTYPE NODE Grow a bisection using a greedy node based strategy options METIS OPTION RTYPE Determines the algorithm used for refinement Possible values are METIS RTYPE F FM based cut refinement METIS_RTYPE_GREEDY Greedy based cut and volume refinement METIS RTYPE SEP2SIDED Two sided node FM refinement METIS RTYPE SEPISIDED One sided node FM refinement options METIS OPTION NCUTS Specifies the number of different partitionings that it will compute The final partitioning is the one that achieves the best edgecut or communication volume Default is
11. information of the sizes of the vertices For example if fmt is 011 then the graph file provides information about both vertex weights and edge weights Note that when the fmt parameter is not provided it is assumed that the vertex sizes vertex weights and edge weights are all equal to 1 The ncon parameter specifies the number of vertex weights associated with each vertex of the graph The value of this parameter determines whether or not METIS will use the multi constraint partitioning algorithms Section 3 3 If this parameter is omitted then the vertices of the graph are assumed to have a single weight Note that if ncon is greater than 0 then the file should contain the required vertex weights and the fmt parameter should be set appropriately 1 the 2nd bit from right to left should be set to 1 The remaining n lines store information about the actual structure of the graph In particular the ith line excluding comment lines contains information that is relevant to the ith vertex Depending on the value of the fmt and ncon parameters the information stored at each line is somewhat different In the most general form when fmt 2 11 and ncon gt 1 each line will have the following structure all elements are integer S W1 Wneon V1 1 V2 2 Uk Ek where s is the size of the vertex w1 W2 Wncon are the ncon vertex weights associated with this vertex v1 Uk are the vertices adjacent to this vertex and e1
12. of the edges if any are stored in an additional array called ad jwgt This array contains 2m elements and the weight of edge adjncy 7 is stored at location adjwgt 7 The edge weights must be integers greater than zero If all the edges of the graph have the same weight 1 the graph is unweighted then the ad jwgt can be set to NULL 5 6 Mesh data structure of the mesh partitioning and mesh conversion routines in METIS take as input the element node array of a mesh This element node array is stored using a pair of arrays called ept r and eind which are similar to the xad and arrays used for storing the adjacency structure of a graph The size of the ept x array is n 1 where n is the number of elements in the mesh The size of the ei array is of size equal to the sum of the number of nodes in all the elements of the mesh The list of nodes belonging to the ith element of the mesh are stored in consecutive locations of eind starting at position eptr i up to but not including position eptr i 1 This format makes it easy to specify meshes of any type of elements including meshes with mixed element types that have different number of nodes per element As it was the case with the format of the mesh file described in Section 4 1 2 the ordering of the nodes in each element is not important 5 7 Partitioning objectives The partitioning algorithms in METIS can be used to compute a balanced k way partitioning that mi
13. suited for parallel direct factorization as they lead to high degree of concurrency during the factorization phase Graph partitioning is also used for solving optimization problems arising in numerous areas such as design of very large scale integrated circuits VLSI storing and accessing spatial databases on disks transportation management and data mining 2 What is new in version 5 0 Version 5 0 represents nearly a complete re write of the code base whose purpose was to streamline and unify the stand alone programs and API provide better support for 64 bit architectures enhance its functionality and reduce the memory requirements by re factoring its internal memory management routines As a result both the stand alone programs and API routines have changed making it incompatible with the earlier versions of METIS However in order to minimize the code changes that the revised API will require the new API relies heavily on reasonable default values for most of the new parameters that it introduced The following represents a list of some of the major functionality related changes and enhancements that are ac cessible by both the command line programs and the API routines e Multi constraint partitioning can be used in conjunction with minimization of the total communication volume e graph and mesh partitioning routines take as input the target sizes of the partitions which among others allow them to compute partitioning solutio
14. the command line parameters A graph G V E with n vertices and m edges is stored in a plain text file that contains n 1 lines excluding comment lines The first line referred to as the header line contains information about the size and the type of the graph while the remaining n lines contain information for each vertex of Any line that starts with is a comment line and is skipped The header line contains either two n m three n m fmt or four n m fmt ncon parameters The first two parameters n m are the number of vertices and the number of edges respectively Note that in determining the number of edges m an edge between any pair of vertices v and u is counted only once and not twice i e we do not count the edge v u separately from v For example the graph in Figure 2 contains 11 vertices The fmt parameter is used to specify if the graph file contains information about vertex sizes vertex weights and edge weights The fmt parameter is a three digit binary number If the least significant bit is set to 1 i e the Ist bit from right to left then the graph file provides information about the weights of the edges If the second least significant bit is set to 1 1 e the 2nd bit from right to left then the graph file provides information about the weights of the vertices Finally if the third lest significant bit is set to 1 i e the 3rd bit from right to left then the graph file provides
15. the new 5 x API 3 Overview of METIS METIS is a serial software package for partitioning large irregular graphs partitioning large meshes and computing fill reducing orderings of sparse matrices METIS has been developed at the Department of Computer Science amp Engineering at the University of Minnesota and is freely distributed Its source code can downloaded directly from http www cs umn edu metis and is also included in numerous software distributions for Unix like operating systems such as Linux and FreeBSD The algorithms implemented in METIS are based on the multilevel graph partitioning paradigm 4 3 2 which has been shown to quickly produce high quality partitionings and fill reducing orderings The multilevel paradigm illustrated in Figure 1 consists of three phases graph coarsening initial partitioning and uncoarsening In the graph coarsening phase a series of successively smaller graphs is derived from the input graph Each successive graph is constructed from the previous graph by collapsing together a maximal size set of adjacent pairs of vertices This process continues until the size of the graph has been reduced to just a few hundred vertices In the initial partitioning phase a partitioning of the coarsest and hence smallest graph is computed using relatively simple approaches such as the algorithm developed by Kernighan Lin 5 Since the coarsest graph is usually very small this step is very fast Finally in the
16. they store the fill reducing per mutation and inverse permutation Let A be the original matrix and A be the permuted matrix The arrays perm and iperm are defined as follows Row column of A is the perm i row column of A and row column i of A is the iperm row column of A The numbering of this vector starts from either 0 or 1 depending on the value of opt ions METIS_OPTION_NUMBERING Returns METIS OK Indicates that the function returned normally ETIS ERROR INPUT Indicates an input error M METIS ERROR MEMORY Indicates that it could not allocate the required memory M ETIS ERROR Indicates some other type of error 30 5 11 Mesh to graph conversion routines int METIS MeshToDual idx t ne idx t nn idx t eptr idx t eind idx t ncommon idx t numflag idx t xadj idx t adjncy Description This function is used to generate the dual graph of a mesh Parameters ne The number of elements in the mesh nn The number of nodes in the mesh eptr eind The pair of arrays storing the mesh as described in Section 5 6 ncommon Specifies the number of common nodes that two elements must have in order to put an edge between them in the dual graph Given two elements and e2 containing n and nodes respectively then an edge will connect the vertices in the dual graph corresponding to e and e if the number of common nodes between them is greater than or
17. uncoarsening phase the partitioning of the smallest graph is projected to the successively larger graphs by assigning the pairs of vertices that were collapsed together to the same partition as that of their corresponding col lapsed vertex After each projection step the partitioning 15 refined using various heuristic methods to iteratively move vertices between partitions as long as such moves improve the quality of the partitioning solution The uncoarsening phase ends when the partitioning solution has been projected all the way to the original graph METIS uses novel approaches to successively reduce the size of the graph as well as to refine the partition during the uncoarsening phase During coarsening METIS employs algorithms that make it easier to find a high quality partition at the coarsest graph During refinement METIS focuses primarily on the portion of the graph that is close to the partition boundary These highly tuned algorithms allow METIS to quickly produce high quality partitions and Operation Stand alone program API routine Partition a graph gpmetis METIS PartGraphRecursive METIS PartGraphKway Partition a mesh mpmetis METIS PartMeshNodal ETIS PartMeshDual Compute a fill reducing ndmetis METIS_NodeND ordering of a sparse matrix Convert a mesh into a m2gmetis graph IS MeshToNodal IS_MeshToDual E E Table 3 An overview of METIS command line and library interfaces fi
18. up each element The first line contains two integer parameters The first parameter is the number of elements n in the mesh The second parameter which is optional is the number of weights associated with each element This is equivalent to the 10 Graph File Graph File 7 11 0 Or ids 2 Dx 8 9 134 113241 5421 53422212 2367 2 1 3 2 6 2 5 136 1 1 3 3 6 2 547 524276 6 4 6645 Weighted Graph Weights on edges a Unweighted Graph 1 1 5 2 2 1 2 1 2 1 0 2 2 Graph File Graph File 7 11 011 4513221 Jl14010 3 2113241 Ded d 553422212 022134 321326275 Tob eRe 1113362 EUIS ae 6524276 Tod 11306 S 221547 12164 c Weighted Graph Weights both on vertices and edges d Multi Constraint Graph Figure 2 Storage format for various type of graphs ncon parameter of the graph file and is used to specify the weights of the vertices in the dual graph If this parameter is omitted the weights of the vertices in the dual graph are assumed to be 1 After the first line the remaining n lines store the element node array In particular for element i line 1 stores the ncon integer weights associated with the th element if the optional ncon parameter has been specified followed by the nodes that this element is made off The weights and nodes are separated by spaces The numbering of the nodes starts from 1 The node
19. METIS A Software Package for Partitioning Unstructured Graphs Partitioning Meshes and Computing Fill Reducing Orderings of Sparse Matrices Version 5 0 George Karypis Department of Computer Science amp Engineering University of Minnesota Minneapolis MN 55455 karypis cs umn edu August 4 2011 Metis MEE tis Metis is the Greek word for wisdom Metis was a titaness in Greek mythology She was the consort of Zeus and the mother of Athena She presided over all wisdom and knowledge METIS is copyrighted by the regents of the University of Minnesota Related papers are available via WWW at URL http www cs umn edu karypis Contents 1 2 Introduction What is new in version 5 0 2 1 2 2 Changes in the command line programs 2 ld Migration 155065 RE SUE I Cue NUES Changes inthe APETOUUNES 2 5 5 6 oe x Estes S Rer CRX AN UU Rees 2 2 1 Migration issues ouo Re eam Re EO Eur Gia EUREN Es Overview of METIS 3 1 32 3 3 34 3 5 3 6 3 7 Para tionmg a graphoz wo D we EU ER SES SEE he EPI es Alternate partitioning objectives 22r rs Support for multi phase and multi physics computations Partitioning 2 Mesh usc tique ux EP S Partitioning for heterogeneous parallel computing architectures
20. d normally ETIS ERROR INPUT Indicates an input error M METIS ERROR MEMORY Indicates that it could not allocate the required memory M ETIS ERROR Indicates some other type of error 29 5 10 Sparse Matrix Reordering Routines int METIS NodeND idx_t nvtxs idx t xadj idx t adjncy idx t vwgt idx t options idx t perm idx t iperm Description This function computes fill reducing orderings of sparse matrices using the multilevel nested dissection algo rithm Parameters nvtxs The number of vertices in the graph xadj adjncy The adjacency structure of the graph as described in Section 5 5 vwet NULL An array of size nvtxs specifying the weights of the vertices If the graph is weighted the nested dissection ordering computes vertex separators that minimize the sum of the weights of the vertices on the separators A NULL can be passed to indicate a graph with equal weight vertices or unweighted options NULL This is the array of options as described in Section 5 4 The following options are valid METIS OPTION CTYPE METIS OPTION RTYPE METIS OPTION NSEPS METIS OPTION NITER METIS OPTION UFACTOR ETIS OPTION COMPRESS METIS OPTION CCORDER METIS OPTION SEED ETIS OPTION PFACTOR METIS OPTION NUMBERING METIS OPTION DBGLVL perm iperm These are vectors each of size nvtxs Upon successful completion
21. e meshes with different and possibly mixed element types e g triangles tetrahedra hexahedra etc The functionality provided by mpmet is is achieved by the METIS PartMeshNodal and METIS PartMeshDual API routines 3 5 Partitioning for heterogeneous parallel computing architectures Heterogeneous computing platforms containing processing nodes with different computational and memory capabil ities are becoming increasingly more common METIS graph and mesh partitioning programs and API routines are designed to partition a graph into k parts such that each part contains a pre specified fraction of the total number of vertices elements nodes In addition in the case of multi constraint partitioning these pre specified fractions are provided for each one of the vertex weights By matching the weights specified for each partition to the relative com putational and memory capabilities of the various processors these routines can be used to compute partitionings that balance the computations on heterogeneous architectures 3 6 Computing a fill reducing ordering of a sparse matrix METIS provides the ndmet is program and its associated METIS NodeND API routine for computing fill reducing orderings of sparse matrices based on the multilevel nested dissection paradigm 4 The nested dissection paradigm 15 based on computing vertex separator for the the graph corresponding to the matrix The nodes in the separator are moved to the end of the matri
22. e of the vertices that will be ordered last It is this described under METIS OPTION PFACTOR in Section 5 4 Default value is 0 indicating that no vertices are re moved nocompress Specifies that the graph should not be compressed by combining together vertices that have identical adjacency lists ccorder Specifies if the connected components of the graph should first be identified and ordered separately niter int Specifies the number of iterations for the refinement algorithms at each stage of the uncoarsening process Default is 10 nseps int Specifies the number of different separators that it will compute at each level of nested dissection The final separator that is used is the smallest one Default is 1 nooutput Specifies that no ordering file should be generated seed int Selects the seed of the random number generator dbglvl int Similar to the corresponding option of gpmet is help Displays the command line options along with a description 16 m2gmetis options meshfile graphfile Description Converts a mesh into a graph that is compatible with METIS Parameters meshfile The name of the file that stores the mesh to be converted Section 4 1 2 graphfile The name of the file that will store the generated graph Options gtype string Specifies the type of the graph to be generated The possible values are dual Generates the dual graph of the mesh default nodal the nodal graph of the mesh
23. ecause for these graphs the degrees of the various vertices are similar and the objectives of minimizing the edgecut or the totalv behave the same On the other hand if the vertex degrees vary significantly e g graphs corresponding to linear programming matrices then by minimizing the totalv we can obtain a significant reduction in the total communication volume In terms of the amount of time required by these two partitioning objectives minimizing the edgecut is faster than minimizing the totalv For this reason the totalv objective should be used only for problems in which it actually reduces the overall communication volume 24 5 8 Graph partitioning routines int METIS PartGraphRecursive idx t nvtxs idx t ncon idx t xadj idx t adjncy idx t vwgt idx t vsize idx t adjwgt idx t nparts real t tpwgts real t ubvec idx t options idx t objval idx t part int METIS_PartGraphKway idx_t nvtxs idx_t ncon idx t xadj idx t adjncy idx t vwgt idx t vsize idx t adjwgt idx t nparts real t tpwgts real t ubvec idx t options idx t objval idx t part Description Is used to partition a graph into k parts using either multilevel recursive bisection or multilevel k way partition ing Parameters nvtxs The number of vertices in the graph ncon The number of balancing constraints It should be at least 1 xadj adjncy The adjacency structure of the graph as described in Section 5 5 vwgt NULL The weigh
24. ector of m weights and the objective of the partitioning routines is to minimize the edge cut subject to the constraints that each one of the m weights is equally distributed among the domains For example if the first weight corresponds to the amount of computation and the second weight corresponds to the amount of storage required for each element then the partitioning computed by the new algorithms will balance both the computation performed in each domain as well as the amount of memory that it requires The multi constraint partitioning algorithms and their applications are further described in 2 The gpmet is program invokes the multi constraint partitioning routines whenever the input graph specifies more that one set of vertex weights and all of its graph partitioning API routines allow for the specification of multiple balancing constraints 3 4 Partitioning a mesh METIS provides the mpmet is program for partitioning meshes arising in finite element or finite volume methods This program take as input the element node array of the mesh and compute a k way partitioning for both its elements and its nodes This program first converts the mesh into either a dual graph i e each element becomes a graph vertex or a nodal graph i e each node becomes a graph vertex and then uses the graph partitioning API routines to partition this graph METIS utilizes a flexible approach for creating a graph for a finite element mesh which allows it to handl
25. equal to min ncommon n 1 n3 1 The default value is 1 indicating that two elements will be connected via an edge as long as they share one node However this will tend to create too many edges increasing the memory and time requirements of the partitioning The user should select higher values that are better suited for the element types of the mesh that wants to partition For example for tetrahedron meshes ncommon should be 3 which creates an edge between two tets when they share a triangular face i e 3 nodes numflag Used to indicate which numbering scheme is used for eptr and eind The possible values are C style numbering is assumed that starts from 0 Fortran style numbering is assumed that starts from 1 xadj adjncy These arrays store the adjacency structure of the generated dual graph The format is of the adjacency structure is described in Section 5 5 Memory for these arrays is allocated by METIS API using the standard malloc function It is the responsibility of the application to free this memory by calling free METIS provides the 5 Free that is a wrapper to C s free function Returns METIS OK Indicates that the function returned normally ETIS_ERROR_INPUT Indicates an input error M METIS ERROR MEMORY Indicates that it could not allocate the required memory M ETIS ERROR Indicates some other type of error 31 int METIS MeshToNodal i x t
26. es is described in Section 4 2 1 Parameters meshfile name of the file that stores the mesh to be partitioned Section 4 1 2 nparts The number of parts that the mesh will be partitioned into It should be greater than 1 Options gtype string Specifies the graph to be used for computing the partitioning The possible values are dual Partition the dual graph of the mesh default nodal Partition the nodal graph of the mesh ncommon int applies only when gtype dual Specifies the number of common nodes that two elements must have in order to put an edge between them in the dual graph Given two elements and e2 containing n and nodes respectively then an edge will connect the vertices in the dual graph corresponding to e and e if the number of common nodes between them is greater than or equal to min ncommon n 1 n3 1 The default value is 1 indicating that two elements will be connected via an edge as long as they share one node However this will tend to create too many edges increasing the memory and time requirements of the partitioning The user should select higher values that are better suited for the element types of the mesh that wants to partition For example for tetrahedron meshes ncommon should be 3 which creates an edge between two tets when they share a triangular face i e 3 nodes ptype ctype iptype objtype contig minconn tpwets ufactor niter ncuts nooutput seed
27. g phase the partitioning is successively refined as it is projected to the larger graphs is the input graph which is the finest graph G 1 is the next level coarser graph of is the coarsest graph minimize the resulting subdomain connectivity graph enforce contiguous partitions minimize alternative objectives etc and as such it may be preferable than multilevel recursive bisection METIS stand alone program for partitioning a graph is gpmet is and the functionality that it provides is achieved by the METIS_PartGraphRecursive and METIS PartGraphKway API routines 3 2 Alternate partitioning objectives The objective of the traditional graph partitioning problem is to compute a k way partitioning such that the number of edges or in the case of weighted graphs the sum of their weights that straddle different partitions is minimized This objective is commonly referred to as the edge cut When partitioning is used to distribute a graph or a mesh among the processors of a parallel computer the objective of minimizing the edge cut is only an approximation of the true communication cost resulting from the partitioning 1 The communication cost resulting from a k way partitioning generally depends on the following factors 1 the total communication volume ii the maximum amount of data that any particular processor needs to send and re ceive and iii the number of messages a processor needs to send and receive METIS m
28. gs and orderings that can be computed by them This was achieved by expanding the number of optional parameters that these programs can take which allow users to have a complete access to all of METIS functionality Prior to this release if users wanted to access some of the advance features of METIS they had to write their own programs based on the supplied API 2 1 1 Migration issues In order to support the enhanced functionality offered by the new command line programs the format of the graph mesh files has changed Section 4 1 In the case of the graph file the new format is backwards compatible so graphs written for the earlier format will work correctly when used by gpmet is and ndmetis However the new mesh file format is not backward compatible and as such they should not be used with mpmet is and m2gmet is Fortunately they can be easily converted to the new format by a slightly modifying their header line 2 2 Changes the API routines Table 2 shows how the v4 x API routines map to the new set of APIs provided by the 5 0 version of METIS The number of distinct core functions has been reduced to seven by expanding the calling sequence of the new routines to provide the functionally offered by the old specialized routines In most cases the functionality provided by the new API routines is a superset of that offered by the old routines especially in the areas related to partitioning for heterogeneous computing architectures mul
29. gure 2 b Now the adjacency list of each vertex contains the weight of the edges in addition to the vertices that is connected with If v has vertices adjacent to it then the line for v in the graph file contains 2 k numbers each pair of numbers stores the vertex that v is connected to and the weight of the edge Note that the fmt parameter is equal to 001 indicating the fact that G has weights on the edges In addition to having weights on the edges weights on the vertices are also allowed as illustrated in Figure 2 c In this case the value of fmt is equal to 011 and each line of the graph file first stores the weight of the vertex and then the weighted adjacency list Finally Figure 2 d illustrates the format of the input file when the vertices of the graph contain multiple weights 3 in this example In this case the value of fmt is equal to 010 and the value of ncon is equal to 3 since we have three sets of vertex weights Each line of the graph file stores the three weights of the vertices followed by the adjacency list 4 1 2 Mesh file The primary input of the mesh partitioning programs in METIS is the mesh to be partitioned This mesh is stored in a file in the form of the element node array A mesh with n elements is stored in a plain text file that contains n 1 lines The first line i e the header line contains information about the size and the type of the mesh while the remaining n lines contain the nodes that make
30. h constraint that is as signed to the ith partition and t j i is the desired target weight of the jth constraint for the ith partition 1 that specified via tpwgts For ptype rb the default value is 1 1 e load imbalance of 1 001 and for ptype kway the default value is 30 1 load imbalance of 1 03 options METIS OPTION DBGLVIL Specifies the amount of progress debugging information will be printed during the execution of the algo rithms The default value is 0 no debugging progress information A non zero value can be supplied that 15 obtained by a bit wise OR of the following values ETIS DBG INFO 1 Prints various diagnostic messages ETIS DBG TIME 2 Performs timing analysis ETIS DBG COARSEN 4 Displays various statistics during coarsening ETIS DBG REFINE 8 Displays various statistics during refinement ETIS DBG IPART 16 Displays various statistics during initial partitioning ETIS DBG MOVEINFO 32 Displays detailed information about vertex moves during refine ment ETIS DBG SEPINFO 64 Displays information about vertex separators ETIS_DBG_CONNINFO 128 Displays information related to the minimization of subdomain connectivity 21 METIS DBG CONTIGINFO 256 Displays information related to the elimination of connected com ponents Note that the numeric values are provided for use with the dbglv1 option of METIS stand alone pro gram
31. ll reducing orderings for a wide variety of irregular graphs unstructured meshes and sparse matrices METIS provides a set of stand alone command line programs for computing partitionings and fill reducing order ings as well as an application programming interface API that can be used to invoke its various algorithms from C C or Fortran programs The list of stand alone programs and API routines of METIS is shown in Table 3 The API routines allow the user to alter the behaviour of the various algorithms and provide additional routines that par tition graphs into unequal size partitions and compute partitionings that directly minimize the total communication volume 3 1 Partitioning a graph METIS can partition an unstructured graph into a user specified number k of parts using either the multilevel recursive bisection 4 or the multilevel k way partitioning 3 paradigms Both of these methods are able to produce high quality partitions However METIS s multilevel k way partitioning algorithm provides additional capabilities e g Multilevel Partitioning aA SS Coarsening Phase eseug Buluasseooun HF a a gt Initial Partitioning Phase Figure 1 The three phases of multilevel k way graph partitioning During the coarsening phase the size of the graph is suc cessively decreased During the initial partitioning phase a k way partitioning is computed During the multilevel refinement uncoarsenin
32. ment types of the mesh that wants to partition For example for tetrahedron meshes ncommon should be 3 which creates an edge between two tets when they share a triangular face i e 3 nodes nparts The number of parts to partition the mesh tpwgts NULL This is an array of size nparts that specifies the desired weight for each partition The target partition weight for the ith partition is specified at tpwgt s i the numbering for the partitions starts from 0 The sum of the tpwgts entries must be 1 0 A NULL value can be passed to indicate that the graph should be equally divided among the partitions options NULL This is the array of options as described in Section 5 4 The following options are valid METIS OPTION PTYPE METIS OPTION OBJTYPE ETIS OPTION CTYPE METIS OPTION IPTYPE ETIS OPTION RTYPE METIS OPTION NCUTS METIS OPTION NITER METIS OPTION SEED ETIS OPTION UFACTOR METIS OPTION NUMBERING METIS OPTION DBGLVL objval Upon successful completion this variable stores either the edgecut or the total communication vol ume of the dual graph s partitioning 27 epart npart Returns This is a vector of size ne that upon successful completion stores the partition vector for the elements of the mesh The numbering of this vector starts from either 0 or 1 depending on the value of options METIS_OPTION_NUMBERING This is a vect
33. mp license notice 34 1 Introduction Algorithms that find a good partitioning of highly unstructured graphs are critical for developing efficient solutions for a wide range of problems in many application areas on both serial and parallel computers For example large scale numerical simulations on parallel computers such as those based on finite element methods require the distribution of the finite element mesh to the processors This distribution must be done so that the number of elements assigned to each processor is the same and the number of adjacent elements assigned to different processors is minimized The goal of the first condition is to balance the computations among the processors The goal of the second condition is to minimize the communication resulting from the placement of adjacent elements to different processors Graph partitioning can be used to successfully satisfy these conditions by first modelling the finite element mesh by a graph and then partitioning it into equal parts Graph partitioning algorithms are also used to compute fill reducing orderings of sparse matrices These fill reducing orderings are useful when direct methods are used to solve sparse systems of linear equations A good ordering of a sparse matrix dramatically reduces both the amount of memory as well as the time required to solve the system of equations Furthermore the fill reducing orderings produced by graph partitioning algorithms are par ticularly
34. ncommon int applies only when gtype dual Similar to the corresponding option of mpmet is dbglvl int Similar to the corresponding option of gpmet is help Displays the command line options along with a description 17 graphchk graphfile fixedfile Description Checks the graph for format correctness and consistency Parameters graphfile The name of the file that stores the graph to be checked Section 4 1 2 fixedfile This is an optional parameter that specifies the name of the file to store the fixed input graph This file will only be generated if there were errors in the input file 18 5 Metis API The various routines implemented in METIS stand alone programs be directly accessed from a C or Fortran program by using the supplied library In the rest of this section we describe METIS API by first describing various calling and usage conventions the various data structures used to pass information into and get information out of the routines followed by a detailed description of the calling sequence of the various routines 5 1 Header files Any program using METIS API needs to include the met is h header file This file provides function prototypes for the various API routines and defines the various data types and constants used by these routines During METIS installation time the met is h defines two important data types and their widths These are the idx t data type for storing integer qua
35. nimizes either the number of edges that straddle partitions edgecut or the total communication volume fotalv In the rest of this section we briefly describe these two objectives and provide some suggestions on when they should be used Minimizing the edgecut Consider a graph V E and let P be a vector of size V such that Pfi stores the number of the partition that vertex belongs to The edgecut of this partitioning is defined as the number of edges that straddle partitions That is the number of edges v for which Z P u If the graph has weights associated with the edges then the edgecut is defined as the sum of the weight of these straddling edges Minimizing the total communication volume Consider a graph V E and let P be a vector of size V such that P i stores the number of the partition that vertex i belongs to Let C V be the subset of interface or boarder vertices That is each vertex v V is connected to at least one vertex that belongs to a different partition For each vertex v V let Nadj v be the number of domains other than P v that the vertices adjacent to v belong to The totalv of this partitioning is defined as totaly 5 Nadj v 1 vEV Equation 1 corresponds to the total communication volume incurred by the partitioning because each interface vertex v needs to be sent to all of its Nadj v partitions The above model can be extended to instances in which the amount
36. ns that are well suited for parallel architectures with heterogeneous computing capabilities e When multi constraint partitioning is used the target sizes of the partitions are specified on a per partition constraint pair e The multilevel k way partitioning algorithms can compute a partitioning solution in which each partition is contiguous e partitioning and ordering routines can compute multiple different solutions and select the best as the final solution e The mesh partitioning and mesh to graph conversion routines can operate on mixed element meshes e The command line programs provide full access to the entire set of capabilities provided by METIS API Operation 4 x stand alone program 5 x stand alone program Partition a graph pmetis gpmetis kmetis Partition a mesh partnmesh mpmetis partdmesh Compute a fill reducing oemetis ndmetis ordering of a sparse matrix onmetis Convert a mesh into a graph mesh2nodal m2gmetis mesh2dual Graph format checker graphchk graphchk Table 1 Mapping between the old 4 x and the new 5 x command line programs 2 1 Changes in the command line programs Table 1 shows how the v4 x command line programs map to the new set of command line programs provided by the 5 0 version of METIS As part of these changes none of the functionality offered by the old programs has been removed On the contrary the new programs have been extended to substantially increase the type of partitionin
37. ntities and the real_t data type for storing floating point quantities The idx t data type can be defined to be either a 32 or 64 bit signed integer whereas the 1 data type can be defined to be either a single or double precision float point number All of METIS API routines take as input arrays and or scalars that are of these two data types In addition met is h defines various enum data types for specifying various options and for returning status codes 5 2 Use of NULL parameters METIS API routines take a large number of parameters allowing the user to model complex graphs and specify complex partitioning ordering requirements However for most uses of METIS this level of complexity may not be required For that purpose and to also simplify the complexity associated with using its API METIS allows the application to specify a NULL value to many of these optional advanced parameters The API routines that will be described in subsequent sections will mark these parameters by following them with a NULL 5 3 C C and Fortran Support The various routines in METIS API can be called from either C C or Fortran programs Using C C with METIS is quite straightforward as METIS is written entirely in C However METIS API fully supports Fortran as well This support comes in three forms 1 All the scalar arguments in the routines are passed by reference to facilitate Fortran programs 2 the routines take a pa
38. of data that needs to be sent for each node is different In particular if s is the amount of data that needs to be sent for vertex v referred to as the vertex size then Equation 1 can be re written as totaly s Nadj v 2 METIS API supports this weighted totalv model by using an array called vsize such that the amount of data that needs to be sent due to the ith vertex is stored in vsize i Note that the amount of data that needs to be sent is different from the weight of the vertex The former corresponds to communication cost whereas the later corresponds to the computational cost Note that for partitioning algorithms to correctly minimize the totalv the graph should reflect the true information exchange requirements of the underlying computations For instance the dual graph of a finite element mesh does not 23 correctly model the underlying communication whereas the nodal graph does Which one is better When partitioning is used to distribute a graph or a mesh among the processors of a parallel computer the edgecut is only an approximation of the true communication cost resulting from the partitioning On the other hand by minimizing the totalv we can directly minimize the overall communication cost Despite of that for many graphs the solutions obtained by minimizing the edgecut or minimizing the totalv are comparable This is especially true for graphs corresponding to well shaped finite element meshes This is b
39. or of size nn that upon successful completion stores the partition vector for the nodes of the mesh The numbering of this vector starts from either 0 or 1 depending on the value of options METIS_OPTION_NUMBERING METIS_OK B IS ERROR MI IS ERROR INPUT IS ERROR Indicates that the function returned normally Indicates an input error EMORY Indicates that it could not allocate the required memory Indicates some other type of error 28 int METIS PartMeshNodal t ne t nn idx t eptr t eind idx t vwgt idx t vsize idx t nparts real_t tpwgts idx t options idx t objval idx t epart idx t npart Description This function is used to partition a mesh into k parts based on a partitioning of the mesh s nodal graph Parameters ne The number of elements in the mesh nn The number of nodes in the mesh eptr eind The pair of arrays storing the mesh as described in Section 5 6 vwgt NULL An array of size nn specifying the weights of the nodes A NULL value can be passed to indicate that all nodes have an equal weight vsize NULL An array of size nn specifying the size of the nodes that is used for computing the total communica tion volume as described in Section 5 7 A NULL value can be passed when the objective is cut or when all nodes have an equal size nparts The number of parts to partition the mesh tpwgts NULL This is an
40. ptions METIS OPTION PFACTOR Specifies the minimum degree of the vertices that will be ordered last If the specified value is x gt 0 then any vertices with a degree greater than 0 1 x average degree are removed from the graph an ordering of the rest of the vertices is computed and an overall ordering is computed by ordering the removed vertices at the end of the overall ordering For example if x 40 and the average degree is 5 then the algorithm will remove all vertices with degree greater than 20 The vertices that are removed are ordered last 1 they are automatically placed in the top level separator Good values are often in the range of 60 to 200 1 to 20 times more than the average Default value is 0 indicating that no vertices are removed Used to control whether or not the ordering algorithm should remove any vertices with high degree 1 dense columns This is particularly helpful for certain classes of LP matrices in which there a few vertices that are connected to many other vertices By removing these vertices prior to ordering the quality and the amount of time required to do the ordering improves options METIS OPTION UFACTOR Specifies the maximum allowed load imbalance among the partitions A value of x indicates that the allowed load imbalance is 1 2 1000 The load imbalance for the jth constraint is defined to be max w j i t j i where w j i is the fraction of the overall weight of the jt
41. r line The ith line of the ordering file contains the new order of the ith vertex of the graph The numbering in the ordering file starts from 0 Note that the ordering file stores what is referred to as the the inverse permutation vector iperm of the ordering Let be a matrix and let A be the reordered matrix The inverse permutation vector maps the ith row column of A into the iperm i row column of A 4 3 Programs 12 gpmetis options graphfile nparts Description Partitions a graph into a specified number of parts The computed partitioning is stored in a file named graphfile part nparts where graphfile and nparts correspond to the specified parameters Parameters graphfile The name of the file that stores the graph to be partitioned Section 4 1 1 nparts The number of parts that the graph will be partitioned into It should be greater than 1 Options ptype string Specifies the scheme used for computing the partitioning Possible values rb Multilevel recursive bisectioning kway Multilevel k way partitioning default ctype string Specifies the scheme used to match the vertices of the graph during the coarsening Possible values rm Random matching shem Sorted heavy edge matching default iptype string applies only when ptype rb Specifies the scheme used to compute the initial partitioning of the graph Possible values grow Grows a bisection using a greedy strategy default random Computes a bi
42. rameter called numflag or an opt ions parameter called METIS_OPTION_NUMBERING indicating whether or not the numbering of the graph or mesh starts from 0 or 1 In C programs numbering usu ally starts from 0 whereas in Fortran programs numbering starts from 1 3 METIS API incorporates alternative names for each of the routines to facilitate linking the library with Fortran programs In particular for every function METIS API provides four additional names one all capital one all lower case one all lower case with _ appended to it and one with _ appended to it For example for METIS PartGraphKway METIS API provides METIS_PARTGRAPHKWAY metis_partgraphkway metis_partgraphkway and metis partgraphkway These extra names allow the library to be di rectly linked into Fortran programs on a wide range of architectures including Cray SGI and HP If you still encounter problems linking with the library let us know so we can include appropriate support 5 4 Options array Most of the API routines take as a parameter an array called options which allow the application to fine tune and modify various aspects of the internal algorithms used by METIS The application must define this array as idx t options METIS NOPTIONS and the meaning of its various entries are as follows 19 options METIS OPTION PTYPE Specifies the partitioning method Possible values are METIS RB Multilevel recursive
43. s For the API routines it is sufficient to OR the above constants If an application does not want to take advantage of this capability then it can just supply a NULL as the value for that parameter For those applications that will like to modify certain elements of the algorithms METIS provide the METIS SetDefaultOptions routine to set the options to their default values After that the application can just modify the the options that is interested in modifying This is illustrated as follows idx t options METIS NOPTIONS METIS SetDefaultOptions options options METIS OPTION NSEPS 10 options OPTION UFACTOR 100 METIS NodeND options 5 5 Graph data structure of the graph partitioning and sparse matrix ordering routines in METIS take as input the adjacency structure of the graph and the weights of the vertices and edges if any The adjacency structure of the graph is stored using the compressed storage format CSR The CSR format is a widely used scheme for storing sparse graphs In this format the adjacency structure of a graph with n vertices and m edges is represented using two arrays xadj and ad jncy The array is of size n 1 whereas the adjncy array is of size 2m this is because for each edge between vertices v and u we actually store both v u and u v The adjacency structure of the graph is stored as follows Assuming that vertex numbering starts from
44. s of each element can be stored in any order The mesh file allows for mixed elements meshes and as such the number of nodes that are supplied in each line can vary l The current mesh format does not allow for the specification of weights with the vertices in the nodal graph If you need to partition the nodal graph of a mesh whose vertices can have different weights then the m2gmet i s routine should be used to first create the nodal graph which should be subsequently edited to include the required weights prior to using gpmet is to partition it 11 4 1 3 Target partition weights file The graph and mesh partitioning routines take as input an optional file that specifies the target weights of the various partitions using the tpwgt s option This file contains a sequence of lines whose format are of the form frompid topid fromcnum tocnum twgt where rompid and topid specify partition numbers numbering starting from 0 f romcnum and t ocnum specify constraint numbers numbering starting from 0 and twgt is a floating point number specifying a fraction of the total weight i e better be lt 1 0 The parts in square brackets indicate optional parts The meaning of the above specification is as follows For each of the constraints from f romcnum up to and including t ocnum for the partitions starting from rompid up to and including will be assigned a target weight of twgt If topid is not supplied then
45. section at random followed by a refinement objtype string applies only when ptype kway Specifies the partitioning s objective function Possible values cut Edgecut minimization default vol Total communication volume minimization contig applies only when ptype kway Specifies that the partitioning routines should try to produce partitions that are contiguous Note that if the input graph is not connected this option is ignored minconn applies only when ptype kway Specifies that the partitioning routines should try to minimize the maximum degree of the subdomain graph i e the graph in which each partition is a node and edges connect subdomains with a shared interface tpwgts filename Specifies the name of the file that stores for each constraint the target weights for each partition Section 4 1 3 By default for each constraint all partitions are assumed to be of the same size ufactor int Specifies the maximum allowed load imbalance among the partitions It is this described under METIS_OPTION_UFACTOR in Section 5 4 Note that in the case of multiple constraints the same load imbalance tolerance is applied to all the constraints Use ubvec to provide per constraint load imbalance tolerances ubvec string Specifies the per constraint allowed load imbalance among partitions The string must contain a space separated list of floating point numbers one for each of the constraints For example for three constrain
46. ti constraint partitioning and communication volume based partitioning objectives 2 2 4 Migration issues Since the calling sequence of all the API routines and in some cases their names has changed migrating to the new API will require code modifications To ensure that these modifications are minimal the new API routines allow users to provide NULL as the argument to many of the parameters for which there are reasonable defaults Thus we expect the migration to the new API will be rather straightforward as long as the application does not want to take advantage of the newly added capabilities Operation 4 x routine 5 x routine E Partition a graph IS PartGraphRecursive METIS PartGraphRecursive ETIS mCPartGraphRecursive ETIS_WPartGraphRecursive ETIS PartGraphKway METIS PartGraphKway ETIS mCPartGraphKway ETIS WPartGraphKway ETIS PartGraphVKway ETIS_WPartGraphVKway Partition a mesh ETIS_PartMeshNodal METIS_PartMeshNodal ETIS_PartMeshDual METIS_PartMeshDual Compute a fill reducing ETIS_EdgeND METIS_NodeND ordering of a sparse matrix ETIS_NodeND ETIS_NodeWND Convert a mesh into a ETIS MeshToNodal METIS MeshToNodal graph ETIS MeshToDual METIS MeshToDual Utility routines ETIS EstimateMemory Deprecated New utility routines METIS SetDefaultOptions METIS Free Table 2 Mapping between the old 4 x and
47. topid frompid If tocnum is not supplied then tocnum fromcnum If fromcnum tocnum then fromcnum 0 and tocnum ncon l If the file does not contain a t wgt specification for all the target partition weight constraint combinations then the twgt for the unspecified ones is determined by equally distributing the left over portion of the total weight for each constraint It is important that for each constraint the sum of the specified t wgts values is less than or equal to 1 0 For example assuming that ncon 1 nparts 5 then the following tpwgt s file 0 1 4 3 specifies the following target partition weights part 0 2 part 1 2 part 2 15 part 3 15 and part 4 0 3 Note that the 15 fractions for part 2 and part 3 are due to the equal distribution of the left over weight 1 0 7 4 2 Output file formats The output of METIS is either a partition or an ordering file depending on whether METIS is used for graph mesh partitioning or for sparse matrix ordering The format of these files are described in the following sections 4 2 1 Partition file The partition file of a graph with n vertices consists of n lines with a single number per line The ith line of the file contains the partition number that the ith vertex belongs to Partition numbers start from 0 up to the number of partitions minus one 4 2 2 Ordering file The ordering file of a graph with n vertices consists of n lines with a single number pe
48. ts real t tpwgts idx t options idx t objval idx_t epart idx t npart Description This function is used to partition a mesh into k parts based on a partitioning of the mesh s dual graph Parameters ne The number of elements in the mesh nn The number of nodes in the mesh eptr eind The pair of arrays storing the mesh as described in Section 5 6 vwgt NULL An array of size ne specifying the weights of the elements A NULL value can be passed to indicate that all elements have an equal weight vsize NULL An array of size ne specifying the size of the elements that is used for computing the total communi cation volume as described in Section 5 7 A NULL value can be passed when the objective is cut or when all elements have an equal size ncommon Specifies the number of common nodes that two elements must have in order to put an edge between them in the dual graph Given two elements and e2 containing n and nodes respectively then an edge will connect the vertices in the dual graph corresponding to e and e if the number of common nodes between them is greater than or equal to min ncommon n 1 n3 1 The default value is 1 indicating that two elements will be connected via an edge as long as they share one node However this will tend to create too many edges increasing the memory and time requirements of the partitioning The user should select higher values that are better suited for the ele
49. ts the string can be 1 02 1 2 1 35 indicating a desired maximum load imbalance of 296 2096 and 35 respectively The load imbalance is defined in a way similar to ufactor If supplied this parameter takes priority over ufactor 13 niter int Specifies the number of iterations for the refinement algorithms at each stage of the uncoarsening process Default is 10 ncuts int Specifies the number of different partitionings that it will compute The final partitioning is the one that achieves the best edgecut or communication volume Default is 1 nooutput Specifies that no partitioning file should be generated seed int Selects the seed of the random number generator dbglvl int Specifies the type of progress debugging information that will be printed to stdout The supplied value corresponds to the addition bitwise OR of the various values described in Section 5 4 for METIS OPTION DBGLVL The default value is 0 no progress debugging information help Displays the command line options along with a description 14 mpmetis options meshfile nparts Description Partitions a mesh into a specified number of parts The computed partitioning is stored in two files named meshfile npart nparts that stores the partitioning of the nodes and meshfile epart nparts that stores the partitioning of the elements The meshfile and nparts components of those files correspond to the specified parameters The format of the partitioning fil
50. ts of the vertices as described in Section 5 5 vsize NULL The size of the vertices for computing the total communication volume as described in Section 5 7 adjwgt NULL The weights of the edges as described in Section 5 5 nparts The number of parts to partition the graph tpwgts NULL This is an array of size nparts xncon that specifies the desired weight for each partition and constraint The target partition weight for the ith partition and jth constraint is specified at tpwgt s the numbering for both partitions and constraints starts from 0 For each constraint the sum of the tpwgts entries must be 1 0 i e tpwgts i ncon j 1 0 A NULL value can be passed to indicate that the graph should be equally divided among the partitions ubvec NULL This is an array of size ncon that specifies the allowed load imbalance tolerance for each constraint For the ith partition and jth constraint the allowed weight is the ubvec j tpwgts i ncon j fraction of the jth s constraint total weight The load imbalances must be greater than 1 0 A NULL value can be passed indicating that the load imbalance tolerance for each constraint should be 1 001 for ncon 1 or 1 01 for ncong 1 options NULL This is the array of options as described in Section 5 4 The following options are valid for METIS_PartGraphRecursive METIS_OPTION_CTYPE METIS_OPTION_IPTYPE ETIS OPTION METIS OPTION NCUTS METIS
51. uld be at least METIS NOPTIONS Returns METIS OK Indicates that the function returned normally int METIS Free idx t ptr Description Frees the memory that was allocated by either the METIS MeshToDual or the METIS MeshToNodal rou tines for returning the dual or nodal graph of a mesh Parameters ptr The pointer to be freed This pointer should be one of the xad or ad jncy returned by METIS API routines Returns METIS OK Indicates that the function returned normally 33 6 System requirements and contact information METIS is written entirely in ANSI C and is portable on most Unix systems that have an ANSI C compiler the GNU C compiler will do It has been tested on Linux SunOS and OSX Instructions on how to build and install METIS can be found in the file Install txt ofthe distribution METIS have been extensively tested on a number of different architectures However even though METIS contains no known bugs this does not mean that all of its bugs have been found and fixed If you have any problems please send email to karypis 9 cs umn edu with a brief description of the problem Also any future updates to METIS will be made available on WWW at http www cs umn edu metis 7 Copyright amp license notice METIS is copyrighted by the Regents of the University of Minnesota It can be freely used for educational and research purposes by non profit institutions and US government agencies only Other organi
52. ultilevel k way partitioning approaches can be used to directly minimize the total communication volume resulting from the partitioning first fac tor In addition METIS also provides support for minimizing the third factor which essentially reduces the number of startups and indirectly up to a point reduces the second factor 3 3 Support for multi phase and multi physics computations The traditional graph partitioning problem formulation is limited in the types of applications that it can effectively model because it specifies that only a single quantity be load balanced Many important types of multi phase and multi physics computations require that multiple quantities be load balanced simultaneously This is because synchronization steps exist between the different phases of the computations and so each phase must be individually load balanced That is it is not sufficient to simply sum up the relative times required for each phase and to compute a partitioning based on this sum Doing so may lead to some processors having too much work during one phase of the computation and so these may still be working after other processors are idle and not enough work during another Instead it is critical that every processor have an equal amount of work from each phase of the computation METIS includes partitioning routines that can be used to partition a graph in the presence of such multiple balancing constraints Each vertex is now assigned a v
53. x and a similar process is applied recursively for each one of the other two parts The multilevel nested dissection paradigm is quite effective in producing re orderings that incur low fill in 3 7 Converting a mesh into a graph METIS provides the m2gmet is program for converting a mesh into the graph format used by METIS This program can generate either the nodal or dual graph of the mesh The corresponding API routines are METIS MeshToNodal and METIS MeshToDual Since METIS does not provide API routines that can directly compute a multi constraint partitioning of a mesh these routines can be used to first convert the mesh into a graph which can then be used as input to METIS graph partitioning routines to obtain such partitionings 4 METIS stand alone programs METIS provides a variety of programs that can be used to partition graphs partition meshes compute fill reducing orderings of sparse matrices as well as programs to convert meshes into graphs appropriate for METIS s graph parti tioning programs 4 1 Input file formats The various programs in METIS require as input either a file storing a graph or a file storing a mesh The format of these files are described in the following sections 4 1 4 Graph file The primary input of the partitioning and fill reducing ordering programs in METIS is the undirected graph to be partitioned or ordered This graph is stored in a file and is supplied to the various programs as one of
54. zations are allowed to use METIS only for evaluation purposes and any further uses will require prior approval The software may not be sold or redistributed without prior approval One may make copies of the software for their use provided that the copies are not sold or distributed are used under the same terms and conditions As unestablished research software this code is provided on an as is basis without warranty of any kind either expressed or implied The downloading or executing any part of this software constitutes an implicit agreement to these terms These terms and conditions are subject to change at any time without prior notice References 1 Bruce Hendrickson Graph partitioning and parallel solvers Has the emperor no clothes In Proc of Irregu lar 1998 1998 2 G Karypis and V Kumar Multilevel algorithms for multi constraint graph partitioning In Proceedings of Super computing 1998 3 G Karypis and V Kumar Multilevel k way partitioning scheme for irregular graphs Journal of Parallel and Distributed Computing 48 1 96 129 1998 4 G Karypis and V Kumar A fast and high quality multilevel scheme for partitioning irregular graphs SJAM Journal on Scientific Computing 20 1 359 392 1999 5 B W Kernighan and S Lin An efficient heuristic procedure for partitioning graphs Bell System Technical Journal 49 2 291 307 1970 34
Download Pdf Manuals
Related Search
Related Contents
Charlottes à l`abricot allégées – Le vendredi c`est KVT-617DVD KVT-647DVD 4 Cnfiguration - D-Link Kidde I9070 User's Manual Copyright © All rights reserved.
Failed to retrieve file