MapFile.h

Go to the documentation of this file.
00001 /** \file MapFile.h
00002  *  Author: Abhinav S Bhatele
00003  *  Date Created: December 28th, 2006
00004  *
00005  *  This class is used for dumping maps to a file during a program run
00006  *  and also for loading them for use in initial mapping. 
00007  */
00008 
00009 #ifndef _MAPFILE_H_
00010 #define _MAPFILE_H_
00011 
00012 #include "../../include/debug_flags.h"
00013 #include "charm++.h"
00014 #include "cpaimd.h"
00015 #include "MapTable.h"
00016 
00017 class MapFile
00018 {
00019   private:
00020     char* mapName;      // name of the map
00021     int numDim;         // number of dimensions in this map
00022     int* sizeDim;       // array of size numDim, size of each dimension
00023     
00024     int numProcs;       // number of processors
00025     char* mapOrder;     // is the mapping TXYZ or XYZT
00026     int Xmax;
00027     int Ymax;
00028     int Zmax;
00029     int Tmax;
00030     int stride;         // stride for non dense indices NOTE evil
00031                         // hardcoding assuming 4D uses stride in inner
00032                         // 2 indices.  There should be a stride for
00033                         // each index.
00034     
00035   public:
00036     MapFile(char* name, int numpes); 
00037     MapFile(char* name, int num, int* size, int numpes, char *order, int x, int y, int z, int t, int stride=1); 
00038     MapFile();          // default constructor
00039     ~MapFile();         // destructor
00040      
00041     void setSize(int num, int* size); 
00042     void setAttributes(int num, int* size, char *order, int x, int y, int z, int t, int stride);
00043     void dumpMap(MapType2 *map);
00044     void dumpMap(MapType3 *map);
00045     void dumpMap(MapType4 *map);
00046     int loadMap(char *filename, MapType2 *map);
00047     int loadMap(char *filename, MapType3 *map);
00048     int loadMap(char *filename, MapType4 *map);
00049 
00050 };
00051 
00052 #endif
00053 
00054 

Generated on Thu Dec 6 18:25:31 2007 for leanCP by  doxygen 1.5.3