OpenAtom  Version1.5a
MapFile.h
Go to the documentation of this file.
1 /** \file MapFile.h
2  * Author: Abhinav S Bhatele
3  * Date Created: December 28th, 2006
4  *
5  * This class is used for dumping maps to a file during a program run
6  * and also for loading them for use in initial mapping.
7  */
8 
9 #ifndef _MAPFILE_H_
10 #define _MAPFILE_H_
11 
12 #include "../../include/debug_flags.h"
13 #include "charm++.h"
14 #include "load_balance/MapTable.h"
15 
16 class MapFile
17 {
18  private:
19  char* mapName; // name of the map
20  int numDim; // number of dimensions in this map
21  int* sizeDim; // array of size numDim, size of each dimension
22 
23  int numProcs; // number of processors
24  char* mapOrder; // is the mapping TXYZ or XYZT
25  int Xmax;
26  int Ymax;
27  int Zmax;
28  int Tmax;
29  int stride; // stride for non dense indices NOTE evil
30  // hardcoding assuming 4D uses stride in inner
31  // 2 indices. There should be a stride for
32  // each index.
33 
34  public:
35  MapFile(const char* name, int numpes);
36  MapFile(const char* name, int num, int* size, int numpes, const char *order, int x, int y, int z, int t, int stride=1);
37  MapFile(); // default constructor
38  ~MapFile(); // destructor
39 
40  void setSize(int num, int* size);
41  void setAttributes(int num, int* size, char *order, int x, int y, int z, int t, int stride);
42  void dumpMap(MapType2 *map, char c);
43  void dumpMap(MapType3 *map, char c);
44  void dumpMap(MapType4 *map, char c);
45  void dumpMapCoords(MapType2 *map, char c);
46  void dumpMapCoords(MapType3 *map, char c);
47  void dumpMapCoords(MapType4 *map, char c);
48 
49  int loadMap(const char *filename, MapType2 *map);
50  int loadMap(const char *filename, MapType3 *map);
51  int loadMap(const char *filename, MapType4 *map);
52 
53 };
54 
55 #endif
56 
Definition: IntMap.h:26
Author: Eric J Bohm Date Created: June 4th, 2006.