Mapping and Ordering¶
The Mapping class¶
- class Mapping(*args)¶
The Mapping constructor calls libscotch’s
mapAllocfunction. Any argument is conveyed to theinit()method. If there are no arguments, theinit()method is not called.firstbeing the argument given to theinit()method, the followingfuncmethods all proxy tofirst.map_func(self, *args), except forre_compute()andre_fixed_compute()which proxy theremap_computeandremap_fixed_computemethods, respectively. For nowfirstis always a :class: Graph instance, can be used to factorizeMeshroutines later on. We will define the methods in the way in which they are called, using a graph :class: Graph instance as the calling object :- init(first, mapp, arch, parttab)¶
Calls
first.map_init(first, mapp, arch, parttab),selfbeing theMappinginstance.first.map_init(first, mapp, arch, parttab)can also be called directly.
- Parameters:
- graph.map_exit(mapp)¶
This routine cleans-up all fields of the instance. Is the opposite of the
init()routine. Called automatically when the object is destroyed. Calling explicitly this method is only required when aninit()call follows.
- Parameters:
mapp (A
Mapping) – The mapping to be freed.
- graph.map_compute(mapp, strat)¶
This routine computes a mapping of the API mapping structure
mappingwith respect to the given strategystrat.
- Parameters:
- graph.map_fixed_compute(mapp, start)¶
This routine computes a mapping with fixed vertices of the API mapping structure with respect to the given strategy.
- Parameters:
- graph.remap_compute(mapp, mapo, emrval, vmlotab, start)¶
This routine computes a remapping of the API mapping structure
mappingwith respect to the given strategystrat.
- Parameters:
mapping (
Mapping) – The mapping to be computed.mapo (Any kind of iterable or a numpy array) – The already computed mapping array used to account for migration costs.
emraval (Floating-point number) – Individual migration cost.
vmlotab (Any kind of iterable or a numpy array) – Vertex migration cost array.
strat (
Strat) – Strategy to be used for the mapping.
- graph.remap_fixed_compute(mapp, mapo, emrval, vmlotab, start)¶
This routine computes a remapping with fixed vertices of the API mapping structure
mappingwith respect to the given strategystrat.
- Parameters:
mapping (
Mapping) – The mapping to be computed.mapo (Any kind of iterable or a numpy array) – The already computed mapping array used to account for migration costs.
emraval (Floating-point number) – Individual migration cost.
vmlotab (Any kind of iterable or a numpy array) – Vertex migration cost array.
strat (
Strat) – Strategy to be used for the mapping.
- graph.map_save(stream)¶
This routine saves the contents of the given user mapping
mappingto the given streamstream.
- Parameters:
mapping (
Mapping) – The mapping to be saved.stream (Either a file object (result of an
open(), don’t forget to close it) or a filename, as a string or as a bytes object (such asb"file/name")) – Input file or stream to write to.
- graph.map_load(stream)¶
This routine loads the contents of the given user mapping
mappingfrom the given streamstream.
- Parameters:
mapping (
Mapping) – The mapping to be loaded.stream (Either a file object (result of an
open(), don’t forget to close it) or a filename, as a string or as a bytes object (such asb"file/name")) – Input file or stream to read from.
- graph.map_view(*args)¶
This routine writes mapping statistics (load of target processors, number of neigh- boring domains, average dilation and expansion, edge cut size, distribution of edge dilations) to the given stream.
- Parameters:
mapping (
Mapping) – The mapping to be viewed.stream (Either a file object (result of an
open(), don’t forget to close it) or a filename, as a string or as a bytes object (such asb"file/name")) – Input file or stream to write to.
The Ordering class¶
- class Ordering(*args)¶
The Ordering constructor calls libscotch’s
orderAllocfunction. Any argument is conveyed to theinit()method. If there are no arguments, theinit()method is not called.firstbeing the argument given to theinit()method, the followingfuncmethods all proxy tofirst.map_func(self, *args). For nowfirstis always a :class: Graph instance, can be used to factorizeMeshroutines later on. We will define the methods in the way in which they are called, using a graph :class: Graph instance as the calling object :- init(first, ordering, permtab=None, peritab=None, cblknbr=None, rangtab=None, treetab=None)¶
Calls
first.map_init(ordering, permtab=None, peritab=None, cblknbr=None, rangtab=None, treetab=None),selfbeing theMappinginstance.first.map_init(ordering, permtab=None, peritab=None, cblknbr=None, rangtab=None, treetab=None)can also be called directly.
- Parameters:
first (
Graph) – The first argument is the object to be ordered.ordering (
Ordering) – Ordering to be initialized.permtab (Any kind of iterable or a numpy array) – Array holding the permutation of the reordered matrix. If given, the values of the returned array are copied in this one. (Optional)
peritab (Any kind of iterable or a numpy array) – Inverse permutation of the reordered matrix. If given, the values of the returned array are copied in this one. (Optional)
cblknbr (Integer) – Number of column blocks in the block ordering. If given, the value is copied in this one. (Optional)
rangtab (Any kind of iterable or a numpy array) – Array of ranges for the column blocks. If given, the values of the returned array are copied in this one. (Optional)
treetab (Any kind of iterable or a numpy array) – Array of ascendants of permuted column blocks in the separators tree. If given, the values of the returned array are copied in this one. (Optional)
- graph.order_exit(ordering)¶
This routine cleans-up all fields of the instance. Is the opposite of the
init()routine. Called automatically when the object is destroyed. Calling explicitly this method is only required when aninit()call follows.
- Parameters:
ordering (
Ordering) – The ordering to be freed.
- graph.order_check(ordering)¶
This routine checks the consistency of the ordering instance.
- Parameters:
ordering (
Ordering) – Ordering to be checked.
- graph.order_compute(ordering, strat)¶
This routine computes a block ordering of the graph itself with respect to the given strategy
strat. Stores the result in the given ordering instanceordering.
- Parameters:
- graph.order_compute_list(ordering, listtab, strat)¶
This routine computes a block ordering of the graph itself with respect to the given strategy
strat. Stores the result in the given ordering instanceordering. The induced subgraph is described by means of a vertex list: listnbr holds the number of vertices to keep in the induced subgraph, the indices of which are given, in any order, in thelisttabarray.
- Parameters:
- graph.order_load(ordering, stream)¶
This routine loads the contents of the given ordering instance
orderingfrom the given streamstream.
- Parameters:
ordering (
Ordering) – Ordering to be loaded.stream (Either a file object (result of an
open(), don’t forget to close it) or a filename, as a string or as a bytes object (such asb"file/name")) – Input file or stream to read from.
- graph.order_save(ordering, stream)¶
This routine saves the contents of the given ordering instance
orderingto the given streamstream.
- Parameters:
ordering (
Ordering) – Ordering to be saved.stream (Either a file object (result of an
open(), don’t forget to close it) or a filename, as a string or as a bytes object (such asb"file/name")) – Input file or stream to write to.
- graph.order_save_map(ordering, stream)¶
This routine saves the contents of the given ordering instance
orderingto the given streamstreamin the Scotch mapping format.
- Parameters:
ordering (
Ordering) – Ordering to be saved.stream (Either a file object (result of an
open(), don’t forget to close it) or a filename, as a string or as a bytes object (such asb"file/name")) – Input file or stream to write to.
- graph.order_save_tree(ordering, stream)¶
This routine saves the contents of the given ordering instance
orderingto the given streamstreamin the tree output format format.
- Parameters:
ordering (
Ordering) – Ordering to be saved.stream (Either a file object (result of an
open(), don’t forget to close it) or a filename, as a string or as a bytes object (such asb"file/name")) – Input file or stream to write to.