petsc4py.PETSc.MatPartitioning

class petsc4py.PETSc.MatPartitioning

Bases: Object

Object for managing the partitioning of a matrix or graph.

Enumerations

Type

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.

setFromOptions()

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

petsc.MatPartitioningApply

Source code at petsc4py/PETSc/MatPartitioning.pyx:142

Parameters:

partitioning (IS) –

Return type:

None

create(comm=None)

Create a partitioning context.

Collective.

Parameters:

comm (Comm | None) – MPI communicator, defaults to Sys.getDefaultComm.

Return type:

Self

See also

destroy, petsc.MatPartitioningCreate

Source code at petsc4py/PETSc/MatPartitioning.pyx:60

destroy()

Destroy the partitioning context.

Collective.

See also

create, petsc.MatPartitioningDestroy

Source code at petsc4py/PETSc/MatPartitioning.pyx:47

Return type:

Self

getType()

Return the partitioning method.

Not collective.

See also

setType, petsc.MatPartitioningGetType

Source code at petsc4py/PETSc/MatPartitioning.pyx:98

Return type:

str

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 is Mat.Type.MPIADJ.

Return type:

None

See also

petsc.MatPartitioningSetAdjacency

Source code at petsc4py/PETSc/MatPartitioning.pyx:124

setFromOptions()

Set parameters in the partitioner from the options database.

Collective.

See also

Working with PETSc options (TODO), petsc.MatPartitioningSetFromOptions

Source code at petsc4py/PETSc/MatPartitioning.pyx:112

Return type:

None

setType(matpartitioning_type)

Set the type of the partitioner to use.

Collective.

Parameters:

matpartitioning_type (Type | str) – The partitioner type.

Return type:

None

See also

getType, petsc.MatPartitioningSetType

Source code at petsc4py/PETSc/MatPartitioning.pyx:79

view(viewer=None)

View the partitioning data structure.

Collective.

Parameters:

viewer (Viewer | None) – A Viewer to display the graph.

Return type:

None

See also

petsc.MatPartitioningView

Source code at petsc4py/PETSc/MatPartitioning.pyx:27