Polaris: DistributeExpr Class Reference

DistributeExpr Class Reference

Distribution Type. More...

#include <DistributeExpr.h>

Inheritance diagram for DistributeExpr:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 DistributeExpr ()
 Constructor for a DistributeExpr with no args.
 DistributeExpr (const DistributeExpr &dist)
 DistributeExpr (Symbol &s)
 Creates a new DistributeExpr object with a shared array name(and its dimension is automatically read).
virtual ~DistributeExpr ()
 Virtual destructor.
virtual void set_distribute (int dim, DISTR_TYPE distr, int weight=0, int block=0)
 Distribution is specified for each dimesion, starting from 1.
virtual DISTR_TYPE distribute_type (int dim) const
 Return distribution type of dimension dim.
virtual Boolean is_defined (int dim) const
 True if any distribution is defined on this dim.
virtual int weight (int dim) const
virtual int block (int dim) const
 Queries of weight and block size for given dimension.
virtual Boolean is_symbol_defined () const
virtual void symbol (const Symbol &s)
virtual const Symbolsymbol () const
virtual Symbolsymbol ()
 Set and Return the shared array symbol.
virtual void dimension (int new_dim)
virtual int dimension () const
 Return the dimension of the shared array.
virtual Boolean is_well_defined () const
 Check if all dimensions are distribution-defined.
virtual void clear ()
 Initialize all distributions.
virtual Expressionclone () const
 Return a copy of myself.
virtual void convert (BinRep &bp, Symtab &sym)
 Read in the values of my fields and my subexpressions from the given BinRep object.
virtual int structures_OK () const
 Return 1 if my structures are in a valid state.
virtual void print (ostream &o) const
 Print out myself.
virtual void print_debug (ostream &o, Boolean debug) const
 debug indicates whether it should contain extra fields
virtual void relink_eptrs (ProgramUnit &p)
 See Expression.h and Expression.cc.

Friends

class ExprTable

Detailed Description

Distribution Type.

Polaris Expression

See also:
Expression/DistributeExpr.h

Expression/DistributeExpr.h

Expression/Expression.cc

Description

A DistributeExpr is exclusively used for a shared array distribution because shared scalars do not need distribution. The distribution has two forms. The typical form is 'w:BLOCK(b)' where 'w' is the weight and 'b' is the block size. Another form is ':', called degenerate distribution. For now, this is customized for Cray T3D programming model, but we believe this class may also be used for the other distributed memory programming models with possible minor change.

Definition at line 45 of file DistributeExpr.h.


Constructor & Destructor Documentation

DistributeExpr::DistributeExpr  ) 
 

Constructor for a DistributeExpr with no args.

... initially the distribution is undefined

Definition at line 7362 of file Expression.cc.

References DISTRIBUTE_OP, make_type(), and VOID_TYPE.

Referenced by clone().

DistributeExpr::DistributeExpr const DistributeExpr dist  ) 
 

... initially the distribution is undefined

Definition at line 7504 of file Expression.cc.

References DISTRIBUTE_OP, make_type(), and VOID_TYPE.

DistributeExpr::DistributeExpr Symbol s  ) 
 

Creates a new DistributeExpr object with a shared array name(and its dimension is automatically read).

... initially the distribution is undefined

Definition at line 7373 of file Expression.cc.

References DISTRIBUTE_OP, make_type(), VARIABLE_CLASS, and VOID_TYPE.

DistributeExpr::~DistributeExpr  )  [inline, virtual]
 

Virtual destructor.

... nothing to do

Definition at line 7499 of file Expression.cc.


Member Function Documentation

void DistributeExpr::set_distribute int  dim,
DISTR_TYPE  distr,
int  weight = 0,
int  block = 0
[virtual]
 

Distribution is specified for each dimesion, starting from 1.

If different distribution types for the same dimension are given, the old is overwitten by the new. For DEGEN_DISTR, weight and block must not given by the caller. For BLOCK_DISTR, only weight must be initialized by the caller. Only for CYCLIC_DISTR, both are initailized to positive numbers by the caller

Definition at line 7403 of file Expression.cc.

References BLOCK_DISTR, CYCLIC_DISTR, and DEGEN_DISTR.

DISTR_TYPE DistributeExpr::distribute_type int  dim  )  const [virtual]
 

Return distribution type of dimension dim.

Definition at line 7429 of file Expression.cc.

References BLOCK_DISTR, CYCLIC_DISTR, and DEGEN_DISTR.

Boolean DistributeExpr::is_defined int  dim  )  const [inline, virtual]
 

True if any distribution is defined on this dim.

Definition at line 134 of file DistributeExpr.h.

References False, and True.

int DistributeExpr::weight int  dim  )  const [inline, virtual]
 

Definition at line 177 of file DistributeExpr.h.

int DistributeExpr::block int  dim  )  const [inline, virtual]
 

Queries of weight and block size for given dimension.

If invalid query is made, it returns meaingless value; for instance, block(dim) for distribute_type(dim)=DEGEN_DISTR.

Definition at line 183 of file DistributeExpr.h.

Boolean DistributeExpr::is_symbol_defined  )  const [inline, virtual]
 

Definition at line 156 of file DistributeExpr.h.

References False, and True.

void DistributeExpr::symbol const Symbol s  )  [virtual]
 

Reimplemented from Expression.

Definition at line 7391 of file Expression.cc.

References VARIABLE_CLASS.

Referenced by _are_vars_in_expr(), _replace_vars_with_omega(), TranslateObject::_translate_symbol_refs_expr(), collect_all_symbols(), get_hash(), IDExpr::IDExpr(), is_var_in_expr(), IDExpr::operator=(), RangeComparator::signz(), substitute_var(), symbol(), and top_sort_expressions().

const Symbol & DistributeExpr::symbol  )  const [inline, virtual]
 

Reimplemented from Expression.

Definition at line 163 of file DistributeExpr.h.

Symbol & DistributeExpr::symbol  )  [inline, virtual]
 

Set and Return the shared array symbol.

Reimplemented from Expression.

Definition at line 170 of file DistributeExpr.h.

void DistributeExpr::dimension int  new_dim  )  [inline, virtual]
 

Definition at line 142 of file DistributeExpr.h.

int DistributeExpr::dimension  )  const [inline, virtual]
 

Return the dimension of the shared array.

The dimension is set automnatically from its Symbol.

Definition at line 148 of file DistributeExpr.h.

Boolean DistributeExpr::is_well_defined  )  const [virtual]
 

Check if all dimensions are distribution-defined.

... Within valid dimensions, must be defined

... Within invalid dimensions, must not defined

Definition at line 7443 of file Expression.cc.

References False, and True.

void DistributeExpr::clear  )  [inline, virtual]
 

Initialize all distributions.

< initially the distribution is undefined

Definition at line 196 of file DistributeExpr.h.

Expression * DistributeExpr::clone  )  const [virtual]
 

Return a copy of myself.

Implements Expression.

Definition at line 7460 of file Expression.cc.

References DistributeExpr().

Referenced by _forward_diff(), _logical_complement(), _max_abs_expr(), _min_abs_expr(), _mult_range_with_expr(), _p_r_o_of_add(), _p_r_o_of_ifix(), _p_r_o_of_min_max(), TranslateObject::_translate_symbol_refs_expr(), eg_range(), eg_range_array_1_to_i(), eg_range_from_input(), UnaryExpr::operator=(), BinaryExpr::operator=(), precalc_func_call(), RangeComparator::signz(), substitute_var(), and test_expr_str().

virtual void DistributeExpr::convert BinRep bp,
Symtab sym
[virtual]
 

Read in the values of my fields and my subexpressions from the given BinRep object.

Convert(BinRep) expects the BinRep to be referencing an expression set of the same type as the expression. On return, all data from the expression set has been inserted into the appropriate fields in the expression object. NOTE that this converts the expression to an intermediate form which may contain TableExpr objects.

Implements Expression.

int DistributeExpr::structures_OK  )  const [inline, virtual]
 

Return 1 if my structures are in a valid state.

Implements Expression.

Definition at line 189 of file DistributeExpr.h.

References True.

void DistributeExpr::print ostream &  o  )  const [virtual]
 

Print out myself.

Reimplemented from Expression.

Definition at line 7466 of file Expression.cc.

References print_debug().

Referenced by operator<<().

virtual void DistributeExpr::print_debug ostream &  o,
Boolean  debug
const [virtual]
 

debug indicates whether it should contain extra fields

Implements Expression.

Referenced by operator<<(), and print().

void DistributeExpr::relink_eptrs ProgramUnit p  )  [virtual]
 

See Expression.h and Expression.cc.

Reimplemented from Expression.

Definition at line 7523 of file Expression.cc.

References Symbol::name_ref().


Friends And Related Function Documentation

friend class ExprTable [friend]
 

Definition at line 46 of file DistributeExpr.h.


The documentation for this class was generated from the following files:
 © 1995-2005 University of Illinois, Urbana-Champaign. All rights reserved.  Fri Mar 25 23:07:13 2005