Architecture in ScotchPy¶
Architectures are implemented in ScotchPy with the Arch class.
The Arch class¶
- class Arch(init=True)¶
The graph constructor itself calls libscotch’s
archAllocfunction, and usuallyarchInitis called too.- Parameters:
init – If True, the architecture allocation is followed by the init. If not, the
init()method needs to be called beforebuild/build0(),build2()orload().
- init()¶
This routine is included in a class call with
init=True. Mandatory before calling eitherbuild()orload(), or after callingexit().
- exit()¶
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.
- load(stream)¶
This routine builds the architecture from the data included in the given file or stream.
- Parameters:
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.
- save(stream)¶
This routine saves the architecture to the given file or stream in the form of a text string.
- Parameters:
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.
- name()¶
This routine gives the name of the architecture.
- Returns:
The name of the architecture.
- Return type:
String
- size()¶
This routine gives the size of the architecture.
- Returns:
The size of the architecture.
- Return type:
Integer
- build/build0 (graf, listtab, strat)
These two routines (as of now) fill the contents of the given opaque target structure with the data provided by the user. The source graph provided on input is turned into the
deco 1decomposition-defined target architecture.
- build2(graf, listtab)¶
This routines fill the contents of the given opaque target structure with the data provided by the user. The source graph provided on input is turned into the
deco 1decomposition-defined target architecture.- Parameters:
graf (
Graph) – The source graph.listtab (Numpy array or list of integers) – Restricts the vertices to be considered for the architecture.
- cmplt(vertnbr)¶
This routine fills the contents of the given opaque target structure with the description of a complete graph architecture with
vertnbrprocessors.- Parameters:
vertnbr (Integer) – Number of processors that can be used as input.
- cmpltw(velotab)¶
This routine fills the contents of the given opaque target structure with the description of a weighted graph architecture with length of
velotabprocessors.- Parameters:
velotab (Numpy array or list of integers) – Array of processor weights.
- hcub(hdimval)¶
This routine fills the contents of the given opaque target structure with the description of a hypercube graph architecture of dimension
hdimval.- Parameters:
hdimval (Integer) – Dimension of the hypercube.
- ltLeaf(sizetab, linktab, permtab)¶
This routine fills the contents of the given opaque target structure with the description of a labeled tree-shaped, hierarchical graph architecture.
- Parameters:
sizetab (Numpy array or list of integers) – Array of numbers of childs at level (i+1) for each node at level i.
linktab (A1ny iterable of integers) – Array of costs of communication between processors the first of which belongs to this level i.
permtab (Numpy array or list of integers) – Numpy array or list of integers
- mesh(*args)¶
This routine is generalized version of
mesh2(),mesh3()andmeshX()- it’s almostmeshX(), but the integers don’t have to be wrapped in an iterable and must be given ore after the other.- Parameters:
args (Numpy array or list of integers) – Number of processors in each dimension.
- mesh2(xdimval, ydimval)¶
This routine fills the contents of the given opaque target structure with the description of a 2D mesh architecture with
xdimvalXydimvalprocessors.- Parameters:
xdimval (Integer) – Number of processors in the X dimension.
ydimval (Integer) – Number of processors in the Y dimension.
- mesh3(xdimval, ydimval, zdimval)¶
This routine fills the contents of the given opaque target structure with the description of a 3D mesh architecture with
xdimvalXydimvalXzdimvalprocessors.- Parameters:
xdimval (Integer) – Number of processors in the X dimension.
ydimval (Integer) – Number of processors in the Y dimension.
zdimval (Integer) – Number of processors in the Z dimension.
- meshX(dimntab)¶
This routine fills the contents of the given opaque target structure with the description of a mesh architecture with length of
dimntab- dimension and the product of all elements ofdimntabprocessors.- Parameters:
dimntab (Numpy array or list of integers) – Array of numbers of processors in each dimension.
- sub(orgarch, vnumtab)¶
This routine fills the contents of the given opaque target structure with the description of a subset of the
orgarcharchitecture, restricted to thevertnbrprocessors which are listed invnumtab.- Parameters:
orgarch (
Arch) – Original architecture.vnumtab (Numpy array or list of integers) – Array with processor ranks to be included in the sub-architecture.
- tLeaf(sizetab, linktab)¶
This routine fills the contents of the given opaque target structure with the description of a tree-shaped, hierarchical graph architecture with the sum of all of
sizetabprocessors.- Parameters:
sizetab (Numpy array or list of integers) – Array of numbers of childs at level (i+1) for each node at level i.
linktab (Numpy array or list of integers) – Array of costs of communication between processors the first of which belongs to this level i.
- torus(*args)¶
This routine is generalized version of
torus2(),torus3()andtorusX()- it’s almosttorusX(), but the integers don’t have to be wrapped in an iterable and must be given ore after the other.- Parameters:
args (Numpy array or list of integers) – Number of processors in each dimension.
- torus2(xdimval, ydimval)¶
This routine fills the contents of the given opaque target structure with the description of a 2D torus architecture with
xdimvalXydimvalprocessors.- Parameters:
xdimval (Integer) – Number of processors in the X dimension.
ydimval (Integer) – Number of processors in the Y dimension.
- torus3(xdimval, ydimval, zdimval)¶
This routine fills the contents of the given opaque target structure with the description of a 3D torus architecture with
xdimvalXydimvalXzdimvalprocessors.- Parameters:
xdimval (Integer) – Number of processors in the X dimension.
ydimval (Integer) – Number of processors in the Y dimension.
zdimval (Integer) – Number of processors in the Z dimension.
- torusX(dimntab)¶
This routine fills the contents of the given opaque target structure with the description of a torus architecture with length of
dimntab- dimension and the product of all elements ofdimntabprocessors.- Parameters:
dimntab (Numpy array or list of integers) – Array of numbers of processors in each dimension.
- vhcub():
This routine fills the contents of the given opaque target structure with the description of a ‘variable-sized’ hypercube architecture.
- vcmplt():
This routine fills the contents of the given opaque target structure with the description of a ‘variable-sized’ complete graph architecture.
Various functions are defined as wrappers of Arch operations: