fixing a debug print
[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 #if CMK_WITH_CONTROLPOINT
20
21 namespace ControlPoint {
22
23   enum DIRECTION {EFF_DEC, EFF_INC};
24
25   class ControlPointAssociation {
26   public:
27     std::set<int> EntryID;
28     std::set<int> ArrayGroupIdx;
29       ControlPointAssociation() {
30         // nothing here yet
31       }
32   };
33   
34   class ControlPointAssociatedEntry : public ControlPointAssociation {
35     public :
36         ControlPointAssociatedEntry() : ControlPointAssociation() {}
37
38         ControlPointAssociatedEntry(int epid) : ControlPointAssociation() {
39           EntryID.insert(epid);
40         }    
41   };
42   
43   class ControlPointAssociatedArray : public ControlPointAssociation {
44   public:
45     ControlPointAssociatedArray() : ControlPointAssociation() {}
46
47     ControlPointAssociatedArray(const CProxy_ArrayBase &a) : ControlPointAssociation() {
48       CkGroupID aid = a.ckGetArrayID();
49       int groupIdx = aid.idx;
50       ArrayGroupIdx.insert(groupIdx);
51     }
52   };
53   
54   class NoControlPointAssociation : public ControlPointAssociation { };
55
56
57   void initControlPointEffects();
58   ControlPointAssociatedEntry assocWithEntry(const int entry);
59   ControlPointAssociatedArray assocWithArray(const CProxy_ArrayBase &array);
60
61  //                 effect               cp                 direction           associations
62   typedef std::map<std::string,std::map<std::string, std::pair<int, std::vector<ControlPoint::ControlPointAssociation> > > > cp_effect_map;
63
64  //                   cp                          direction           associations
65  //  typedef std::map<std::string, std::vector<std::pair<int, ControlPoint::ControlPointAssociation> > > cp_name_map;
66
67
68 namespace EffectIncrease {
69         void Priority(std::string name, const ControlPoint::ControlPointAssociation &a);
70         void Priority(std::string name);
71         void MemoryConsumption(std::string name, const ControlPoint::ControlPointAssociation &a);
72         void MemoryConsumption(std::string name);
73         void GrainSize(std::string name, const ControlPoint::ControlPointAssociation &a);
74         void GrainSize(std::string name);
75         void ComputeDurations(std::string name, const ControlPoint::ControlPointAssociation &a);
76         void ComputeDurations(std::string name);
77         void FlopRate(std::string name, const ControlPoint::ControlPointAssociation &a);
78         void FlopRate(std::string name);
79         void NumComputeObjects(std::string name, const ControlPoint::ControlPointAssociation &a);
80         void NumComputeObjects(std::string name);
81         void NumMessages(std::string name, const ControlPoint::ControlPointAssociation &a);
82         void NumMessages(std::string name);
83         void MessageSizes(std::string name, const ControlPoint::ControlPointAssociation &a);
84         void MessageSizes(std::string name);
85         void MessageOverhead(std::string name, const ControlPoint::ControlPointAssociation &a);
86         void MessageOverhead(std::string name);
87         void UnnecessarySyncronization(std::string name, const ControlPoint::ControlPointAssociation &a);
88         void UnnecessarySyncronization(std::string name);
89         void Concurrency(std::string name, const ControlPoint::ControlPointAssociation &a);
90         void Concurrency(std::string name);
91         void PotentialOverlap(std::string name, const ControlPoint::ControlPointAssociation &a);
92         void PotentialOverlap(std::string name);
93         void LoadBalancingPeriod(std::string name, const ControlPoint::ControlPointAssociation &a);
94         void LoadBalancingPeriod(std::string name);
95         void GPUOffloadedWork(std::string name, const ControlPoint::ControlPointAssociation &a);
96         void GPUOffloadedWork(std::string name);
97
98 }
99
100 namespace EffectDecrease {
101         void Priority(std::string name, const ControlPoint::ControlPointAssociation &a);
102         void Priority(std::string name);
103         void MemoryConsumption(std::string name, const ControlPoint::ControlPointAssociation &a);
104         void MemoryConsumption(std::string name);
105         void GrainSize(std::string name, const ControlPoint::ControlPointAssociation &a);
106         void GrainSize(std::string name);
107         void ComputeDurations(std::string name, const ControlPoint::ControlPointAssociation &a);
108         void ComputeDurations(std::string name);
109         void FlopRate(std::string name, const ControlPoint::ControlPointAssociation &a);
110         void FlopRate(std::string name);
111         void NumComputeObjects(std::string name, const ControlPoint::ControlPointAssociation &a);
112         void NumComputeObjects(std::string name);
113         void NumMessages(std::string name, const ControlPoint::ControlPointAssociation &a);
114         void NumMessages(std::string name);
115         void MessageSizes(std::string name, const ControlPoint::ControlPointAssociation &a);
116         void MessageSizes(std::string name);
117         void MessageOverhead(std::string name, const ControlPoint::ControlPointAssociation &a);
118         void MessageOverhead(std::string name);
119         void UnnecessarySyncronization(std::string name, const ControlPoint::ControlPointAssociation &a);
120         void UnnecessarySyncronization(std::string name);
121         void Concurrency(std::string name, const ControlPoint::ControlPointAssociation &a);
122         void Concurrency(std::string name);
123         void PotentialOverlap(std::string name, const ControlPoint::ControlPointAssociation &a);
124         void PotentialOverlap(std::string name);
125         void LoadBalancingPeriod(std::string name, const ControlPoint::ControlPointAssociation &a);
126         void LoadBalancingPeriod(std::string name);
127         void GPUOffloadedWork(std::string name, const ControlPoint::ControlPointAssociation &a);
128         void GPUOffloadedWork(std::string name);
129
130 }
131
132
133 } //namespace ControlPoint
134
135 CkpvExtern(ControlPoint::cp_effect_map, cp_effects);
136 //CkpvExtern(ControlPoint::cp_name_map, cp_names);
137
138 #endif
139 #endif