From a09a52f5372dd0a3f44feedb1d89f11d12402058 Mon Sep 17 00:00:00 2001 From: Jan Travnicek <Jan.Travnicek@fit.cvut.cz> Date: Thu, 24 Mar 2016 15:11:16 +0100 Subject: [PATCH] add measure types --- .../src/measurements/MeasurementTypes.cpp | 13 +++++++-- .../src/measurements/MeasurementTypes.hpp | 2 +- .../processor/MeasurementProcessorOutput.cpp | 5 ++-- examples2/measurements/ameasure2.xml | 27 +++++++++++++++++++ 4 files changed, 41 insertions(+), 6 deletions(-) create mode 100644 examples2/measurements/ameasure2.xml diff --git a/alib2common/src/measurements/MeasurementTypes.cpp b/alib2common/src/measurements/MeasurementTypes.cpp index fe19c0f323..801eb99b1d 100644 --- a/alib2common/src/measurements/MeasurementTypes.cpp +++ b/alib2common/src/measurements/MeasurementTypes.cpp @@ -26,9 +26,14 @@ std::string to_string ( Type t ) { case Type::AUXILIARY: return "AUXILIARY"; - default: - throw::exception::CommonException ( "Missing case."); + case Type::PREPROCESS: + return "PREPROCESS"; + + case Type::ALGORITHM: + return "ALGORITHM"; } + + throw::exception::CommonException ( "Missing case." ); } Type measurementTypeFromString ( const std::string & ts ) { @@ -44,6 +49,10 @@ Type measurementTypeFromString ( const std::string & ts ) { if ( ts == "AUXILIARY" ) return Type::AUXILIARY; + if ( ts == "PREPROCESS" ) return Type::PREPROCESS; + + if ( ts == "ALGORITHM" ) return Type::ALGORITHM; + throw::exception::CommonException ( "measurementTypeFromString failed, unknown measurement type: " + ts ); } diff --git a/alib2common/src/measurements/MeasurementTypes.hpp b/alib2common/src/measurements/MeasurementTypes.hpp index ef35094832..6ae17f626d 100644 --- a/alib2common/src/measurements/MeasurementTypes.hpp +++ b/alib2common/src/measurements/MeasurementTypes.hpp @@ -14,7 +14,7 @@ namespace measurements { enum class Type : unsigned { - ROOT = 1, OVERALL = 2, INIT = 4, FINALIZE = 8, MAIN = 16, AUXILIARY = 32 + ROOT = 1, OVERALL = 2, INIT = 4, FINALIZE = 8, MAIN = 16, AUXILIARY = 32, PREPROCESS = 64, ALGORITHM = 128 }; std::string to_string ( Type ); diff --git a/alib2measurepp/src/processor/MeasurementProcessorOutput.cpp b/alib2measurepp/src/processor/MeasurementProcessorOutput.cpp index cd310ed601..54cff578c7 100644 --- a/alib2measurepp/src/processor/MeasurementProcessorOutput.cpp +++ b/alib2measurepp/src/processor/MeasurementProcessorOutput.cpp @@ -186,10 +186,9 @@ std::string MeasurementProcessorOutput::getData ( const MeasurementFrame & frame case OutputEngine::COUNTER: return MeasurementProcessorViews::viewCounterDataFrame ( frame, mpo.outputEngineAttr ); - - default: - throw::exception::CommonException ( "Missing case."); } + + throw::exception::CommonException ( "Missing case." ); } } diff --git a/examples2/measurements/ameasure2.xml b/examples2/measurements/ameasure2.xml new file mode 100644 index 0000000000..626bfb9b66 --- /dev/null +++ b/examples2/measurements/ameasure2.xml @@ -0,0 +1,27 @@ +<?xml version="1.0"?> +<MeasurementProvisioner> + <Environment> + <PipelineIterations>10</PipelineIterations> + </Environment> + <InputData> + <InputBatch> + <Generator id="1" alias="str 65536:2">./arand2 -t ST --length 16384 --terminals 2</Generator> + <Generator id="2" alias="pat 2">./arand2 -t SST --length 2 -i $1</Generator> + <Generator id="2" alias="pat 4">./arand2 -t SST --length 4 -i $1</Generator> + <Generator id="2" alias="pat 8">./arand2 -t SST --length 8 -i $1</Generator> + <Generator id="2" alias="pat 16">./arand2 -t SST --length 16 -i $1</Generator> + <Generator id="2" alias="pat 32">./arand2 -t SST --length 32 -i $1</Generator> + <Generator id="2" alias="pat 64">./arand2 -t SST --length 64 -i $1</Generator> + <Generator id="2" alias="pat 128">./arand2 -t SST --length 128 -i $1</Generator> + <Generator id="2" alias="pat 256">./arand2 -t SST --length 256 -i $1</Generator> + <Generator id="2" alias="pat 512">./arand2 -t SST --length 512 -i $1</Generator> + <Generator id="2" alias="pat 1024">./arand2 -t SST --length 1024 -i $1</Generator> + <Generator id="2" alias="pat 2048">./arand2 -t SST --length 2048 -i $1</Generator> + </InputBatch> + </InputData> + <Pipelines> + <Pipeline> + <Command alias="bmh">./astringology2 -a boyerMooreHorspool -s $1 -p $2</Command> + </Pipeline> + </Pipelines> +</MeasurementProvisioner> -- GitLab