Skip to content

Commit

Permalink
- some scorep-tracing commands added for performance-analyzation
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@20303 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
Marcus Walther committed Apr 29, 2014
1 parent 3f07095 commit 1c0f99d
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 7 deletions.
19 changes: 17 additions & 2 deletions SimulationRuntime/cpp/Solver/CVode/CVode.cpp
Expand Up @@ -43,7 +43,7 @@ Cvode::~Cvode()

void Cvode::initialize()
{
#ifdef SCOREP_TRACE
#ifdef SCOREP_USER_ENABLE
SCOREP_USER_REGION_DEFINE(cvode_initialization_handle)
SCOREP_USER_REGION_BEGIN(cvode_initialization_handle, "Cvode_initialization", SCOREP_USER_REGION_TYPE_FUNCTION )
#endif
Expand Down Expand Up @@ -196,13 +196,17 @@ void Cvode::initialize()
//

}
#ifdef SCOREP_TRACE
#ifdef SCOREP_USER_ENABLE
SCOREP_USER_REGION_END(cvode_initialization_handle)
#endif
}

void Cvode::solve(const SOLVERCALL action)
{
#ifdef SCOREP_USER_ENABLE
SCOREP_USER_REGION_DEFINE(cvode_solve_handle)
SCOREP_USER_REGION_BEGIN(cvode_solve_handle, "Cvode_solve", SCOREP_USER_REGION_TYPE_FUNCTION )
#endif
//_eulerSettings->getEventOutput() = true;

if (_cvodesettings && _system)
Expand Down Expand Up @@ -274,6 +278,10 @@ void Cvode::solve(const SOLVERCALL action)

throw std::invalid_argument("CVode::solve()");
}

#ifdef SCOREP_USER_ENABLE
SCOREP_USER_REGION_END(cvode_solve_handle)
#endif
}

void Cvode::CVodeCore()
Expand Down Expand Up @@ -393,6 +401,10 @@ void Cvode::CVodeCore()

void Cvode::writeCVodeOutput(const double &time,const double &h,const int &stp)
{
#ifdef SCOREP_USER_ENABLE
SCOREP_USER_REGION_DEFINE(cvode_writeOutput_handle)
SCOREP_USER_REGION_BEGIN(cvode_writeOutput_handle, "Cvode_writeOutput", SCOREP_USER_REGION_TYPE_FUNCTION )
#endif
if (stp > 0)
{
if (_cvodesettings->getDenseOutput())
Expand Down Expand Up @@ -426,6 +438,9 @@ void Cvode::writeCVodeOutput(const double &time,const double &h,const int &stp)
else
SolverDefaultImplementation::writeToFile(stp, time, h);
}
#ifdef SCOREP_USER_ENABLE
SCOREP_USER_REGION_END(cvode_writeOutput_handle)
#endif
}


Expand Down
2 changes: 1 addition & 1 deletion SimulationRuntime/cpp/Solver/CVode/CVode.h
Expand Up @@ -8,7 +8,7 @@
#include <nvector/nvector_serial.h>
#include <cvodes/cvodes_dense.h>

#ifdef SCOREP_TRACE
#ifdef SCOREP_USER_ENABLE
#include <scorep/SCOREP_User.h>
#endif

Expand Down
19 changes: 15 additions & 4 deletions SimulationRuntime/cpp/Solver/Kinsol/Kinsol.cpp
Expand Up @@ -41,6 +41,10 @@ Kinsol::~Kinsol()

void Kinsol::initialize()
{
#ifdef SCOREP_USER_ENABLE
SCOREP_USER_REGION_DEFINE(kinsol_initialization_handle)
SCOREP_USER_REGION_BEGIN(kinsol_initialization_handle, "Kinsol_initialization", SCOREP_USER_REGION_TYPE_FUNCTION )
#endif
int idid;

_firstCall = false;
Expand Down Expand Up @@ -123,12 +127,17 @@ void Kinsol::initialize()
_iterationStatus = SOLVERERROR;
}
}


#ifdef SCOREP_USER_ENABLE
SCOREP_USER_REGION_END(kinsol_initialization_handle)
#endif
}

void Kinsol::solve()
{
{
#ifdef SCOREP_USER_ENABLE
SCOREP_USER_REGION_DEFINE(kinsol_solve_handle)
SCOREP_USER_REGION_BEGIN(kinsol_solve_handle, "Kinsol_solve", SCOREP_USER_REGION_TYPE_FUNCTION )
#endif
if (_firstCall)
initialize();

Expand Down Expand Up @@ -219,7 +228,9 @@ void Kinsol::solve()
return;
}
}

#ifdef SCOREP_USER_ENABLE
SCOREP_USER_REGION_END(kinsol_solve_handle)
#endif
}

IAlgLoopSolver::ITERATIONSTATUS Kinsol::getIterationStatus()
Expand Down
3 changes: 3 additions & 0 deletions SimulationRuntime/cpp/Solver/Kinsol/Kinsol.h
Expand Up @@ -11,6 +11,9 @@
#include <boost/math/special_functions/fpclassify.hpp>
//#include<kinsol_lapack.h>

#ifdef SCOREP_USER_ENABLE
#include <scorep/SCOREP_User.h>
#endif

class Kinsol : public IAlgLoopSolver
{
Expand Down

0 comments on commit 1c0f99d

Please sign in to comment.