petsc4py.PETSc.MatPartitioning#
- class petsc4py.PETSc.MatPartitioning#
Bases:
Object
Object for managing the partitioning of a matrix or graph.
Enumerations
The partitioning types.
Methods Summary
apply
(partitioning)Return a partitioning for the graph represented by a sparse matrix.
create
([comm])Create a partitioning context.
destroy
()Destroy the partitioning context.
getType
()Return the partitioning method.
setAdjacency
(adj)Set the adjacency graph (matrix) of the thing to be partitioned.
Set parameters in the partitioner from the options database.
setType
(matpartitioning_type)Set the type of the partitioner to use.
view
([viewer])View the partitioning data structure.
Methods Documentation
- apply(partitioning)#
Return a partitioning for the graph represented by a sparse matrix.
Collective.
For each local node this tells the processor number that that node is assigned to.
See also
- create(comm=None)#
Create a partitioning context.
Collective.
- Parameters:
comm (Comm | None) – MPI communicator, defaults to
Sys.getDefaultComm
.- Return type:
See also
- destroy()#
Destroy the partitioning context.
Collective.
See also
Source code at petsc4py/PETSc/MatPartitioning.pyx:49
- Return type:
- getType()#
Return the partitioning method.
Not collective.
See also
Source code at petsc4py/PETSc/MatPartitioning.pyx:100
- Return type:
- setAdjacency(adj)#
Set the adjacency graph (matrix) of the thing to be partitioned.
Collective.
- Parameters:
adj (Mat) – The adjacency matrix, this can be any
Mat.Type
but the natural representation isMat.Type.MPIADJ
.- Return type:
See also
- setFromOptions()#
Set parameters in the partitioner from the options database.
Collective.
Source code at petsc4py/PETSc/MatPartitioning.pyx:114
- Return type:
- setType(matpartitioning_type)#
Set the type of the partitioner to use.
Collective.
See also
- view(viewer=None)#
View the partitioning data structure.
Collective.
See also