00001
00002
00003
00005
00006 #include "cp_effects.h"
00007
00008 #if CMK_WITH_CONTROLPOINT
00009
00010 using namespace ControlPoint;
00011 using namespace std;
00012
00013 CkpvDeclare(ControlPoint::cp_effect_map, cp_effects);
00014
00015
00016 NoControlPointAssociation default_assoc;
00017
00018 ControlPoint::ControlPointAssociatedEntry ControlPoint::assocWithEntry(const int entry) {
00019 ControlPointAssociatedEntry e(entry);
00020 return e;
00021 }
00022
00023 ControlPoint::ControlPointAssociatedArray ControlPoint::assocWithArray(const CProxy_ArrayBase &array) {
00024 ControlPointAssociatedArray a(array);
00025 return a;
00026 }
00027
00028 void ControlPoint::initControlPointEffects() {
00029 CkpvInitialize(cp_effect_map, cp_effects);
00030
00031 }
00032
00033 void testControlPointEffects() {
00034 ControlPoint::EffectIncrease::Priority("name");
00035 ControlPoint::EffectDecrease::Priority("name");
00036 ControlPoint::EffectIncrease::Priority("name", assocWithEntry(0));
00037 ControlPoint::EffectDecrease::Priority("name", assocWithEntry(0));
00038 ControlPoint::EffectIncrease::MemoryConsumption("name");
00039 ControlPoint::EffectDecrease::MemoryConsumption("name");
00040 ControlPoint::EffectIncrease::MemoryConsumption("name", assocWithEntry(0));
00041 ControlPoint::EffectDecrease::MemoryConsumption("name", assocWithEntry(0));
00042 ControlPoint::EffectIncrease::GrainSize("name");
00043 ControlPoint::EffectDecrease::GrainSize("name");
00044 ControlPoint::EffectIncrease::GrainSize("name", assocWithEntry(0));
00045 ControlPoint::EffectDecrease::GrainSize("name", assocWithEntry(0));
00046 ControlPoint::EffectIncrease::ComputeDurations("name");
00047 ControlPoint::EffectDecrease::ComputeDurations("name");
00048 ControlPoint::EffectIncrease::ComputeDurations("name", assocWithEntry(0));
00049 ControlPoint::EffectDecrease::ComputeDurations("name", assocWithEntry(0));
00050 ControlPoint::EffectIncrease::FlopRate("name");
00051 ControlPoint::EffectDecrease::FlopRate("name");
00052 ControlPoint::EffectIncrease::FlopRate("name", assocWithEntry(0));
00053 ControlPoint::EffectDecrease::FlopRate("name", assocWithEntry(0));
00054 ControlPoint::EffectIncrease::NumComputeObjects("name");
00055 ControlPoint::EffectDecrease::NumComputeObjects("name");
00056 ControlPoint::EffectIncrease::NumComputeObjects("name", assocWithEntry(0));
00057 ControlPoint::EffectDecrease::NumComputeObjects("name", assocWithEntry(0));
00058 ControlPoint::EffectIncrease::NumMessages("name");
00059 ControlPoint::EffectDecrease::NumMessages("name");
00060 ControlPoint::EffectIncrease::NumMessages("name", assocWithEntry(0));
00061 ControlPoint::EffectDecrease::NumMessages("name", assocWithEntry(0));
00062 ControlPoint::EffectIncrease::MessageSizes("name");
00063 ControlPoint::EffectDecrease::MessageSizes("name");
00064 ControlPoint::EffectIncrease::MessageSizes("name", assocWithEntry(0));
00065 ControlPoint::EffectDecrease::MessageSizes("name", assocWithEntry(0));
00066 ControlPoint::EffectIncrease::MessageOverhead("name");
00067 ControlPoint::EffectDecrease::MessageOverhead("name");
00068 ControlPoint::EffectIncrease::MessageOverhead("name", assocWithEntry(0));
00069 ControlPoint::EffectDecrease::MessageOverhead("name", assocWithEntry(0));
00070 ControlPoint::EffectIncrease::UnnecessarySyncronization("name");
00071 ControlPoint::EffectDecrease::UnnecessarySyncronization("name");
00072 ControlPoint::EffectIncrease::UnnecessarySyncronization("name", assocWithEntry(0));
00073 ControlPoint::EffectDecrease::UnnecessarySyncronization("name", assocWithEntry(0));
00074 ControlPoint::EffectIncrease::Concurrency("name");
00075 ControlPoint::EffectDecrease::Concurrency("name");
00076 ControlPoint::EffectIncrease::Concurrency("name", assocWithEntry(0));
00077 ControlPoint::EffectDecrease::Concurrency("name", assocWithEntry(0));
00078 ControlPoint::EffectIncrease::PotentialOverlap("name");
00079 ControlPoint::EffectDecrease::PotentialOverlap("name");
00080 ControlPoint::EffectIncrease::PotentialOverlap("name", assocWithEntry(0));
00081 ControlPoint::EffectDecrease::PotentialOverlap("name", assocWithEntry(0));
00082 ControlPoint::EffectIncrease::LoadBalancingPeriod("name");
00083 ControlPoint::EffectDecrease::LoadBalancingPeriod("name");
00084 ControlPoint::EffectIncrease::LoadBalancingPeriod("name", assocWithEntry(0));
00085 ControlPoint::EffectDecrease::LoadBalancingPeriod("name", assocWithEntry(0));
00086 ControlPoint::EffectIncrease::GPUOffloadedWork("name");
00087 ControlPoint::EffectDecrease::GPUOffloadedWork("name");
00088 ControlPoint::EffectIncrease::GPUOffloadedWork("name", assocWithEntry(0));
00089 ControlPoint::EffectDecrease::GPUOffloadedWork("name", assocWithEntry(0));
00090
00091 }
00092
00093 void insert(const std::string effect, const std::string name, const ControlPoint::ControlPointAssociation &assoc, const int direction) {
00094 std::pair<int, std::vector<ControlPoint::ControlPointAssociation> > &info = CkpvAccess(cp_effects)[effect][name];
00095 info.first = direction;
00096 info.second.push_back(assoc);
00097
00098 }
00099
00100 void ControlPoint::EffectDecrease::Priority(std::string s, const ControlPoint::ControlPointAssociation &a) {
00101 insert("Priority", s, a, EFF_DEC);
00102 }
00103 void ControlPoint::EffectIncrease::Priority(std::string s, const ControlPoint::ControlPointAssociation &a) {
00104 insert("Priority", s, a, EFF_INC);
00105 }
00106 void ControlPoint::EffectDecrease::Priority(std::string s) {
00107 insert("Priority", s, default_assoc, EFF_DEC);
00108 }
00109 void ControlPoint::EffectIncrease::Priority(std::string s) {
00110 insert("Priority", s, default_assoc, EFF_INC);
00111 }
00112 void ControlPoint::EffectDecrease::MemoryConsumption(std::string s, const ControlPoint::ControlPointAssociation &a) {
00113 insert("MemoryConsumption", s, a, EFF_DEC);
00114 }
00115 void ControlPoint::EffectIncrease::MemoryConsumption(std::string s, const ControlPoint::ControlPointAssociation &a) {
00116 insert("MemoryConsumption", s, a, EFF_INC);
00117 }
00118 void ControlPoint::EffectDecrease::MemoryConsumption(std::string s) {
00119 insert("MemoryConsumption", s, default_assoc, EFF_DEC);
00120 }
00121 void ControlPoint::EffectIncrease::MemoryConsumption(std::string s) {
00122 insert("MemoryConsumption", s, default_assoc, EFF_INC);
00123 }
00124 void ControlPoint::EffectDecrease::GrainSize(std::string s, const ControlPoint::ControlPointAssociation &a) {
00125 insert("GrainSize", s, a, EFF_DEC);
00126 }
00127 void ControlPoint::EffectIncrease::GrainSize(std::string s, const ControlPoint::ControlPointAssociation &a) {
00128 insert("GrainSize", s, a, EFF_INC);
00129 }
00130 void ControlPoint::EffectDecrease::GrainSize(std::string s) {
00131 insert("GrainSize", s, default_assoc, EFF_DEC);
00132 }
00133 void ControlPoint::EffectIncrease::GrainSize(std::string s) {
00134 insert("GrainSize", s, default_assoc, EFF_INC);
00135 }
00136 void ControlPoint::EffectDecrease::ComputeDurations(std::string s, const ControlPoint::ControlPointAssociation &a) {
00137 insert("ComputeDurations", s, a, EFF_DEC);
00138 }
00139 void ControlPoint::EffectIncrease::ComputeDurations(std::string s, const ControlPoint::ControlPointAssociation &a) {
00140 insert("ComputeDurations", s, a, EFF_INC);
00141 }
00142 void ControlPoint::EffectDecrease::ComputeDurations(std::string s) {
00143 insert("ComputeDurations", s, default_assoc, EFF_DEC);
00144 }
00145 void ControlPoint::EffectIncrease::ComputeDurations(std::string s) {
00146 insert("ComputeDurations", s, default_assoc, EFF_INC);
00147 }
00148 void ControlPoint::EffectDecrease::FlopRate(std::string s, const ControlPoint::ControlPointAssociation &a) {
00149 insert("FlopRate", s, a, EFF_DEC);
00150 }
00151 void ControlPoint::EffectIncrease::FlopRate(std::string s, const ControlPoint::ControlPointAssociation &a) {
00152 insert("FlopRate", s, a, EFF_INC);
00153 }
00154 void ControlPoint::EffectDecrease::FlopRate(std::string s) {
00155 insert("FlopRate", s, default_assoc, EFF_DEC);
00156 }
00157 void ControlPoint::EffectIncrease::FlopRate(std::string s) {
00158 insert("FlopRate", s, default_assoc, EFF_INC);
00159 }
00160 void ControlPoint::EffectDecrease::NumComputeObjects(std::string s, const ControlPoint::ControlPointAssociation &a) {
00161 insert("NumComputeObjects", s, a, EFF_DEC);
00162 }
00163 void ControlPoint::EffectIncrease::NumComputeObjects(std::string s, const ControlPoint::ControlPointAssociation &a) {
00164 insert("NumComputeObjects", s, a, EFF_INC);
00165 }
00166 void ControlPoint::EffectDecrease::NumComputeObjects(std::string s) {
00167 insert("NumComputeObjects", s, default_assoc, EFF_DEC);
00168 }
00169 void ControlPoint::EffectIncrease::NumComputeObjects(std::string s) {
00170 insert("NumComputeObjects", s, default_assoc, EFF_INC);
00171 }
00172 void ControlPoint::EffectDecrease::NumMessages(std::string s, const ControlPoint::ControlPointAssociation &a) {
00173 insert("NumMessages", s, a, EFF_DEC);
00174 }
00175 void ControlPoint::EffectIncrease::NumMessages(std::string s, const ControlPoint::ControlPointAssociation &a) {
00176 insert("NumMessages", s, a, EFF_INC);
00177 }
00178 void ControlPoint::EffectDecrease::NumMessages(std::string s) {
00179 insert("NumMessages", s, default_assoc, EFF_DEC);
00180 }
00181 void ControlPoint::EffectIncrease::NumMessages(std::string s) {
00182 insert("NumMessages", s, default_assoc, EFF_INC);
00183 }
00184 void ControlPoint::EffectDecrease::MessageSizes(std::string s, const ControlPoint::ControlPointAssociation &a) {
00185 insert("MessageSizes", s, a, EFF_DEC);
00186 }
00187 void ControlPoint::EffectIncrease::MessageSizes(std::string s, const ControlPoint::ControlPointAssociation &a) {
00188 insert("MessageSizes", s, a, EFF_INC);
00189 }
00190 void ControlPoint::EffectDecrease::MessageSizes(std::string s) {
00191 insert("MessageSizes", s, default_assoc, EFF_DEC);
00192 }
00193 void ControlPoint::EffectIncrease::MessageSizes(std::string s) {
00194 insert("MessageSizes", s, default_assoc, EFF_INC);
00195 }
00196 void ControlPoint::EffectDecrease::MessageOverhead(std::string s, const ControlPoint::ControlPointAssociation &a) {
00197 insert("MessageOverhead", s, a, EFF_DEC);
00198 }
00199 void ControlPoint::EffectIncrease::MessageOverhead(std::string s, const ControlPoint::ControlPointAssociation &a) {
00200 insert("MessageOverhead", s, a, EFF_INC);
00201 }
00202 void ControlPoint::EffectDecrease::MessageOverhead(std::string s) {
00203 insert("MessageOverhead", s, default_assoc, EFF_DEC);
00204 }
00205 void ControlPoint::EffectIncrease::MessageOverhead(std::string s) {
00206 insert("MessageOverhead", s, default_assoc, EFF_INC);
00207 }
00208 void ControlPoint::EffectDecrease::UnnecessarySyncronization(std::string s, const ControlPoint::ControlPointAssociation &a) {
00209 insert("UnnecessarySyncronization", s, a, EFF_DEC);
00210 }
00211 void ControlPoint::EffectIncrease::UnnecessarySyncronization(std::string s, const ControlPoint::ControlPointAssociation &a) {
00212 insert("UnnecessarySyncronization", s, a, EFF_INC);
00213 }
00214 void ControlPoint::EffectDecrease::UnnecessarySyncronization(std::string s) {
00215 insert("UnnecessarySyncronization", s, default_assoc, EFF_DEC);
00216 }
00217 void ControlPoint::EffectIncrease::UnnecessarySyncronization(std::string s) {
00218 insert("UnnecessarySyncronization", s, default_assoc, EFF_INC);
00219 }
00220 void ControlPoint::EffectDecrease::Concurrency(std::string s, const ControlPoint::ControlPointAssociation &a) {
00221 insert("Concurrency", s, a, EFF_DEC);
00222 }
00223 void ControlPoint::EffectIncrease::Concurrency(std::string s, const ControlPoint::ControlPointAssociation &a) {
00224 insert("Concurrency", s, a, EFF_INC);
00225 }
00226 void ControlPoint::EffectDecrease::Concurrency(std::string s) {
00227 insert("Concurrency", s, default_assoc, EFF_DEC);
00228 }
00229 void ControlPoint::EffectIncrease::Concurrency(std::string s) {
00230 insert("Concurrency", s, default_assoc, EFF_INC);
00231 }
00232 void ControlPoint::EffectDecrease::PotentialOverlap(std::string s, const ControlPoint::ControlPointAssociation &a) {
00233 insert("PotentialOverlap", s, a, EFF_DEC);
00234 }
00235 void ControlPoint::EffectIncrease::PotentialOverlap(std::string s, const ControlPoint::ControlPointAssociation &a) {
00236 insert("PotentialOverlap", s, a, EFF_INC);
00237 }
00238 void ControlPoint::EffectDecrease::PotentialOverlap(std::string s) {
00239 insert("PotentialOverlap", s, default_assoc, EFF_DEC);
00240 }
00241 void ControlPoint::EffectIncrease::PotentialOverlap(std::string s) {
00242 insert("PotentialOverlap", s, default_assoc, EFF_INC);
00243 }
00244 void ControlPoint::EffectDecrease::LoadBalancingPeriod(std::string s, const ControlPoint::ControlPointAssociation &a) {
00245 insert("LoadBalancingPeriod", s, a, EFF_DEC);
00246 }
00247 void ControlPoint::EffectIncrease::LoadBalancingPeriod(std::string s, const ControlPoint::ControlPointAssociation &a) {
00248 insert("LoadBalancingPeriod", s, a, EFF_INC);
00249 }
00250 void ControlPoint::EffectDecrease::LoadBalancingPeriod(std::string s) {
00251 insert("LoadBalancingPeriod", s, default_assoc, EFF_DEC);
00252 }
00253 void ControlPoint::EffectIncrease::LoadBalancingPeriod(std::string s) {
00254 insert("LoadBalancingPeriod", s, default_assoc, EFF_INC);
00255 }
00256 void ControlPoint::EffectDecrease::GPUOffloadedWork(std::string s, const ControlPoint::ControlPointAssociation &a) {
00257 insert("GPUOffloadedWork", s, a, EFF_DEC);
00258 }
00259 void ControlPoint::EffectIncrease::GPUOffloadedWork(std::string s, const ControlPoint::ControlPointAssociation &a) {
00260 insert("GPUOffloadedWork", s, a, EFF_INC);
00261 }
00262 void ControlPoint::EffectDecrease::GPUOffloadedWork(std::string s) {
00263 insert("GPUOffloadedWork", s, default_assoc, EFF_DEC);
00264 }
00265 void ControlPoint::EffectIncrease::GPUOffloadedWork(std::string s) {
00266 insert("GPUOffloadedWork", s, default_assoc, EFF_INC);
00267 }
00268
00269
00270 #endif