Fixing a corner case where not enough timings are available to perform control point...
[charm.git] / src / ck-cp / API-generator / cp_effects.h
1 #include <string>
2 #include <vector>
3 #include <set>
4 #include <map>
5 #include <utility>
6 #include <charm++.h>
7 #include <ck.h>
8 #include <ckarray.h>
9
10 ///////////////////////////////////////////////////////////////////
11 // WARNING: THIS FILE IS GENERATED BY cp_effects.pl
12 //          ANY CHANGES TO THIS FILE MAY BE LOST 
13 ///////////////////////////////////////////////////////////////////
14
15
16 #ifndef __CP_EFFECTS_H__
17 #define __CP_EFFECTS_H__
18
19 namespace ControlPoint {
20
21   enum DIRECTION {EFF_DEC, EFF_INC};
22
23   class ControlPointAssociation {
24   public:
25     std::set<int> EntryID;
26     std::set<int> ArrayGroupIdx;
27       ControlPointAssociation() {
28         // nothing here yet
29       }
30   };
31   
32   class ControlPointAssociatedEntry : public ControlPointAssociation {
33     public :
34         ControlPointAssociatedEntry() : ControlPointAssociation() {}
35
36         ControlPointAssociatedEntry(int epid) : ControlPointAssociation() {
37           EntryID.insert(epid);
38         }    
39   };
40   
41   class ControlPointAssociatedArray : public ControlPointAssociation {
42   public:
43     ControlPointAssociatedArray() : ControlPointAssociation() {}
44
45     ControlPointAssociatedArray(const CProxy_ArrayBase &a) : ControlPointAssociation() {
46       CkGroupID aid = a.ckGetArrayID();
47       int groupIdx = aid.idx;
48       ArrayGroupIdx.insert(groupIdx);
49     }
50   };
51   
52   class NoControlPointAssociation : public ControlPointAssociation { };
53
54
55   void initControlPointEffects();
56   ControlPointAssociatedEntry assocWithEntry(const int entry);
57   ControlPointAssociatedArray assocWithArray(const CProxy_ArrayBase &array);
58
59  //                 effect               cp                 direction           associations
60   typedef std::map<std::string,std::map<std::string, std::pair<int, std::vector<ControlPoint::ControlPointAssociation> > > > cp_effect_map;
61
62  //                   cp                          direction           associations
63  //  typedef std::map<std::string, std::vector<std::pair<int, ControlPoint::ControlPointAssociation> > > cp_name_map;
64
65
66 namespace EffectIncrease {
67         void Priority(std::string name, const ControlPoint::ControlPointAssociation &a);
68         void Priority(std::string name);
69         void MemoryConsumption(std::string name, const ControlPoint::ControlPointAssociation &a);
70         void MemoryConsumption(std::string name);
71         void GrainSize(std::string name, const ControlPoint::ControlPointAssociation &a);
72         void GrainSize(std::string name);
73         void ComputeDurations(std::string name, const ControlPoint::ControlPointAssociation &a);
74         void ComputeDurations(std::string name);
75         void FlopRate(std::string name, const ControlPoint::ControlPointAssociation &a);
76         void FlopRate(std::string name);
77         void NumComputeObjects(std::string name, const ControlPoint::ControlPointAssociation &a);
78         void NumComputeObjects(std::string name);
79         void NumMessages(std::string name, const ControlPoint::ControlPointAssociation &a);
80         void NumMessages(std::string name);
81         void MessageSizes(std::string name, const ControlPoint::ControlPointAssociation &a);
82         void MessageSizes(std::string name);
83         void MessageOverhead(std::string name, const ControlPoint::ControlPointAssociation &a);
84         void MessageOverhead(std::string name);
85         void UnnecessarySyncronization(std::string name, const ControlPoint::ControlPointAssociation &a);
86         void UnnecessarySyncronization(std::string name);
87         void Concurrency(std::string name, const ControlPoint::ControlPointAssociation &a);
88         void Concurrency(std::string name);
89         void PotentialOverlap(std::string name, const ControlPoint::ControlPointAssociation &a);
90         void PotentialOverlap(std::string name);
91         void LoadBalancingPeriod(std::string name, const ControlPoint::ControlPointAssociation &a);
92         void LoadBalancingPeriod(std::string name);
93         void GPUOffloadedWork(std::string name, const ControlPoint::ControlPointAssociation &a);
94         void GPUOffloadedWork(std::string name);
95
96 }
97
98 namespace EffectDecrease {
99         void Priority(std::string name, const ControlPoint::ControlPointAssociation &a);
100         void Priority(std::string name);
101         void MemoryConsumption(std::string name, const ControlPoint::ControlPointAssociation &a);
102         void MemoryConsumption(std::string name);
103         void GrainSize(std::string name, const ControlPoint::ControlPointAssociation &a);
104         void GrainSize(std::string name);
105         void ComputeDurations(std::string name, const ControlPoint::ControlPointAssociation &a);
106         void ComputeDurations(std::string name);
107         void FlopRate(std::string name, const ControlPoint::ControlPointAssociation &a);
108         void FlopRate(std::string name);
109         void NumComputeObjects(std::string name, const ControlPoint::ControlPointAssociation &a);
110         void NumComputeObjects(std::string name);
111         void NumMessages(std::string name, const ControlPoint::ControlPointAssociation &a);
112         void NumMessages(std::string name);
113         void MessageSizes(std::string name, const ControlPoint::ControlPointAssociation &a);
114         void MessageSizes(std::string name);
115         void MessageOverhead(std::string name, const ControlPoint::ControlPointAssociation &a);
116         void MessageOverhead(std::string name);
117         void UnnecessarySyncronization(std::string name, const ControlPoint::ControlPointAssociation &a);
118         void UnnecessarySyncronization(std::string name);
119         void Concurrency(std::string name, const ControlPoint::ControlPointAssociation &a);
120         void Concurrency(std::string name);
121         void PotentialOverlap(std::string name, const ControlPoint::ControlPointAssociation &a);
122         void PotentialOverlap(std::string name);
123         void LoadBalancingPeriod(std::string name, const ControlPoint::ControlPointAssociation &a);
124         void LoadBalancingPeriod(std::string name);
125         void GPUOffloadedWork(std::string name, const ControlPoint::ControlPointAssociation &a);
126         void GPUOffloadedWork(std::string name);
127
128 }
129
130
131 } //namespace ControlPoint
132
133 CkpvExtern(ControlPoint::cp_effect_map, cp_effects);
134 //CkpvExtern(ControlPoint::cp_name_map, cp_names);
135
136 #endif