00001
00006 #ifndef AAPLEARNER_H
00007 #define AAPLEARNER_H
00008
00009 #include "convcomlib.h"
00010 #include "ComlibManager.h"
00011 #include "ComlibLearner.h"
00012
00013 #define ALPHA 1e-5 //Total alpha overhead
00014 #define ALPHA_NIC1 9e-6 //NIC alpha for short messages
00015 #define ALPHA_NIC2 6e-6 //NIC alpha
00016
00017 #define ALPHA_CHARM 2e-6 //Charm++ processing after message has been received
00018
00019
00020 #define GAMMA_NIC 2.6e-9 //DMA bandwidth to copy data into NIC memory
00021 #define BETA 4e-9 //Network bandwidth
00022 #define GAMMA_MEM 9e-10 //Memory bandwidth (copied twice)
00023
00024 #define min(x,y) ((x < y) ? x : y)
00025
00026 inline double min4(double x, double y, double a, double b) {
00027 double x1 = min(x,y);
00028 double a1 = min(a,b);
00029
00030 return min(x1,a1);
00031 }
00032
00033 class AAPLearner : public ComlibLearner {
00034 double alpha, beta;
00035
00036 double computeDirect(double P, double m, double d);
00037 double computeMesh(double P, double m, double d);
00038 double computeHypercube(double P, double m, double d);
00039 double computeGrid(double P, double m, double d);
00040
00041 public:
00042 AAPLearner();
00043
00044 void init();
00045 Strategy* optimizePattern(Strategy* , ComlibGlobalStats &);
00046
00047 Strategy ** optimizePattern(Strategy** , ComlibGlobalStats &) {
00048 CkAbort("Not implemented\n");
00049 return NULL;
00050 }
00051 };
00052
00053
00054 #endif
00055