Cartesian Class Reference
[PEARL.base]

Stores information related to cartesian grid topologies. More...

#include <Cartesian.h>

Inheritance diagram for Cartesian:

Topology IdObject MpiCartesian

List of all members.

Public Types

typedef std::vector< uint32_t > cart_dims
 Container type for topology dimensions.
typedef std::vector< bool > cart_period
 Container type for topology periodicity.
typedef std::vector< uint32_t > cart_coords

Public Member Functions

Constructors & destructor
 Cartesian (ident_t id, const cart_dims &num_locations, const cart_period &is_periodic)
Get & set cartesian topology information
uint32_t num_dimensions () const
void get_dimensionv (cart_dims &outv) const
void get_periodv (cart_period &outv) const
void get_coords (Location *location, cart_coords &coords) const
void set_coords (Location *location, const cart_coords &coords)


Detailed Description

The class Cartesian provides information related to virtual cartesian grid topologies. These grids can have arbitrary dimensions. In addition, each dimension can be periodic or not (e.g., to define a torus topology).

Constructor & Destructor Documentation

Cartesian ( ident_t  id,
const cart_dims num_locations,
const cart_period is_periodic 
)

Creates a new instance and sets data to the given values.

Parameters:
id Topology identifier
num_locations Contains the number of locations in each dimension
is_periodic Contains boolean values defining whether the corresponding dimension is periodic or not


Member Function Documentation

void get_coords ( Location location,
cart_coords &  coords 
) const

Stores the coordinate of the given location in the vector coords.

Parameters:
location Location in the system hierarchy
[out] coords Coordinate of the given location
Exceptions:
RuntimeError if the given location is not part of this topology

void get_dimensionv ( cart_dims outv  )  const

Stores the number of locations in each dimension in the given vector outv.

Parameters:
[out] outv Number of locations per dimension

void get_periodv ( cart_period outv  )  const

Stores the periodicity of each dimension in the given vector outv.

Parameters:
[out] outv Periodicity per dimension

uint32_t num_dimensions (  )  const

Returns the number of dimensions of the cartesian grid.

Returns:
Number of dimensions

void set_coords ( Location location,
const cart_coords &  coords 
)

Assigns the coordinate coords to the given location.

Parameters:
location Location in the system hierarchy
coords Coordinate of the given location
Exceptions:
RuntimeError if one of the following conditions is met:
  • The number of dimensions of the coordinate and the cartesian topology do not match.
  • The coordinate is out of bounds.
  • The location coordinate is already defined.


SCALASCA    Copyright © 1998–2009 Forschungszentrum Jülich, Jülich Supercomputing Centre