Column-oriented GPU-accelerated Database Management System
CoGaDB
/home/sebastian/gpudbms/trunk/hype-library/include/core/workload_generator.hpp
Go to the documentation of this file.
00001 /***********************************************************************************************************
00002 Copyright (c) 2012, Sebastian Breß, Otto-von-Guericke University of Magdeburg, Germany. All rights reserved.
00003 
00004 This program and accompanying materials are made available under the terms of the 
00005 GNU LESSER GENERAL PUBLIC LICENSE - Version 3, http://www.gnu.org/licenses/lgpl-3.0.txt
00006 ***********************************************************************************************************/
00007 
00008 #pragma once
00009 
00010 //#include <iostream>
00011 #include <fstream>
00012 #include <string>
00013 #include <vector>
00014 //#include <numeric>
00015 
00016 /*#include <boost/circular_buffer.hpp>
00017 #include <boost/tokenizer.hpp>
00018 #include <boost/filesystem.hpp>
00019 #include <boost/lexical_cast.hpp>
00020 
00021 #include <core/operation.hpp>
00022 #include <core/time_measurement.hpp>
00023 
00024 #include <core/plotscriptgenerator.hpp>
00025 #include <core/scheduler.hpp>*/
00026 #include <core/measurementpair.hpp>
00027 #include <core/offline_algorithm.hpp>
00028 #include <config/exports.hpp>
00029 
00030 /* temporarily disable warnings because of missing STL DLL interface */
00031 #ifdef _MSC_VER
00032 #  pragma warning(push)
00033 #  pragma warning(disable: 4251)
00034 #endif
00035 
00036 namespace hype{
00037         namespace core{
00038 
00039 unsigned int& getWorkloadID(); 
00040 
00041 class StatisticsGatherer;
00042 
00043 class HYPE_EXPORT WorkloadGenerator{
00044         public:
00045         friend class StatisticsGatherer;
00046         
00047         WorkloadGenerator(const std::string& operation_name);
00048         
00049         ~WorkloadGenerator();
00050 
00051         bool addOffline_Algorithm(const Offline_Algorithm& meas_pair_prov);
00052         
00053         void run();
00054 
00055         void nextIteration();
00056 
00057         void shuffleWorkload();
00058 
00059         void reset();
00060                 
00061         private:
00062         std::string operation_name_;
00063         unsigned int number_of_right_decisions_;
00064         unsigned int number_of_total_decisions_;
00065         std::vector <Offline_Algorithm> offline_algorithms;
00067         std::vector<double> isolated_execution_time_of_algorithms_;
00068         std::fstream logfile;
00069         //reference models
00070         double execution_time_of_ideal_model_;
00071         double execution_time_of_cpu_only_model_;
00072         double execution_time_of_gpu_only_model_;
00073    //for real model
00074         double execution_time_of_real_model_;
00075         double total_time_for_overhead_of_addObservation_;
00076         double total_time_for_overhead_of_getOptimalAlgorithm_;
00078         std::vector<MeasurementPair> execution_history_; 
00079         //Feature: inter device parallelism
00080         double inter_device_parallel_time_cpu_;
00081         double inter_device_parallel_time_gpu_;                 
00082 };
00083 
00084         }; //end namespace core
00085 }; //end namespace hype
00086 
00087 #ifdef _MSC_VER
00088 #  pragma warning(pop)
00089 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines