From 78b4da4c319754fe4c9447168ec1621646adc1a4 Mon Sep 17 00:00:00 2001 From: Caner Candan Date: Mon, 22 Nov 2010 14:47:55 +0100 Subject: [PATCH] remove threshold parameter and move from static schedule to dynamic --- eo/src/omp_apply.h | 2 +- eo/test/t-openmp.cpp | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/eo/src/omp_apply.h b/eo/src/omp_apply.h index bbdc4065..b899b5e1 100644 --- a/eo/src/omp_apply.h +++ b/eo/src/omp_apply.h @@ -40,7 +40,7 @@ template void omp_apply(eoUF& _proc, std::vector& _pop) { -#pragma omp parallel for default(none) shared(_proc, _pop) +#pragma omp parallel for default(none) shared(_proc, _pop) schedule(dynamic) for (unsigned i = 0; i < _pop.size(); ++i) { //#pragma omp critical diff --git a/eo/test/t-openmp.cpp b/eo/test/t-openmp.cpp index c4b88570..7cf7ac8e 100644 --- a/eo/test/t-openmp.cpp +++ b/eo/test/t-openmp.cpp @@ -39,8 +39,6 @@ int main(int ac, char** av) unsigned int nRun = parser.getORcreateParam((unsigned int)100, "nRun", "Number of runs", 'r', "Evolution Engine").value(); - double threshold = parser.getORcreateParam((double)3.0, "threshold", "Threshold of max speedup", 0, "Evolution Engine").value(); - std::string speedupFileName = parser.getORcreateParam(std::string("speedup"), "speedupFileName", "Speedup file name", 0, "Results").value(); std::string efficiencyFileName = parser.getORcreateParam(std::string("efficiency"), "efficiencyFileName", "Efficiency file name", 0, "Results").value(); @@ -64,7 +62,7 @@ int main(int ac, char** av) eoUniformGenerator< double > gen(-5, 5); std::ostringstream params; - params << "-p" << popMin << "-P" << popMax << "-d" << dimMin << "-D" << dimMax << "-r" << nRun << "-t" << threshold << "-s" << seedParam; + params << "-p" << popMin << "-P" << popMax << "-d" << dimMin << "-D" << dimMax << "-r" << nRun << "-s" << seedParam; std::ofstream speedupFile( std::string( speedupFileName + params.str() ).c_str() ); std::ofstream efficiencyFile( std::string( efficiencyFileName + params.str() ).c_str() ); @@ -107,10 +105,10 @@ int main(int ac, char** av) Tp = t2 - t1; } - if ( ( Ts / Tp ) > threshold ) { continue; } + if ( ( Ts / Tp ) > nbtask ) { continue; } speedupFile << Ts / Tp << ' '; - efficiencyFile << Ts / ( nbtask * Tp ); + efficiencyFile << Ts / ( nbtask * Tp ) << ' '; eo::log << eo::debug; eo::log << "Ts = " << Ts << std::endl;