FreePOOMA
2.4.1
|
GridLayout is a Layout class that breaks an N-dimensional Interval into sub-domains arranged in an N-dimensional grid, where the sub-domain sizes are specified by a Grid domain object. More...
#include <GridLayout.h>
Public Types | |
enum | { dimensions = Dim } |
enum | { repartitionEvent = 1 } |
enum | { dynamic = true } |
typedef GridLayout< Dim > | This_t |
typedef Observable< This_t > | Observable_t |
typedef GridLayoutData< Dim > | LayoutData_t |
typedef LayoutData_t::Domain_t | Domain_t |
typedef LayoutData_t::BaseDomain_t | BaseDomain_t |
typedef LayoutData_t::Context_t | Context_t |
typedef LayoutData_t::ID_t | ID_t |
typedef LayoutData_t::Value_t | Value_t |
typedef LayoutData_t::List_t | List_t |
typedef DynamicEvents::PatchID_t | PatchID_t |
typedef DynamicEvents::CreateSize_t | CreateSize_t |
typedef GuardLayers< Dim > | GuardLayers_t |
typedef DerefIterator< Value_t > | iterator |
Iterator through nodes. | |
typedef ConstDerefIterator < Value_t > | const_iterator |
typedef LayoutData_t::GCFillInfo_t | GCFillInfo_t |
Iterator through guard-cell-fill requests. | |
typedef std::vector < GCFillInfo_t > ::const_iterator | FillIterator_t |
Public Member Functions | |
GridLayout () | |
The default constructor does not initialize the layout. | |
GridLayout (const Domain_t &, const DistributedTag &) | |
Construct a layout with nothing else but a global domain. | |
GridLayout (const Domain_t &, const ReplicatedTag &) | |
GridLayout (const Domain_t &, const GuardLayers_t &, const DistributedTag &) | |
Same, but also specify guard cell info. | |
GridLayout (const Domain_t &, const GuardLayers_t &, const ReplicatedTag &) | |
GridLayout (const Domain_t &, const Loc< Dim > &, const DistributedTag &) | |
Domain + block count constructors. | |
GridLayout (const Domain_t &, const Loc< Dim > &, const GuardLayers_t &, const DistributedTag &) | |
GridLayout (const Domain_t &, const Loc< Dim > &, const GuardLayers_t &, const GuardLayers_t &, const DistributedTag &) | |
GridLayout (const Domain_t &, const Loc< Dim > &, const ReplicatedTag &) | |
GridLayout (const Domain_t &, const Loc< Dim > &, const GuardLayers_t &, const ReplicatedTag &) | |
GridLayout (const Domain_t &, const Loc< Dim > &, const GuardLayers_t &, const GuardLayers_t &, const ReplicatedTag &) | |
GridLayout (const Grid< Dim > &, const DistributedTag &) | |
Domain + Grid Domain constructors. | |
GridLayout (const Grid< Dim > &, const GuardLayers_t &, const DistributedTag &) | |
Internal guard layers same as external guard layers, specified by gcs: | |
GridLayout (const Grid< Dim > &, const GuardLayers_t &, const GuardLayers_t &, const DistributedTag &) | |
Independently-specified internal and external guard layers: | |
GridLayout (const Grid< Dim > &, const ReplicatedTag &) | |
GridLayout (const Grid< Dim > &, const GuardLayers_t &, const ReplicatedTag &) | |
Internal guard layers same as external guard layers, specified by gcs: | |
GridLayout (const Grid< Dim > &, const GuardLayers_t &, const GuardLayers_t &, const ReplicatedTag &) | |
Independently-specified internal and external guard layers: | |
template<class Partitioner > | |
GridLayout (const Domain_t &, const Partitioner &, const DistributedTag &) | |
template<class Partitioner > | |
GridLayout (const Domain_t &, const Partitioner &, const ReplicatedTag &) | |
template<class Partitioner > | |
GridLayout (const Domain_t &, const Partitioner &, const ContextMapper< Dim > &) | |
Domain + partition + mapper constructor. | |
GridLayout (const This_t &) | |
Copy constructor & assignment operator Shallow copies with reference counting. | |
This_t & | operator= (const This_t &) |
~GridLayout () | |
The actual data will be cleaned up by the LayoutData_t destructor if all references to the data go away. | |
void | initialize (const Domain_t &, const DistributedTag &) |
Initialize a layout with nothing else but a global domain. | |
void | initialize (const Domain_t &, const GuardLayers_t &, const DistributedTag &) |
void | initialize (const Domain_t &, const Loc< Dim > &, const DistributedTag &) |
void | initialize (const Domain_t &, const Loc< Dim > &, const GuardLayers_t &, const DistributedTag &) |
void | initialize (const Domain_t &, const Loc< Dim > &, const GuardLayers_t &, const GuardLayers_t &, const DistributedTag &) |
void | initialize (const Grid< Dim > &, const DistributedTag &) |
void | initialize (const Grid< Dim > &, const GuardLayers_t &, const DistributedTag &) |
void | initialize (const Grid< Dim > &, const GuardLayers_t &, const GuardLayers_t &, const DistributedTag &) |
template<class Partitioner > | |
void | initialize (const Domain_t &, const Partitioner &, const DistributedTag &) |
void | initialize (const Domain_t &, const ReplicatedTag &) |
void | initialize (const Domain_t &, const GuardLayers_t &, const ReplicatedTag &) |
void | initialize (const Domain_t &, const Loc< Dim > &, const ReplicatedTag &) |
void | initialize (const Domain_t &, const Loc< Dim > &, const GuardLayers_t &, const ReplicatedTag &) |
void | initialize (const Domain_t &, const Loc< Dim > &, const GuardLayers_t &, const GuardLayers_t &, const ReplicatedTag &) |
void | initialize (const Grid< Dim > &, const ReplicatedTag &) |
void | initialize (const Grid< Dim > &, const GuardLayers_t &, const ReplicatedTag &) |
void | initialize (const Grid< Dim > &, const GuardLayers_t &, const GuardLayers_t &, const ReplicatedTag &) |
template<class Partitioner > | |
void | initialize (const Domain_t &, const Partitioner &, const ReplicatedTag &) |
template<class Partitioner > | |
void | initialize (const Domain_t &, const Partitioner &, const ContextMapper< Dim > &) |
Domain + partition + mapper initializer. | |
void | initialize (const Domain_t &idom, const List_t &nodes, const Loc< Dim > &blocks, bool hasIG, bool hasEG, const GuardLayers_t &ig, const GuardLayers_t &eg) |
Used by the I/O or data management system to initialize the layout based on detailed state information previously stored. | |
const Loc< Dim > & | blocks () const |
Return the number of blocks in each dimension, as a Loc. | |
template<class Partitioner > | |
bool | repartition (const Partitioner &gp, const ContextMapper< Dim > &cm) |
Repartition the layout using a new Partitioner scheme. | |
void | sync () |
virtual void | notify (LayoutData_t &d, const ObserverEvent &event) |
Respond to events generated by the LayoutData_t. | |
template<class Ostream > | |
void | print (Ostream &ostr) const |
Print a GridLayout on an output stream. | |
Friends | |
class | GridLayoutView |
class | GridLayoutData< Dim > |
GridLayout stores its data in a RefCounted class to simplify memory management. |
GridLayout is a Layout class that breaks an N-dimensional Interval into sub-domains arranged in an N-dimensional grid, where the sub-domain sizes are specified by a Grid domain object.
This is an alternative to the more general tile Layout class that should perform faster since subdomains can be found using a set of 1-dimensional domainMap's, rather than by a more general search.
To construct a GridLayout, you can do any of the following:
typedef GridLayout<Dim> GridLayout< Dim >::This_t |
Reimplemented from LayoutBase< Dim, GridLayoutData< Dim > >.
typedef Observable<This_t> GridLayout< Dim >::Observable_t |
Reimplemented from LayoutBase< Dim, GridLayoutData< Dim > >.
typedef GridLayoutData<Dim> GridLayout< Dim >::LayoutData_t |
Reimplemented from LayoutBase< Dim, GridLayoutData< Dim > >.
typedef LayoutData_t::Domain_t GridLayout< Dim >::Domain_t |
Reimplemented from LayoutBase< Dim, GridLayoutData< Dim > >.
typedef LayoutData_t::BaseDomain_t GridLayout< Dim >::BaseDomain_t |
Reimplemented from LayoutBase< Dim, GridLayoutData< Dim > >.
typedef LayoutData_t::Context_t GridLayout< Dim >::Context_t |
Reimplemented from LayoutBase< Dim, GridLayoutData< Dim > >.
typedef LayoutData_t::ID_t GridLayout< Dim >::ID_t |
Reimplemented from LayoutBase< Dim, GridLayoutData< Dim > >.
typedef LayoutData_t::Value_t GridLayout< Dim >::Value_t |
Reimplemented from LayoutBase< Dim, GridLayoutData< Dim > >.
typedef LayoutData_t::List_t GridLayout< Dim >::List_t |
Reimplemented from LayoutBase< Dim, GridLayoutData< Dim > >.
typedef DynamicEvents::PatchID_t GridLayout< Dim >::PatchID_t |
typedef DynamicEvents::CreateSize_t GridLayout< Dim >::CreateSize_t |
typedef GuardLayers<Dim> GridLayout< Dim >::GuardLayers_t |
Reimplemented from LayoutBase< Dim, GridLayoutData< Dim > >.
typedef DerefIterator<Value_t> GridLayout< Dim >::iterator |
Iterator through nodes.
Basically the same as the vector iterator except it dereferences automatically.
Reimplemented from LayoutBase< Dim, GridLayoutData< Dim > >.
typedef ConstDerefIterator<Value_t> GridLayout< Dim >::const_iterator |
Reimplemented from LayoutBase< Dim, GridLayoutData< Dim > >.
typedef LayoutData_t::GCFillInfo_t GridLayout< Dim >::GCFillInfo_t |
Iterator through guard-cell-fill requests.
Reimplemented from LayoutBase< Dim, GridLayoutData< Dim > >.
typedef std::vector<GCFillInfo_t>::const_iterator GridLayout< Dim >::FillIterator_t |
Reimplemented from LayoutBase< Dim, GridLayoutData< Dim > >.
GridLayout< Dim >::GridLayout | ( | ) |
The default constructor does not initialize the layout.
In this case, layout initialization must be completed with the 'initialize' method before the layout can be used. A default layout has an empty global domain, and empty subdomain lists.
GridLayout< Dim >::GridLayout | ( | const Domain_t & | , |
const DistributedTag & | |||
) |
Construct a layout with nothing else but a global domain.
In this case, a default partitioner will be used, the GridPartition object, which will just make a grid with one block and no guard cells.
GridLayout< Dim >::GridLayout | ( | const Domain_t & | , |
const ReplicatedTag & | |||
) |
GridLayout< Dim >::GridLayout | ( | const Domain_t & | , |
const GuardLayers_t & | , | ||
const DistributedTag & | |||
) |
Same, but also specify guard cell info.
GridLayout< Dim >::GridLayout | ( | const Domain_t & | , |
const GuardLayers_t & | , | ||
const ReplicatedTag & | |||
) |
GridLayout< Dim >::GridLayout | ( | const Domain_t & | , |
const Loc< Dim > & | , | ||
const DistributedTag & | |||
) |
Domain + block count constructors.
In this case, the user specifies the global domain and the number of blocks in each dimension, which will cause the domain to be partitioned in a uniform manner. One or two GuardLayers objects may be specified. If only one is specified, it is used for both internal and external guards.
GridLayout< Dim >::GridLayout | ( | const Domain_t & | , |
const Loc< Dim > & | , | ||
const GuardLayers_t & | , | ||
const DistributedTag & | |||
) |
GridLayout< Dim >::GridLayout | ( | const Domain_t & | , |
const Loc< Dim > & | , | ||
const GuardLayers_t & | , | ||
const GuardLayers_t & | , | ||
const DistributedTag & | |||
) |
GridLayout< Dim >::GridLayout | ( | const Domain_t & | , |
const Loc< Dim > & | , | ||
const ReplicatedTag & | |||
) |
GridLayout< Dim >::GridLayout | ( | const Domain_t & | , |
const Loc< Dim > & | , | ||
const GuardLayers_t & | , | ||
const ReplicatedTag & | |||
) |
GridLayout< Dim >::GridLayout | ( | const Domain_t & | , |
const Loc< Dim > & | , | ||
const GuardLayers_t & | , | ||
const GuardLayers_t & | , | ||
const ReplicatedTag & | |||
) |
GridLayout< Dim >::GridLayout | ( | const Grid< Dim > & | , |
const DistributedTag & | |||
) |
Domain + Grid Domain constructors.
Like the block count constructors, but a Grid object is specified, allowing a general non-uniform grid to be created. Again, one or two GuardLayers objects may be specified. If only one is specified, it is used for both internal and external guards.
GridLayout< Dim >::GridLayout | ( | const Grid< Dim > & | , |
const GuardLayers_t & | , | ||
const DistributedTag & | |||
) |
Internal guard layers same as external guard layers, specified by gcs:
GridLayout< Dim >::GridLayout | ( | const Grid< Dim > & | , |
const GuardLayers_t & | , | ||
const GuardLayers_t & | , | ||
const DistributedTag & | |||
) |
Independently-specified internal and external guard layers:
GridLayout< Dim >::GridLayout | ( | const Grid< Dim > & | , |
const ReplicatedTag & | |||
) |
GridLayout< Dim >::GridLayout | ( | const Grid< Dim > & | , |
const GuardLayers_t & | , | ||
const ReplicatedTag & | |||
) |
Internal guard layers same as external guard layers, specified by gcs:
GridLayout< Dim >::GridLayout | ( | const Grid< Dim > & | , |
const GuardLayers_t & | , | ||
const GuardLayers_t & | , | ||
const ReplicatedTag & | |||
) |
Independently-specified internal and external guard layers:
GridLayout< Dim >::GridLayout | ( | const Domain_t & | , |
const Partitioner & | , | ||
const DistributedTag & | |||
) |
GridLayout< Dim >::GridLayout | ( | const Domain_t & | , |
const Partitioner & | , | ||
const ReplicatedTag & | |||
) |
GridLayout< Dim >::GridLayout | ( | const Domain_t & | , |
const Partitioner & | , | ||
const ContextMapper< Dim > & | |||
) |
Domain + partition + mapper constructor.
GridLayout< Dim >::GridLayout | ( | const This_t & | ) |
Copy constructor & assignment operator Shallow copies with reference counting.
GridLayout< Dim >::~GridLayout | ( | ) | [inline] |
The actual data will be cleaned up by the LayoutData_t destructor if all references to the data go away.
If any Observers remain, they will be notified by the Observable destructor.
This_t& GridLayout< Dim >::operator= | ( | const This_t & | ) |
void GridLayout< Dim >::initialize | ( | const Domain_t & | , |
const DistributedTag & | |||
) |
Initialize a layout with nothing else but a global domain.
In this case, a default partitioner will be used, the GridPartition object, which will try to make a grid with one block.
void GridLayout< Dim >::initialize | ( | const Domain_t & | , |
const GuardLayers_t & | , | ||
const DistributedTag & | |||
) |
void GridLayout< Dim >::initialize | ( | const Domain_t & | , |
const Loc< Dim > & | , | ||
const DistributedTag & | |||
) |
void GridLayout< Dim >::initialize | ( | const Domain_t & | , |
const Loc< Dim > & | , | ||
const GuardLayers_t & | , | ||
const DistributedTag & | |||
) |
void GridLayout< Dim >::initialize | ( | const Domain_t & | , |
const Loc< Dim > & | , | ||
const GuardLayers_t & | , | ||
const GuardLayers_t & | , | ||
const DistributedTag & | |||
) |
void GridLayout< Dim >::initialize | ( | const Grid< Dim > & | , |
const DistributedTag & | |||
) |
void GridLayout< Dim >::initialize | ( | const Grid< Dim > & | , |
const GuardLayers_t & | , | ||
const DistributedTag & | |||
) |
void GridLayout< Dim >::initialize | ( | const Grid< Dim > & | , |
const GuardLayers_t & | , | ||
const GuardLayers_t & | , | ||
const DistributedTag & | |||
) |
void GridLayout< Dim >::initialize | ( | const Domain_t & | , |
const Partitioner & | , | ||
const DistributedTag & | |||
) |
void GridLayout< Dim >::initialize | ( | const Domain_t & | , |
const ReplicatedTag & | |||
) |
void GridLayout< Dim >::initialize | ( | const Domain_t & | , |
const GuardLayers_t & | , | ||
const ReplicatedTag & | |||
) |
void GridLayout< Dim >::initialize | ( | const Domain_t & | , |
const Loc< Dim > & | , | ||
const ReplicatedTag & | |||
) |
void GridLayout< Dim >::initialize | ( | const Domain_t & | , |
const Loc< Dim > & | , | ||
const GuardLayers_t & | , | ||
const ReplicatedTag & | |||
) |
void GridLayout< Dim >::initialize | ( | const Domain_t & | , |
const Loc< Dim > & | , | ||
const GuardLayers_t & | , | ||
const GuardLayers_t & | , | ||
const ReplicatedTag & | |||
) |
void GridLayout< Dim >::initialize | ( | const Grid< Dim > & | , |
const ReplicatedTag & | |||
) |
void GridLayout< Dim >::initialize | ( | const Grid< Dim > & | , |
const GuardLayers_t & | , | ||
const ReplicatedTag & | |||
) |
void GridLayout< Dim >::initialize | ( | const Grid< Dim > & | , |
const GuardLayers_t & | , | ||
const GuardLayers_t & | , | ||
const ReplicatedTag & | |||
) |
void GridLayout< Dim >::initialize | ( | const Domain_t & | , |
const Partitioner & | , | ||
const ReplicatedTag & | |||
) |
void GridLayout< Dim >::initialize | ( | const Domain_t & | , |
const Partitioner & | , | ||
const ContextMapper< Dim > & | |||
) |
Domain + partition + mapper initializer.
void GridLayout< Dim >::initialize | ( | const Domain_t & | idom, |
const List_t & | nodes, | ||
const Loc< Dim > & | blocks, | ||
bool | hasIG, | ||
bool | hasEG, | ||
const GuardLayers_t & | ig, | ||
const GuardLayers_t & | eg | ||
) |
Used by the I/O or data management system to initialize the layout based on detailed state information previously stored.
Since this is specialized for the I/O system, no trailing tag is used.
const Loc<Dim>& GridLayout< Dim >::blocks | ( | ) | const [inline] |
Return the number of blocks in each dimension, as a Loc.
Reimplemented from LayoutBase< Dim, GridLayoutData< Dim > >.
bool GridLayout< Dim >::repartition | ( | const Partitioner & | gp, |
const ContextMapper< Dim > & | cm | ||
) | [inline] |
Repartition the layout using a new Partitioner scheme.
The initial domain lists are cleared out, the partitioner is invoked, and then all the observers are notified. This can only be done with a partitioner that generates grid-like blocks.
Reimplemented from LayoutBase< Dim, GridLayoutData< Dim > >.
void GridLayout< Dim >::sync | ( | ) | [inline] |
virtual void GridLayout< Dim >::notify | ( | LayoutData_t & | d, |
const ObserverEvent & | event | ||
) | [inline, virtual] |
Respond to events generated by the LayoutData_t.
These are just passed on to our observers.
Print a GridLayout on an output stream.
Referenced by operator<<().
friend class GridLayoutView [friend] |
friend class GridLayoutData< Dim > [friend] |
GridLayout stores its data in a RefCounted class to simplify memory management.