Commit 19eea63f authored by Ondrej Vysocky's avatar Ondrej Vysocky
Browse files

READEX probes insted of MERIC probes

parent bed989cf
......@@ -63,18 +63,25 @@ Description
#include "fvCFD.H"
#include "pisoControl.H"
//#include <meric.h>
#ifdef WITHREADEX
#include <readex.h>
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
//#define WITHMERIC
//#define WITHREADEX
int main(int argc, char *argv[])
{
#include "setRootCase.H" //MERIC_Init(); - OpenFOAM-v1612+/src/Pstream/mpi/UPstream.C
#ifdef WITHMERIC
MERIC_MeasureStart("icoFoam");
#ifdef WITHREADEX
//MERIC_MeasureStart("icoFoam");
READEX_REGION_DEFINE(icoFoam);
READEX_REGION_START(icoFoam, "icoFoam", SCOREP_USER_REGION_TYPE_COMMON);
#endif
#ifdef WITHMERIC
MERIC_MeasureStart("init");
#ifdef WITHREADEX
//MERIC_MeasureStart("init");
READEX_REGION_DEFINE(init);
READEX_REGION_START(init, "init", SCOREP_USER_REGION_TYPE_COMMON);
#endif
#include "createTime.H"
#include "createMesh.H"
......@@ -82,18 +89,27 @@ int main(int argc, char *argv[])
#include "createFields.H"
#include "initContinuityErrs.H"
#ifdef WITHMERIC
MERIC_MeasureStop(); //init
#ifdef WITHREADEX
//MERIC_MeasureStop(); //init
READEX_REAGION_STOP(init);
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef WITHMERIC
MERIC_MeasureStart("icoFoam-MainLoop");
#ifdef WITHREADEX
//MERIC_MeasureStart("icoFoam-MainLoop");
READEX_REGION_DEFINE(icoFoamMainLoop);
READEX_REGION_START(icoFoamMainLoop, "icoFoam-MainLoop", SCOREP_USER_REGION_TYPE_COMMON);
READEX_REGION_DEFINE(iteration);
#endif
Info<< "\nStarting time loop\n" << endl;
while (runTime.loop())
{
#ifdef WITHREADEX
READEX_PHASE_START(iteration, "iteration", SCOREP_USER_REGION_TYPE_COMMON);
#endif
Info<< "Time = " << runTime.timeName() << nl << endl;
#include "CourantNo.H"
......@@ -112,8 +128,10 @@ int main(int argc, char *argv[])
solve(UEqn == -fvc::grad(p));
}
#ifdef WITHMERIC
MERIC_MeasureStart("pisoLoop");
#ifdef WITHREADEX
//MERIC_MeasureStart("pisoLoop");
READEX_REGION_DEFINE(pisoLoop);
READEX_REGION_START(pisoLoop, "pisoLoop", SCOREP_USER_REGION_TYPE_COMMON);
#endif
// --- PISO loop
while (piso.correct())
......@@ -157,28 +175,38 @@ int main(int argc, char *argv[])
U = HbyA - rAU*fvc::grad(p);
U.correctBoundaryConditions();
}
#ifdef WITHMERIC
MERIC_MeasureStop(); //pisoLoop
#ifdef WITHREADEX
//MERIC_MeasureStop(); //pisoLoop
READEX_REGION_STOP(pisoLoop);
#endif
#ifdef WITHMERIC
MERIC_MeasureStart("write");
#ifdef WITHREADEX
//MERIC_MeasureStart("write");
READEX_REGION_DEFINE(write);
READEX_REGION_START(write, "write", SCOREP_USER_REGION_TYPE_COMMON);
#endif
runTime.write();
#ifdef WITHMERIC
MERIC_MeasureStop(); //write
#ifdef WITHREADEX
//MERIC_MeasureStop(); //write
READEX_REGION_STOP(write);
#endif
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
<< nl << endl;
#ifdef WITHREADEX
READEX_PHASE_STOP(iteration);
#endif
}
#ifdef WITHMERIC
MERIC_MeasureStop(); //icoFoam-MainLoop
#ifdef WITHREADEX
//MERIC_MeasureStop(); //icoFoam-MainLoop
READEX_REGION_STOP(icoFoamMainLoop);
#endif
#ifdef WITHMERIC
MERIC_MeasureStop(); //icoFoam
#ifdef WITHREADEX
//MERIC_MeasureStop(); //icoFoam
READEX_REGION_STOP(icoFoam);
#endif
Info<< "End\n" << endl;
......
......@@ -67,10 +67,8 @@ Description
#include "simpleControl.H"
#include "fvOptions.H"
#define WITHMERIC
#ifdef WITHMERIC
#include <meric.h>
#ifdef WITHREADEX
#include <readex.h>
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......@@ -81,64 +79,82 @@ int main(int argc, char *argv[])
#include "postProcess.H"
#include "setRootCase.H" //MERIC_Init
#ifdef WITHMERIC
MERIC_MeasureStart("simpleFoam");
#ifdef WITHREADEX
//MERIC_MeasureStart("simpleFoam");
READEX_REGION_DEFINE(simpleFoam);
READEX_REGION_START(simpleFoam, "simpleFoam", SCOREP_USER_REGION_TYPE_COMMON);
#endif
//TODO
/*
- rozsekat init
- k+omega
- matrices/lduMatrix/solvers/GAMG.C
- matrices/lduMatrix/solvers/PBiCG.C
- matrices/lduMatrix/lduMatrixATmul.C
- write ?
*/
#ifdef WITHMERIC
MERIC_MeasureStart("init");
#ifdef WITHREADEX
//MERIC_MeasureStart("init");
READEX_REGION_DEFINE(init);
READEX_REGION_START(init, "init", SCOREP_USER_REGION_TYPE_COMMON);
#endif
#ifdef WITHMERIC
MERIC_MeasureStart("init-createTime");
#ifdef WITHREADEX
//MERIC_MeasureStart("init-createTime");
READEX_REGION_DEFINE(initCreateTime);
READEX_REGION_START(initCreateTime, "init-createTime", SCOREP_USER_REGION_TYPE_COMMON);
#endif
#include "createTime.H"
#ifdef WITHMERIC
MERIC_MeasureStop();
MERIC_MeasureStart("init-createMesh");
#ifdef WITHREADEX
//MERIC_MeasureStop();
//MERIC_MeasureStart("init-createMesh");
READEX_REGION_STOP(initCreateTime);
READEX_REGION_DEFINE(initCreateMesh);
READEX_REGION_START(initCreateMesh, "init-createMesh", SCOREP_USER_REGION_TYPE_COMMON);
#endif
#include "createMesh.H"
#ifdef WITHMERIC
MERIC_MeasureStop();
MERIC_MeasureStart("init-createControl");
#ifdef WITHREADEX
//MERIC_MeasureStop();
//MERIC_MeasureStart("init-createControl");
READEX_REGION_STOP(initCreateMesh);
READEX_REGION_DEFINE(initCreateControl);
READEX_REGION_START(initCreateControl, "init-createControl", SCOREP_USER_REGION_TYPE_COMMON);
#endif
#include "createControl.H"
#ifdef WITHMERIC
MERIC_MeasureStop();
MERIC_MeasureStart("init-createFields");
#ifdef WITHREADEX
//MERIC_MeasureStop();
//MERIC_MeasureStart("init-createFields");
READEX_REGION_STOP(initCreateControl);
READEX_REGION_DEFINE(initCreateFields);
READEX_REGION_START(initCreateFields, "init-createFields", SCOREP_USER_REGION_TYPE_COMMON);
#endif
#include "createFields.H"
#ifdef WITHMERIC
MERIC_MeasureStop();
MERIC_MeasureStart("init-createFvOptions");
#ifdef WITHREADEX
//MERIC_MeasureStop();
//MERIC_MeasureStart("init-createFvOptions");
READEX_REGION_STOP(initCreateFields);
READEX_REGION_DEFINE(initCreateFvOptions);
READEX_REGION_START(initCreateFvOptions, "init-createFvOptions", SCOREP_USER_REGION_TYPE_COMMON);
#endif
#include "createFvOptions.H"
#ifdef WITHMERIC
MERIC_MeasureStop();
MERIC_MeasureStart("init-ContinuityErrs");
#ifdef WITHREADEX
//MERIC_MeasureStop();
//MERIC_MeasureStart("init-ContinuityErrs");
READEX_REGION_STOP(initCreateFvOptions);
READEX_REGION_DEFINE(initContinuityErrs);
READEX_REGION_START(initContinuityErrs, "init-ContinuityErrs", SCOREP_USER_REGION_TYPE_COMMON);
#endif
#include "initContinuityErrs.H"
#ifdef WITHMERIC
MERIC_MeasureStop();
#ifdef WITHREADEX
//MERIC_MeasureStop();
READEX_REGION_STOP(initContinuityErrs);
#endif
#ifdef WITHMERIC
MERIC_MeasureStop();
#ifdef WITHREADEX
//MERIC_MeasureStop();
READEX_REGION_STOP(init);
#endif
turbulence->validate();
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef WITHMERIC
MERIC_MeasureStart("simple-loop");
#ifdef WITHREADEX
//MERIC_MeasureStart("simple-loop");
READEX_REGION_DEFINE(simpleLoop);
READEX_REGION_START(simpleLoop, "simple-loop", SCOREP_USER_REGION_TYPE_COMMON);
READEX_REGION_DEFINE(iteration);
#endif
Info<< "\nStarting time loop\n" << endl;
......@@ -147,63 +163,80 @@ int i = 0;
while (simple.loop())
{
i++;
#ifdef WITHMERIC
MERIC_MeasureStart("iteration");
#ifdef WITHREADEX
//MERIC_MeasureStart("iteration");
READEX_PHASE_START(iteration, "iteration", SCOREP_USER_REGION_TYPE_COMMON);
#endif
Info<< "Time = " << runTime.timeName() << nl << endl;
// --- Pressure-velocity SIMPLE corrector
{
#ifdef WITHMERIC
MERIC_MeasureStart("UEqn"); //u
#ifdef WITHREADEX
//MERIC_MeasureStart("UEqn"); //u
READEX_REGION_DEFINE(UEqn);
READEX_REGION_START(UEqn, "UEqn", SCOREP_USER_REGION_TYPE_COMMON);
#endif
#include "UEqn.H"
#ifdef WITHMERIC
MERIC_MeasureStop();
MERIC_MeasureStart("pEqn"); //p
#ifdef WITHREADEX
//MERIC_MeasureStop();
//MERIC_MeasureStart("pEqn"); //p
READEX_REGION_STOP(UEqn);
READEX_REGION_DEFINE(pEqn);
READEX_REGION_START(pEqn, "pEqn", SCOREP_USER_REGION_TYPE_COMMON);
#endif
#include "pEqn.H"
#ifdef WITHMERIC
MERIC_MeasureStop();
#ifdef WITHREADEX
//MERIC_MeasureStop();
READEX_REGION_STOP(pEqn);
#endif
}
//start k+omega
#ifdef WITHMERIC
MERIC_MeasureStart("transportAndTurbulance");
#ifdef WITHREADEX
//MERIC_MeasureStart("transportAndTurbulance");
READEX_REGION_DEFINE(transportAndTurbulance);
READEX_REGION_START(transportAndTurbulance, "transportAndTurbulance", SCOREP_USER_REGION_TYPE_COMMON);
#endif
laminarTransport.correct();
turbulence->correct();
#ifdef WITHMERIC
MERIC_MeasureStop();
#ifdef WITHREADEX
//MERIC_MeasureStop();
READEX_REGION_STOP(transportAndTurbulance);
#endif
//stop
if (i%10 == 0)
{
#ifdef WITHMERIC
MERIC_MeasureStart("write");
#ifdef WITHREADEX
//MERIC_MeasureStart("write");
READEX_REGION_DEFINE(write);
READEX_REGION_START(write, "write", SCOREP_USER_REGION_TYPE_COMMON);
#endif
}
runTime.write();
if(i%10 == 0)
{
#ifdef WITHMERIC
MERIC_MeasureStop();
#ifdef WITHREADEX
//MERIC_MeasureStop();
READEX_REGION_STOP(write);
#endif
}
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
<< nl << endl;
#ifdef WITHMERIC
MERIC_MeasureStop();
#ifdef WITHREADEX
//MERIC_MeasureStop();
READEX_PHASE_STOP(iteration);
#endif
}
#ifdef WITHMERIC
MERIC_MeasureStop(); //simple-loop
MERIC_MeasureStop(); //simpleFoam
Info << "WITH MERIC\n";
#ifdef WITHREADEX
//MERIC_MeasureStop(); //simple-loop
//MERIC_MeasureStop(); //simpleFoam
READEX_REGION_STOP(simpleLoop);
READEX_REGION_STOP(simpleFoam);
Info << "WITH READEX\n";
#endif
Info<< "End\n" << endl;
return 0;
......
......@@ -29,12 +29,12 @@ Description
#include "lduMatrix.H"
#ifndef WITHMERIC
#define WITHMERIC
#ifndef WITHREADEX
#define WITHREADEX
#endif
#ifdef WITHMERIC
#include <meric.h>
#ifdef WITHREADEX
#include <readex.h>
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......@@ -49,8 +49,10 @@ void Foam::lduMatrix::Amul
) const
{
//AMUL
#ifdef WITHMERIC
MERIC_MeasureStart("Amul");
#ifdef WITHREADEX
//MERIC_MeasureStart("Amul");
READEX_REGION_DEFINE(Amul);
READEX_REGION_START(Amul, "Amul", SCOREP_USER_REGION_TYPE_COMMON);
#endif
scalar* __restrict__ ApsiPtr = Apsi.begin();
......@@ -103,8 +105,9 @@ void Foam::lduMatrix::Amul
);
tpsi.clear();
#ifdef WITHMERIC
MERIC_MeasureStop();
#ifdef WITHREADEX
//MERIC_MeasureStop();
READEX_REGION_STOP(Amul);
#endif
}
......@@ -119,8 +122,10 @@ void Foam::lduMatrix::Tmul
) const
{
//TMUL
#ifdef WITHMERIC
MERIC_MeasureStart("Tmul");
#ifdef WITHREADEX
//MERIC_MeasureStart("Tmul");
READEX_REGION_DEFINE(Tmul);
READEX_REGION_START(Tmul, "Tmul", SCOREP_USER_REGION_TYPE_COMMON);
#endif
scalar* __restrict__ TpsiPtr = Tpsi.begin();
......@@ -170,8 +175,9 @@ void Foam::lduMatrix::Tmul
);
tpsi.clear();
#ifdef WITHMERIC
MERIC_MeasureStop();
#ifdef WITHREADEX
//MERIC_MeasureStop();
READEX_REGION_STOP(Tmul);
#endif
}
......@@ -183,8 +189,10 @@ void Foam::lduMatrix::sumA
const lduInterfaceFieldPtrsList& interfaces
) const
{
#ifdef WITHMERIC
MERIC_MeasureStart("sumA");
#ifdef WITHREADEX
//MERIC_MeasureStart("sumA");
READEX_REGION_DEFINE(sumA);
READEX_REGION_START(sumA, "sumA", SCOREP_USER_REGION_TYPE_COMMON);
#endif
scalar* __restrict__ sumAPtr = sumA.begin();
......@@ -225,8 +233,9 @@ void Foam::lduMatrix::sumA
}
}
}
#ifdef WITHMERIC
MERIC_MeasureStop();
#ifdef WITHREADEX
//MERIC_MeasureStop();
READEX_REGION_STOP(sumA);
#endif
}
......@@ -241,8 +250,10 @@ void Foam::lduMatrix::residual
const direction cmpt
) const
{
#ifdef WITHMERIC
MERIC_MeasureStart("residual");
#ifdef WITHREADEX
//MERIC_MeasureStart("residual");
READEX_REGION_DEFINE(residual);
READEX_REGION_START(residual, "residual", SCOREP_USER_REGION_TYPE_COMMON);
#endif
scalar* __restrict__ rAPtr = rA.begin();
......@@ -312,8 +323,9 @@ void Foam::lduMatrix::residual
rA,
cmpt
);
#ifdef WITHMERIC
MERIC_MeasureStop();
#ifdef WITHREADEX
//MERIC_MeasureStop();
READEX_REGION_STOP(residual);
#endif
}
......
......@@ -26,13 +26,14 @@ License
#include "GAMGSolver.H"
#include "GAMGInterface.H"
#ifndef WITHMERIC
#define WITHMERIC
#ifndef WITHREADEX
#define WITHREADEX
#endif
#ifdef WITHMERIC
#include <meric.h>
#ifdef WITHREADEX
//#include <meric.h>
#include <readex.h>
#endif
......@@ -94,8 +95,10 @@ Foam::GAMGSolver::GAMGSolver
interfaceLevelsIntCoeffs_(agglomeration_.size())
{
#ifdef WITHMERIC
MERIC_MeasureStart("GAMGsolver");
#ifdef WITHREADEX
//MERIC_MeasureStart("GAMGsolver");
READEX_REGION_DEFINE(GAMGsolver);
READEX_REGION_START(GAMGsolver, "GAMGsolver", SCOREP_USER_REGION_TYPE_COMMON);
#endif
readControls();
......@@ -292,8 +295,9 @@ Foam::GAMGSolver::GAMGSolver
else
{
#ifdef WITHMERIC
MERIC_MeasureStop();
#ifdef WITHREADEX
//MERIC_MeasureStop();
READEX_REGION_STOP(GAMGsolver);
#endif
FatalErrorInFunction
......@@ -303,8 +307,9 @@ Foam::GAMGSolver::GAMGSolver
"nCellsInCoarsestLevel."
<< exit(FatalError);
}
#ifdef WITHMERIC
MERIC_MeasureStop();
#ifdef WITHREADEX
//MERIC_MeasureStop();
READEX_REGION_STOP(GAMGsolver);
#endif
}
......
......@@ -25,13 +25,13 @@ License
#include "PBiCG.H"
#ifndef WITHMERIC
#define WITHMERIC
#ifndef WITHREADEX
#define WITHREADEX
#endif
#ifdef WITHMERIC
#include <meric.h>
#ifdef WITHREADEX
#include <readex.h>
#endif
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
......@@ -79,8 +79,10 @@ Foam::solverPerformance Foam::PBiCG::solve
{
//Linear solver
#ifdef WITHMERIC
MERIC_MeasureStart("PBiCGsolver");
#ifdef WITHREADEX
//MERIC_MeasureStart("PBiCGsolver");
READEX_REGION_DEFINE(PBiCGsolver);
READEX_REGION_START(PBiCGsolver, "PBiCGsolver", SCOREP_USER_REGION_TYPE_COMMON);
#endif
// --- Setup class containing solver performance data
......@@ -155,15 +157,20 @@ Foam::solverPerformance Foam::PBiCG::solve
// --- Solver iteration
//All iteration
#ifdef WITHMERIC
MERIC_MeasureStart("PBiCG-AllIterations");
#ifdef WITHREADEX
//MERIC_MeasureStart("PBiCG-AllIterations");
READEX_REGION_DEFINE(PBiCGOneIteration);
READEX_REGION_DEFINE(ApplyPrec);
READEX_REGION_DEFINE(PBiCGAllIterations);
READEX_REGION_START(PBiCGAllIterations, "PBiCG-AllIterations", SCOREP_USER_REGION_TYPE_COMMON);
#endif
do
{
//iteration
#ifdef WITHMERIC
MERIC_MeasureStart("PBiCG-OneIteration");
#ifdef WITHREADEX
//MERIC_MeasureStart("PBiCG-OneIteration");
READEX_REGION_START(PBiCGOneIteration, "PBiCG-OneIteration", SCOREP_USER_REGION_TYPE_COMMON);
#endif
// --- Store previous wArT
......@@ -171,17 +178,21 @@ Foam::solverPerformance Foam::PBiCG::solve
// --- Precondition residuals
//prec 2x
#ifdef WITHMERIC
MERIC_MeasureStart("ApplyPrec");
#ifdef WITHREADEX
//MERIC_MeasureStart("ApplyPrec");
READEX_REGION_START(ApplyPrec, "ApplyPrec", SCOREP_USER_REGION_TYPE_COMMON);
#endif
preconPtr->precondition(wA, rA, cmpt);
#ifdef WITHMERIC
MERIC_MeasureStop();
MERIC_MeasureStart("ApplyPrec");
#ifdef WITHREADEX
//MERIC_MeasureStop();
//MERIC_MeasureStart("ApplyPrec");
READEX_REGION_STOP(ApplyPrec);
READEX_REGION_START(ApplyPrec, "ApplyPrec", SCOREP_USER_REGION_TYPE_COMMON);
#endif
preconPtr->preconditionT(wT, rT, cmpt);
#ifdef WITHMERIC