1
#ifndef DADFTemplate_h_seen
2
#define DADFTemplate_h_seen
4
/** This is our implementation of DistArrayTemplate. It is kept
5
private within the DistArrayDescriptorFactory. Only
6
DistArrayTemplate is exposed to the outside.
8
$Id: DADFTemplate.h,v 1.1 2003-08-01 00:41:53 manoj Exp $
14
#include "DistArrayTemplate.h"
15
#include "DADFAxisInfo.h"
16
#include "DADFRegionInfo.h"
18
class DADFTemplate : public DistArrayTemplate {
21
/****************************************************************************
22
* Constructors and destructors
23
***************************************************************************/
25
/** Simple constructor for internal use */
28
/** Normal constructor. Forces setting of name. */
29
DADFTemplate( const std::string name ) ;
31
/** Simple copy constructor for internal use */
32
DADFTemplate( DADFTemplate & original );
34
/** Normal copy constructor. Forces setting of name. */
35
DADFTemplate( const std::string name, DADFTemplate & original );
37
/** The usual destructor */
38
virtual ~DADFTemplate();
40
/****************************************************************************
42
***************************************************************************/
44
/** Name associated with this distribution. */
45
virtual int setName(const std::string name);
47
/** Set rank (number of dimensions) of distribution template. */
48
virtual int setRank(const int rank);
50
/** Set the global upper and lower bounds of the array. */
51
virtual int setGlobalBounds(const int lower[], const int upper[]);
53
/** Sets process topology. */
54
virtual int setProcTopology(const int topology[] );
56
/** Sets distribution type on each axis. */
57
virtual int setDistType(const enum DistType dist[] );
59
/** Set distribution parameters for an axis with a regular distributions. */
60
virtual int setDistParameters(int axis, int blockSize,
64
/** Set distribution parameters for a GenBlock axis. */
65
virtual int setGenBlock(int axis, int blockSizes[]);
67
/** Set distribution parameters for an Implicit axis. */
68
virtual int setImplicitMap(int axis, int map[]);
71
/** Add a region to an Explicit distribution. */
72
virtual int addExplicitRegion(int lower[], int upper[]);
74
/** Signal that template is completely defined. */
77
/****************************************************************************
79
***************************************************************************/
81
/** Name associated with this distribution. (default value is "_UNNAMED") */
82
virtual std::string getName();
84
/** Get rank (number of dimensions) of distributed object. */
85
virtual int getRank();
87
/** The global upper and lower bounds of the array. */
88
virtual int getGlobalBounds(int lower[], int upper[]);
90
/** Returns process topology. */
91
virtual int getProcTopology(int topology[] );
93
/** Returns distribution type on each axis. */
94
virtual int getDistType(enum DistType dist[] );
96
/** Get distribution parameters for an axis with a regular distributions. */
97
virtual int getDistParameters(int axis, int blockSize,
100
/** Get distribution parameters for a GenBlock axis. */
101
virtual int getGenBlock(int axis, int blockSizes[]);
103
/** Get distribution parameters for an Implicit axis. */
104
virtual int getImplicitMap(int axis, int map[]);
106
/** Has commit() been called on this template? */
107
virtual bool isDefined();
109
/** Mainly for testing and debugging */
110
virtual void printTemplate();
112
/****************************************************************************
114
***************************************************************************/
116
// Human-readable name for this template
119
// Whether or not commit() has been called
125
/** Caution: it is possible the following (and how they're used)
126
could give rise to overflows for large problems. I'm inclined to
127
think that if the volume is that large, there will be other
128
overflow problems too so this is not important, but I might be
132
// Number of elements
135
// Running total of volume of explicit regions
138
// Global lower bounds of array
139
std::vector<int> _lowerBounds;
141
// Global upper bounds of array
142
std::vector<int> _upperBounds;
145
std::vector<int> _topology;
147
// Distribution types
148
std::vector<enum DistType> _dist;
150
// Per-axis distribution parameters
151
std::vector<DADFAxisInfo *> _axisInfo;
153
// List of regions associated with this process of array
154
std::list<DADFRegionInfo *> _regionList;
156
#endif // DADFTemplate_h_seen