A simple chare initialization test program.
authorEric Bohm <ebohm@illinois.edu>
Mon, 24 Sep 2007 21:41:22 +0000 (21:41 +0000)
committerEric Bohm <ebohm@illinois.edu>
Mon, 24 Sep 2007 21:41:22 +0000 (21:41 +0000)
tests/charm++/startupTest/Makefile [new file with mode: 0644]
tests/charm++/startupTest/README [new file with mode: 0644]
tests/charm++/startupTest/startupTest.C [new file with mode: 0644]
tests/charm++/startupTest/startupTest.ci [new file with mode: 0644]
tests/charm++/startupTest/startupTest.h [new file with mode: 0644]

diff --git a/tests/charm++/startupTest/Makefile b/tests/charm++/startupTest/Makefile
new file mode 100644 (file)
index 0000000..13e34fa
--- /dev/null
@@ -0,0 +1,26 @@
+CHARMC=../../../bin/charmc $(OPTS) $(MOPTS) 
+#CHARMC=$(HOME)/charm/bin/charmc $(OPTS) $(MOPTS) 
+
+
+OBJS = startupTest.o
+
+
+all: startupTest
+
+startupTest: $(OBJS)
+       $(CHARMC) -language charm++ -o startupTest $(OBJS)
+
+startupTest.decl.h: startupTest.ci
+       $(CHARMC)  startupTest.ci
+
+clean:
+       rm -f *.decl.h *.def.h conv-host *.o startupTest charmrun *.log *.sum *.sts
+
+startupTest.o: startupTest.C startupTest.decl.h startupTest.h
+       $(CHARMC) -c startupTest.C
+
+test: all
+       ./charmrun ./startupTest 20 0.01 1 
+
+bgtest: all
+       ./charmrun ./startupTest 20 0.01 1 +p4 +x2 +y2 +z2
diff --git a/tests/charm++/startupTest/README b/tests/charm++/startupTest/README
new file mode 100644 (file)
index 0000000..7062ab0
--- /dev/null
@@ -0,0 +1,24 @@
+Test initialization order.
+
+Readonly variables before Groups and Arrays.
+
+Groups before Arrays.
+
+Boundto arrays are constructed before their shadows in bound arrays.
+
+Groups are constructed in group ID order.
+
+Arrays constructed in array ID order.
+
+Arguments: arrSize WasteUnits validateBoundOrder
+ Where:
+        arrsize       : representing the number of array elements per array
+        wasteunit     : >0.0 representing cputime to waste when doing work
+        validate      : is 1 or 0 to enable testing of construction order in bound arrays
+
+ Typically: startupTest 100 0.001 1
+
+
+
+
+       
diff --git a/tests/charm++/startupTest/startupTest.C b/tests/charm++/startupTest/startupTest.C
new file mode 100644 (file)
index 0000000..acfc297
--- /dev/null
@@ -0,0 +1,264 @@
+#include "charm++.h"
+#include "startupTest.decl.h"
+#include <stdio.h>
+#include <math.h>
+
+#include "startupTest.h"
+
+int intOne;
+int arrSize;
+double dOne;
+double dTwo;
+double WasteUnits;
+       
+CkVec <int> IntArrOne;
+CkVec <int> IntArrTwo;
+CkVec <int> IntArrThree;
+CkVec <int> IntArrFour;
+CkVec <int> IntArrFive;
+CkHashtableT<intdual, int> mapSix;
+CkVec<CProxy_groupTest> groupProxy;
+CProxy_main mainProxy;         
+CProxy_ReadArrZero zeroProxy;          
+CProxy_ReadArrOne oneProxy;            
+CProxy_ReadArrTwo twoProxy;            
+CProxy_ReadArrThree threeProxy;                
+CProxy_ReadArrFour fourProxy;          
+CProxy_ReadArrFive fiveProxy;          
+CProxy_ReadArrSix sixProxy;            
+CProxy_ReadArrSeven sevenProxy;                
+
+
+main::main(CkArgMsg *msg)
+{
+  int reported;
+  int validateBoundOrder=0;
+  if(msg->argc<4)
+    CkAbort("Usage: startupTest arrSize WasteUnits validateBoundOrder\n Where arrsize is int >0 wasteunit is double >0 validateBoundOrder is 1 or 0\n");
+  //get arrsize and wastetime from cmd line
+  arrSize=atoi(msg->argv[1]);
+  sscanf(msg->argv[2],"%lg",&WasteUnits);
+  validateBoundOrder=atoi(msg->argv[3]);
+  mainProxy=thishandle;
+  doneCount=0;
+  //init readonly values
+  CkPrintf("Nodes %d Cpus %d Using %d from %s %g from %s\n",CkNumNodes(), CkNumPes(),arrSize,msg->argv[1],WasteUnits, msg->argv[2]);
+  intOne=1;
+  dOne=1.0;
+  dTwo=2.0;
+  for(int i=0;i<arrSize;i++)
+    {
+      IntArrOne.push_back(i);
+      IntArrTwo.push_back(i);
+      IntArrThree.push_back(i);
+      IntArrFour.push_back(i);
+      IntArrFive.push_back(i);
+    }
+  for(int i=0;i<arrSize;i++)
+    {
+      groupProxy.push_back(CProxy_groupTest::ckNew(i));
+    }
+  //create zero by default map
+  zeroProxy  = CProxy_ReadArrZero::ckNew();  
+  for(int i=0;i<arrSize;i++)
+    zeroProxy(i).insert(arrSize, WasteUnits);
+  zeroProxy.doneInserting();
+  //create one-five by map then array
+  CProxy_OneMap oneMap = CProxy_OneMap::ckNew(WasteUnits);
+  CkArrayOptions arrOpts;
+  arrOpts.setMap(oneMap);
+  oneProxy  = CProxy_ReadArrOne::ckNew(arrSize, WasteUnits, arrOpts);  
+  for(int i=0;i<arrSize;i++)
+    oneProxy(i).insert(arrSize, WasteUnits);
+  oneProxy.doneInserting();
+
+  CProxy_TwoMap twoMap = CProxy_TwoMap::ckNew(WasteUnits);
+  arrOpts.setMap(twoMap);
+  twoProxy  = CProxy_ReadArrTwo::ckNew(arrSize, WasteUnits,arrOpts);  
+  for(int i=0;i<arrSize;i++)
+    twoProxy(i).insert(arrSize, WasteUnits);
+  twoProxy.doneInserting();
+
+  CProxy_ThreeMap threeMap = CProxy_ThreeMap::ckNew(WasteUnits);
+  arrOpts.setMap(threeMap);
+  threeProxy  = CProxy_ReadArrThree::ckNew(arrSize, WasteUnits, arrOpts);  
+  for(int i=0;i<arrSize;i++)
+    threeProxy(i).insert(arrSize, WasteUnits);
+  threeProxy.doneInserting();
+
+  // make 4 new style
+  CkArrayOptions arrOptsBulk(arrSize);
+  CProxy_FourMap fourMap = CProxy_FourMap::ckNew(WasteUnits);
+  arrOptsBulk.setMap(fourMap);
+  fourProxy  = CProxy_ReadArrFour::ckNew(arrSize,WasteUnits,arrOptsBulk);  
+  /*  for(int i=0;i<arrSize;i++)
+      fourProxy(i).insert(arrSize, WasteUnits);*/
+  fourProxy.doneInserting();
+
+  // make 5 a shadow of 4
+  CkArrayOptions arrOptsBind4(arrSize);
+  arrOptsBind4.bindTo(fourProxy);
+  fiveProxy  = CProxy_ReadArrFive::ckNew(arrSize, WasteUnits, validateBoundOrder,arrOptsBind4);  
+  //  for(int i=0;i<arrSize;i++)
+  //    fiveProxy(i).insert(arrSize, WasteUnits);
+  fiveProxy.doneInserting();
+
+
+  //#define SIX_INSERT
+#ifdef SIX_INSERT
+  // if you make six this way it may lose the race with seven 
+  CProxy_SixMap sixMap = CProxy_SixMap::ckNew(WasteUnits);
+  arrOpts.setMap(sixMap);
+  sixProxy  = CProxy_ReadArrSix::ckNew(arrSize, WasteUnits, arrOpts);  
+  for(int i=0;i<arrSize;i++)
+    for(int j=0;j<arrSize;j++)
+      sixProxy(i,j).insert(arrSize, WasteUnits);
+  sixProxy.doneInserting();
+#else
+  // bulk build six
+  CkArrayOptions arrOptsSix(arrSize,arrSize);
+  CProxy_SixMap sixMap = CProxy_SixMap::ckNew(WasteUnits);
+  arrOptsSix.setMap(sixMap);
+  sixProxy  = CProxy_ReadArrSix::ckNew(arrSize, WasteUnits, arrOptsSix);  
+  sixProxy.doneInserting();
+
+#endif
+
+  // make seven a shadow of six
+  //#define SEVEN_INSERT
+#ifdef SEVEN_INSERT
+
+  CkArrayOptions arrOptsBind6;
+  arrOptsBind6.bindTo(sixProxy);
+  sevenProxy  = CProxy_ReadArrSeven::ckNew(arrSize, WasteUnits, validateBoundOrder,arrOptsBind6);  
+  for(int i=0;i<arrSize;i++)
+    for(int j=0;j<arrSize;j++)
+      sevenProxy(i,j).insert(arrSize, WasteUnits,validateBoundOrder);
+  sevenProxy.doneInserting();
+
+#else
+
+  CkArrayOptions arrOptsBind6(arrSize,arrSize);
+  arrOptsBind6.bindTo(sixProxy);
+  sevenProxy  = CProxy_ReadArrSeven::ckNew(arrSize, WasteUnits, validateBoundOrder,arrOptsBind6);  
+  sevenProxy.doneInserting();
+#endif  
+
+  CheckAllReadOnly();
+  CkPrintf("Setup Complete for arrSize %d WasteUnits %g\n",arrSize, WasteUnits);
+  zeroProxy.dowork(); 
+  oneProxy.dowork(); 
+  twoProxy.dowork(); 
+  threeProxy.dowork(); 
+  fourProxy.dowork(); 
+  fiveProxy.dowork(); 
+  sixProxy.dowork(); 
+  sevenProxy.dowork(); 
+};
+
+void main::createReport(CkReductionMsg *msg)
+{
+  //  int count=((int *) msg->getData())[0];
+  int array=(int) msg->getUserFlag();
+  delete msg;
+  CkPrintf("Create Report for %d\n",array);
+  /*
+  switch (array){
+
+  case 0 :  zeroProxy.dowork(); break;
+  case 1 :  oneProxy.dowork(); break;
+  case 2 :  twoProxy.dowork(); break;
+  case 3 :  threeProxy.dowork(); break;
+  case 4 :  fourProxy.dowork(); break;
+  case 5 :  fiveProxy.dowork(); break;
+  default: CkAbort("impossible user flag"); break;
+  }
+  */
+};
+
+void main::doneReport(CkReductionMsg *msg)
+{
+  //  int count=(int) msg->getData()[0];
+  int array=(int) msg->getUserFlag();
+  delete msg;
+  CkPrintf("Done Report for %d\n",array);  
+  doneCount++;
+  if(doneCount==8)
+    {
+      CkPrintf("All Done %d\n",doneCount);  
+      CkExit();
+    }
+};
+
+int OneMap::procNum(int hdl, const CkArrayIndex &idx)
+{
+  CkArrayIndex1D idx1d = *(CkArrayIndex1D *) &idx;
+  return(IntArrOne[idx1d.index]%CkNumPes());
+};
+
+int TwoMap::procNum(int hdl, const CkArrayIndex &idx)
+{
+  CkArrayIndex1D idx1d = *(CkArrayIndex1D *) &idx;
+  return(IntArrTwo[idx1d.index]%CkNumPes());
+};
+
+int ThreeMap::procNum(int hdl, const CkArrayIndex &idx)
+{
+  CkArrayIndex1D idx1d = *(CkArrayIndex1D *) &idx;
+  return(IntArrThree[idx1d.index]%CkNumPes());
+};
+
+int FourMap::procNum(int hdl, const CkArrayIndex &idx)
+{
+  CkArrayIndex1D idx1d = *(CkArrayIndex1D *) &idx;
+  return(IntArrFour[idx1d.index]%CkNumPes());
+};
+
+int FiveMap::procNum(int hdl, const CkArrayIndex &idx)
+{
+  CkArrayIndex1D idx1d = *(CkArrayIndex1D *) &idx;
+  int retval=IntArrFive[idx1d.index]%CkNumPes();
+  //  CkPrintf("procnum five %d %d\n",idx1d.index,retval);
+  return(retval);
+};
+
+
+int SixMap::procNum(int hdl, const CkArrayIndex &idx)
+{
+  CkArrayIndex2D idx2d = *(CkArrayIndex2D *) &idx;
+  int retval=(idx2d.index[0]+idx2d.index[1])%CkNumPes();
+  //  CkPrintf("procnum Six %d %d %d\n",idx2d.index[0],idx2d.index[1],retval);
+  return(retval);
+};
+
+
+
+void WasteTime(double howmuch)
+{
+  double start = CmiWallTimer();
+  while (CmiWallTimer() - start < howmuch) ;
+  
+};
+
+
+bool CheckAllReadOnly()
+{
+
+  CkAssert(intOne==1);
+  CkAssert(dOne==1.0);
+  CkAssert(dTwo==2.0);
+  CkAssert(arrSize>0);
+  for(int i=0;i<arrSize;i++)
+    {
+      CkAssert(IntArrOne[i]==i);
+      CkAssert(IntArrTwo[i]==i);
+      CkAssert(IntArrThree[i]==i);
+      CkAssert(IntArrFour[i]==i);
+      CkAssert(IntArrFive[i]==i);
+    }
+  return(true);
+};
+
+
+
+#include "startupTest.def.h"
diff --git a/tests/charm++/startupTest/startupTest.ci b/tests/charm++/startupTest/startupTest.ci
new file mode 100644 (file)
index 0000000..a910712
--- /dev/null
@@ -0,0 +1,99 @@
+mainmodule startupTest {
+
+  readonly int arrSize;
+  readonly int intOne;
+  readonly double dOne;
+  readonly double dTwo;
+  readonly double WasteUnits;
+       
+  readonly CkVec<int> IntArrOne;
+  readonly CkVec<int> IntArrTwo;
+  readonly CkVec<int> IntArrThree;
+  readonly CkVec<int> IntArrFour;
+  readonly CkVec<int> IntArrFive;
+  readonly CkVec<CProxy_groupTest> groupProxy;
+  readonly CkHashtableT<intdual, int> mapSix;
+
+
+  readonly CProxy_main mainProxy;              
+  readonly CProxy_ReadArrZero zeroProxy;               
+  readonly CProxy_ReadArrOne oneProxy;         
+  readonly CProxy_ReadArrTwo twoProxy;         
+  readonly CProxy_ReadArrThree threeProxy;             
+  readonly CProxy_ReadArrFour fourProxy;               
+  readonly CProxy_ReadArrFive fiveProxy;               
+  readonly CProxy_ReadArrSix sixProxy;         
+  readonly CProxy_ReadArrSeven sevenProxy;             
+
+  mainchare main {
+    entry main(CkArgMsg *m);
+    entry void createReport(CkReductionMsg *msg);      
+    entry void doneReport(CkReductionMsg *msg);        
+  };
+
+  group groupTest {
+    entry groupTest(int);
+  }    
+
+  array [1D] ReadArrZero {
+    entry ReadArrZero(int, double);
+    entry void dowork(void);   
+  };           
+
+  array [1D] ReadArrOne {
+    entry ReadArrOne(int, double);
+    entry void dowork(void);   
+  };           
+
+  array [1D] ReadArrTwo {
+    entry ReadArrTwo(int, double);
+    entry void dowork(void);   
+  };           
+
+  array [1D] ReadArrThree {
+    entry ReadArrThree(int, double);
+    entry void dowork(void);   
+  };           
+
+  array [1D] ReadArrFour {
+    entry ReadArrFour(int, double);
+    entry void dowork(void);   
+  };           
+
+  array [1D] ReadArrFive {
+    entry ReadArrFive(int, double, bool);
+    entry void dowork(void);   
+  };           
+
+  array [2D] ReadArrSix {
+    entry ReadArrSix(int, double);
+    entry void dowork(void);   
+  };           
+
+  array [2D] ReadArrSeven {
+    entry ReadArrSeven(int, double, bool);
+    entry void dowork(void);   
+  };           
+
+       
+  group OneMap : CkArrayMap {
+       entry OneMap(double);
+  };
+
+  group TwoMap : CkArrayMap {
+       entry TwoMap(double);
+  };
+  group ThreeMap : CkArrayMap {
+       entry ThreeMap(double);
+  };
+  group FourMap : CkArrayMap {
+       entry FourMap(double);
+  };
+  group FiveMap : CkArrayMap {
+       entry FiveMap(double);
+  };
+
+  group SixMap : CkArrayMap {
+       entry SixMap(double);
+  };
+};
diff --git a/tests/charm++/startupTest/startupTest.h b/tests/charm++/startupTest/startupTest.h
new file mode 100644 (file)
index 0000000..a15492a
--- /dev/null
@@ -0,0 +1,375 @@
+extern double WasteUnits;
+extern CProxy_main mainProxy;
+extern CProxy_ReadArrFour fourProxy;           
+extern CProxy_ReadArrSix sixProxy;             
+extern double dOne;
+extern double dTwo;
+extern CkVec<int> IntArrFour;
+extern CkVec<int> IntArrFive;
+extern CkVec<CProxy_groupTest> groupProxy;
+
+bool CheckAllReadOnly();
+void WasteTime(double);
+class intdual {
+ private:
+    int x, y;
+ public:
+    intdual(){x=y=0;}
+
+    intdual(int _x,int _y) : x(_x), y(_y){}
+    void pup(PUP::er &p)
+      {
+         p|x;
+         p|y;
+      }
+    inline int getx(){return x;};
+    inline int gety(){return y;};
+    inline CkHashCode hash() const {
+       return (CkHashCode)((x<<10)+y);
+    }
+    static CkHashCode staticHash(const void *k,size_t){
+       return ((intdual *)k)->hash();
+    }
+    inline int compare(intdual &t) const{
+       return (t.getx() == x && t.gety() == y);
+    }
+    static int staticCompare(const void *a,const void *b,size_t){
+       return ((intdual *)a)->compare((*(intdual *)b));
+    }
+   
+};
+
+
+class main : public CBase_main
+{
+ public:
+  int doneCount;
+  main(CkArgMsg *msg);
+  void createReport(CkReductionMsg *msg);
+  void doneReport(CkReductionMsg *msg);
+};
+
+class groupTest : public Group
+{
+ public:
+  int order;
+  groupTest(int order): order(order) 
+    {
+      // test that all lower order ids were created first
+      for(int i=order-1;i>0;i--)
+       {
+         //make a proxy
+         //get a branch
+         //test the order value in it
+         //      CkPrintf("[%d] test group id %d looking at %d\n",CkMyPe(),order,i);
+         CkAssert(groupProxy[i].ckLocalBranch()->order==i);
+
+       }
+    }
+};
+
+class ReadArrZero : public CBase_ReadArrZero
+{
+ private:
+ public:
+  int size;
+  double units;
+  
+  ReadArrZero(int arrSize, double WasteUnits) :size(arrSize), units(WasteUnits)
+    {
+      int a=1;
+      contribute(sizeof(int),&a,CkReduction::sum_int,CkCallback(CkIndex_main::createReport(NULL),mainProxy),0);
+    }
+
+  ReadArrZero()
+    {
+    }
+
+  ReadArrZero(CkMigrateMessage *m) {};
+
+  
+  void dowork()
+  {
+    WasteTime(WasteUnits);
+    int a=1;
+    contribute(sizeof(int),&a,CkReduction::sum_int,CkCallback(CkIndex_main::doneReport(NULL),mainProxy),0);
+  }
+
+};
+
+class ReadArrOne : public CBase_ReadArrOne
+{
+ private:
+ public:
+  int size;
+  double units;
+  
+  
+  ReadArrOne(int arrSize, double WasteUnits) :size(arrSize), units(WasteUnits) 
+    {
+      int a=1;
+      contribute(sizeof(int),&a,CkReduction::sum_int,CkCallback(CkIndex_main::createReport(NULL),mainProxy),1);
+    }
+
+  ReadArrOne(CkMigrateMessage *m) {};
+  
+  void dowork(){
+    WasteTime(WasteUnits);
+    int a=1;
+    contribute(sizeof(int),&a,CkReduction::sum_int,CkCallback(CkIndex_main::doneReport(NULL),mainProxy),1);
+  }
+
+};
+
+class ReadArrTwo : public CBase_ReadArrTwo
+{
+ private:
+ public:
+  int size;
+  double units;
+  
+
+  ReadArrTwo(int arrSize, double WasteUnits) :size(arrSize), units(WasteUnits) 
+    {
+      int a=1;
+      contribute(sizeof(int),&a,CkReduction::sum_int,CkCallback(CkIndex_main::createReport(NULL),mainProxy),2);
+    }
+
+  ReadArrTwo(CkMigrateMessage *m) {};
+
+  
+  void dowork(){
+    WasteTime(WasteUnits);
+    int a=1;
+    contribute(sizeof(int),&a,CkReduction::sum_int,CkCallback(CkIndex_main::doneReport(NULL),mainProxy),2);
+  }
+
+
+};
+
+class ReadArrThree : public CBase_ReadArrThree
+{
+ private:
+ public:
+  int size;
+  double units;
+  
+  ReadArrThree(int arrSize, double WasteUnits) :size(arrSize), units(WasteUnits) 
+    {
+      int a=1;
+      if(CkMyPe()%2)
+       WasteTime(WasteUnits);
+      contribute(sizeof(int),&a,CkReduction::sum_int,CkCallback(CkIndex_main::createReport(NULL),mainProxy),3);
+    }
+
+  ReadArrThree(CkMigrateMessage *m) {};
+  
+  void dowork(){
+    WasteTime(WasteUnits);
+    int a=1;
+    contribute(sizeof(int),&a,CkReduction::sum_int,CkCallback(CkIndex_main::doneReport(NULL),mainProxy),3);
+  }
+
+
+  
+};
+
+class ReadArrFour : public CBase_ReadArrFour
+{
+ private:
+ public:
+  int size;
+  double units;
+  int *data;
+
+  
+  ReadArrFour(int arrSize, double WasteUnits) :size(arrSize), units(WasteUnits) 
+    {
+      int a=1;
+      data=new int[arrSize];
+      memcpy(data,&(IntArrFour[0]),sizeof(int)*arrSize);
+      contribute(sizeof(int),&a,CkReduction::sum_int,CkCallback(CkIndex_main::createReport(NULL),mainProxy),4);
+    }
+
+  ReadArrFour(CkMigrateMessage *m) {};
+
+  
+  void dowork()
+  {
+    WasteTime(WasteUnits);
+    int a=1;
+    contribute(sizeof(int),&a,CkReduction::sum_int,CkCallback(CkIndex_main::doneReport(NULL),mainProxy),4);
+  }
+
+
+  
+};
+
+class ReadArrFive : public CBase_ReadArrFive
+{
+ private:
+  int *data;
+ public:
+  int size;
+  double units;
+  bool validate; 
+
+  ReadArrFive(int arrSize, double WasteUnits, bool validate) :size(arrSize), units(WasteUnits), validate(validate) 
+    {
+      int a=1;
+      // we shadow four, use its data member
+      if(validate)
+       {
+         data=fourProxy(thisIndex).ckLocal()->data;
+         CkAssert(data!=NULL);
+         for(int i=0;i<arrSize;i++)
+           CkAssert(data[i]==i);
+       }
+      contribute(sizeof(int),&a,CkReduction::sum_int,CkCallback(CkIndex_main::createReport(NULL),mainProxy),5);
+    }
+  
+  ReadArrFive(CkMigrateMessage *m) {};
+
+  void dowork(){
+    WasteTime(WasteUnits);
+    int a=1;
+    contribute(sizeof(int),&a,CkReduction::sum_int,CkCallback(CkIndex_main::doneReport(NULL),mainProxy),5);
+  }
+
+};
+
+
+class ReadArrSix : public CBase_ReadArrSix
+{
+ private:
+ public:
+  int *data;
+  int size;
+  double units;
+  
+  ReadArrSix(int arrSize, double WasteUnits) :size(arrSize), units(WasteUnits) 
+    {
+      int a=1;
+      data=new int[arrSize];
+      memcpy(data,&(IntArrFive[0]),sizeof(int)*arrSize);
+      contribute(sizeof(int),&a,CkReduction::sum_int,CkCallback(CkIndex_main::createReport(NULL),mainProxy),6);
+    }
+  
+  ReadArrSix(CkMigrateMessage *m) {};
+
+  void dowork(){
+    WasteTime(WasteUnits);
+    int a=1;
+    contribute(sizeof(int),&a,CkReduction::sum_int,CkCallback(CkIndex_main::doneReport(NULL),mainProxy),6);
+  }
+
+};
+
+class ReadArrSeven : public CBase_ReadArrSeven
+{
+ private:
+ public:
+  int *data;
+  int size;
+  double units;
+  bool validate;
+  
+  ReadArrSeven(int arrSize, double WasteUnits, bool validate) :size(arrSize), units(WasteUnits), validate(validate) 
+    {
+      int a=1;
+      // we shadow six, use its data member
+      if(validate)
+       {
+         data=sixProxy(thisIndex.x,thisIndex.y).ckLocal()->data;
+         CkAssert(data!=NULL);
+         bool pass=true;
+         for(int i=0;i<arrSize;i++)
+           if(data[i]!=i)
+             {
+               CkPrintf("[%d,%d] i %d != data[%d]\n",thisIndex.x, thisIndex.y,i,data[i]);
+               pass=false;
+             }
+         CkAssert(pass);
+       }
+
+      contribute(sizeof(int),&a,CkReduction::sum_int,CkCallback(CkIndex_main::createReport(NULL),mainProxy),7);
+    }
+  
+  ReadArrSeven(CkMigrateMessage *m) {};
+
+  void dowork(){
+    WasteTime(WasteUnits);
+    int a=1;
+    contribute(sizeof(int),&a,CkReduction::sum_int,CkCallback(CkIndex_main::doneReport(NULL),mainProxy),7);
+  }
+
+};
+
+
+
+class OneMap: public CkArrayMap { 
+ public:
+  double howmuch;
+  OneMap(double _howmuch): howmuch(_howmuch)
+    {
+      CheckAllReadOnly();
+      WasteTime(howmuch);
+    }
+  int procNum(int, const CkArrayIndex &);
+};
+
+class TwoMap: public CkArrayMap { 
+ public:
+  double howmuch;
+  TwoMap(double _howmuch): howmuch(_howmuch)
+    {
+      CheckAllReadOnly();
+      WasteTime(howmuch);
+    }
+    int procNum(int, const CkArrayIndex &);
+};
+
+class ThreeMap: public CkArrayMap { 
+ public:
+  double howmuch;
+  ThreeMap(double _howmuch) : howmuch(_howmuch)
+    {
+      CheckAllReadOnly();
+      WasteTime(howmuch);
+    }
+    int procNum(int, const CkArrayIndex &);
+};
+
+class FourMap: public CkArrayMap { 
+ public:
+  double howmuch;
+  FourMap(double _howmuch) : howmuch(_howmuch)
+    {
+      CheckAllReadOnly();
+      WasteTime(howmuch);
+    }
+    int procNum(int, const CkArrayIndex &);
+};
+
+class FiveMap: public CkArrayMap { 
+ public:
+  double howmuch;
+  FiveMap(double _howmuch) : howmuch(_howmuch)
+    {
+      CheckAllReadOnly();
+      WasteTime(howmuch);
+    }
+    int procNum(int, const CkArrayIndex &);
+};
+
+
+class SixMap: public CkArrayMap { 
+ public:
+  double howmuch;
+  SixMap(double _howmuch) : howmuch(_howmuch)
+    {
+      CheckAllReadOnly();
+      WasteTime(howmuch);
+    }
+  int procNum(int, const CkArrayIndex &);
+};