Commit 9c3437be authored by Quentin Khan's avatar Quentin Khan

PerfTest: added static/dynamic openmp schedule

parent d2cff93f
......@@ -24,17 +24,21 @@ public:
TreeLoader& _treeLoader;
KernelLoader& _kernelLoader;
AlgoLoaderThread(FPerfTestParams& /*params*/,
bool _omp_static_schedule;
AlgoLoaderThread(FPerfTestParams& params,
TreeLoader& treeLoader,
KernelLoader& kernelLoader) :
_treeLoader(treeLoader),
_kernelLoader(kernelLoader) {
_kernelLoader(kernelLoader),
_omp_static_schedule(params.omp_static_schedule) {
}
void run() {
FMMClass algo(&(_treeLoader._tree), &(_kernelLoader._kernel), false);
FMMClass algo(&(_treeLoader._tree), &(_kernelLoader._kernel),
_omp_static_schedule);
algo.execute();
}
};
......
......@@ -58,8 +58,8 @@ int main (int argc, char** argv)
FParameterDefinitions::OctreeHeight,
FParameterDefinitions::OctreeSubHeight,
FParameterDefinitions::NbThreads,
{{"--algo"},"Algorithm to run (costzones, basic-static,"
" basic-dynamic, task)"});
{{"--algo"},"Algorithm to run (costzones, basic, task)"},
{{"--schedule"},"OpenMP scheduling policy (static, dynamic)."});
FPerfTestParams params;
{
using namespace FParameterDefinitions;
......@@ -70,6 +70,8 @@ int main (int argc, char** argv)
params.subTreeHeight = getValue(argc, argv, OctreeSubHeight.options, 2);
params.nbThreads = getValue(argc, argv, NbThreads.options, 1);
params.algo = getStr(argc,argv,{"--algo"},"task");
params.omp_static_schedule =
getStr(argc,argv,{"--schedule"},"dynamic") == std::string("static");
}
......@@ -79,6 +81,8 @@ int main (int argc, char** argv)
runperf<TreeLoaderFCheb<>, KernelLoaderFChebSym, AlgoLoaderTask>(params);
} else if ( "costzones" == params.algo ) {
runperf<TreeLoaderFCheb<>, KernelLoaderFChebSym, AlgoLoaderCostZones>(params);
} else {
std::cout << "Unknown algorithm: " << params.algo << std::endl;
}
......
......@@ -17,6 +17,7 @@ struct FPerfTestParams {
int nbThreads = 1; ///< Maximum number of threads (when used).
std::string filename = ""; ///< Particles file.
std::string algo = "task"; ///< Algorithm to run.
bool omp_static_schedule = false; ///< OpenMP static or dynamic schedule.
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment