Package hedge :: Package backends :: Package mpi :: Class MPIRunContext
[hide private]
[frames] | no frames]

Class MPIRunContext

source code


Instance Methods [hide private]
 
__init__(self, communicator, discr_class)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
distribute_mesh(self, mesh, partition=None)
Take the Mesh instance `mesh' and distribute it according to `partition'.
source code
 
receive_mesh(self)
Wait for a mesh chunk to be sent by the head rank.
source code
 
make_discretization(self, mesh_data, *args, **kwargs)
Construct a Discretization instance.
source code

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Properties [hide private]
  rank
  ranks
  head_rank

Inherited from RunContext: is_head_rank

Inherited from object: __class__

Method Details [hide private]

__init__(self, communicator, discr_class)
(Constructor)

source code 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Overrides: object.__init__
(inherited documentation)

distribute_mesh(self, mesh, partition=None)

source code 

Take the Mesh instance `mesh' and distribute it according to `partition'.

If partition is an integer, invoke PyMetis to partition the mesh into this many parts, distributing over the first `partition' ranks.

If partition is None, act as if partition was the integer corresponding to the current number of ranks on the job.

If partition is not an integer, it must be a mapping from element number to rank. (A list or tuple of rank numbers will do, for example, or so will a full-blown dict.)

Returns a mesh chunk.

We deliberately do not define the term `mesh chunk'. The return value of this function is to be treated as opaque by the user, only to be used as an argument to make_discretization().

This routine may only be invoked on the head rank.

Overrides: RunContext.distribute_mesh
(inherited documentation)

receive_mesh(self)

source code 

Wait for a mesh chunk to be sent by the head rank.

We deliberately do not define the term `mesh chunk'. The return value of this function is to be treated as opaque by the user, only to be used as an argument to make_discretization().

This routine should only be invoked on non-head ranks.

Overrides: RunContext.receive_mesh
(inherited documentation)

make_discretization(self, mesh_data, *args, **kwargs)

source code 

Construct a Discretization instance.

`mesh_data' is whatever gets returned from distribute_mesh and receive_mesh(). Any extra arguments are directly forwarded to the respective Discretization constructor.

Overrides: RunContext.make_discretization
(inherited documentation)

Property Details [hide private]

rank

Get Method:
unreachable.rank(self)

ranks

Get Method:
unreachable.ranks(self)

head_rank

Get Method:
unreachable.head_rank(self)