Commit 9e57afb5 authored by Douglas Serson's avatar Douglas Serson

Put Timer in LibUtilities namespace

parent b78bc93f
...@@ -347,7 +347,7 @@ OperatorImpMap CollectionOptimisation::SetWithTimings( ...@@ -347,7 +347,7 @@ OperatorImpMap CollectionOptimisation::SetWithTimings(
Array<OneD, NekDouble> outarray2(maxsize); Array<OneD, NekDouble> outarray2(maxsize);
Array<OneD, NekDouble> outarray3(maxsize); Array<OneD, NekDouble> outarray3(maxsize);
Timer t; LibUtilities::Timer t;
if(verbose) if(verbose)
{ {
......
...@@ -77,7 +77,7 @@ InputXml::~InputXml() ...@@ -77,7 +77,7 @@ InputXml::~InputXml()
*/ */
void InputXml::Process(po::variables_map &vm) void InputXml::Process(po::variables_map &vm)
{ {
Timer timerpart; LibUtilities::Timer timerpart;
if (m_f->m_verbose) if (m_f->m_verbose)
{ {
if (m_f->m_comm->TreatAsRankZero()) if (m_f->m_comm->TreatAsRankZero())
......
...@@ -45,7 +45,6 @@ ...@@ -45,7 +45,6 @@
#include <vector> #include <vector>
#include <LibUtilities/BasicUtils/NekFactory.hpp> #include <LibUtilities/BasicUtils/NekFactory.hpp>
#include <LibUtilities/BasicUtils/Timer.h>
#include <LibUtilities/Communication/CommSerial.h> #include <LibUtilities/Communication/CommSerial.h>
#include <StdRegions/StdNodalTriExp.h> #include <StdRegions/StdNodalTriExp.h>
......
...@@ -67,7 +67,7 @@ void ProcessCreateExp::Process(po::variables_map &vm) ...@@ -67,7 +67,7 @@ void ProcessCreateExp::Process(po::variables_map &vm)
if(m_f->m_graph) if(m_f->m_graph)
{ {
int i, j; int i, j;
Timer timerpart; LibUtilities::Timer timerpart;
if (m_f->m_verbose) if (m_f->m_verbose)
{ {
if (m_f->m_comm->TreatAsRankZero()) if (m_f->m_comm->TreatAsRankZero())
......
...@@ -43,6 +43,7 @@ ...@@ -43,6 +43,7 @@
#include "ProcessIsoContour.h" #include "ProcessIsoContour.h"
#include <LibUtilities/BasicUtils/SharedArray.hpp> #include <LibUtilities/BasicUtils/SharedArray.hpp>
#include <LibUtilities/BasicUtils/Timer.h>
#include <LibUtilities/BasicUtils/ParseUtils.hpp> #include <LibUtilities/BasicUtils/ParseUtils.hpp>
#include <LibUtilities/BasicUtils/Progressbar.hpp> #include <LibUtilities/BasicUtils/Progressbar.hpp>
#include <boost/math/special_functions/fpclassify.hpp> #include <boost/math/special_functions/fpclassify.hpp>
...@@ -217,7 +218,7 @@ void ProcessIsoContour::Process(po::variables_map &vm) ...@@ -217,7 +218,7 @@ void ProcessIsoContour::Process(po::variables_map &vm)
if(smoothing) if(smoothing)
{ {
Timer timersm; LibUtilities::Timer timersm;
if(verbose) if(verbose)
{ {
......
...@@ -37,6 +37,8 @@ ...@@ -37,6 +37,8 @@
namespace Nektar namespace Nektar
{ {
namespace LibUtilities
{
Timer::Timer() : Timer::Timer() :
m_start(), m_start(),
...@@ -69,3 +71,4 @@ NekDouble Timer::TimePerTest(unsigned int n) ...@@ -69,3 +71,4 @@ NekDouble Timer::TimePerTest(unsigned int n)
} }
} }
}
...@@ -44,6 +44,8 @@ ...@@ -44,6 +44,8 @@
namespace Nektar namespace Nektar
{ {
namespace LibUtilities
{
class Timer class Timer
{ {
...@@ -72,6 +74,7 @@ class Timer ...@@ -72,6 +74,7 @@ class Timer
CounterType m_end; CounterType m_end;
}; };
}
} }
#endif //NEKTAR_LIB_UTILITIES_BASIC_UTILS_TIMER_H #endif //NEKTAR_LIB_UTILITIES_BASIC_UTILS_TIMER_H
...@@ -35,7 +35,6 @@ ...@@ -35,7 +35,6 @@
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
#include <MultiRegions/GlobalLinSysIterativeStaticCond.h> #include <MultiRegions/GlobalLinSysIterativeStaticCond.h>
#include <LibUtilities/BasicUtils/Timer.h>
#include <LibUtilities/BasicUtils/ErrorUtil.hpp> #include <LibUtilities/BasicUtils/ErrorUtil.hpp>
#include <LibUtilities/LinearAlgebra/StorageSmvBsr.hpp> #include <LibUtilities/LinearAlgebra/StorageSmvBsr.hpp>
#include <LibUtilities/LinearAlgebra/SparseDiagBlkMatrix.hpp> #include <LibUtilities/LinearAlgebra/SparseDiagBlkMatrix.hpp>
......
...@@ -35,7 +35,6 @@ ...@@ -35,7 +35,6 @@
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
#include <MultiRegions/GlobalLinSysStaticCond.h> #include <MultiRegions/GlobalLinSysStaticCond.h>
#include <LibUtilities/BasicUtils/Timer.h>
#include <LibUtilities/BasicUtils/ErrorUtil.hpp> #include <LibUtilities/BasicUtils/ErrorUtil.hpp>
#include <LibUtilities/LinearAlgebra/StorageSmvBsr.hpp> #include <LibUtilities/LinearAlgebra/StorageSmvBsr.hpp>
#include <LibUtilities/LinearAlgebra/SparseDiagBlkMatrix.hpp> #include <LibUtilities/LinearAlgebra/SparseDiagBlkMatrix.hpp>
......
...@@ -36,7 +36,6 @@ ...@@ -36,7 +36,6 @@
#include <LibUtilities/Communication/Xxt.hpp> #include <LibUtilities/Communication/Xxt.hpp>
#include <LibUtilities/BasicUtils/VDmathArray.hpp> #include <LibUtilities/BasicUtils/VDmathArray.hpp>
#include <MultiRegions/GlobalLinSysXxtStaticCond.h> #include <MultiRegions/GlobalLinSysXxtStaticCond.h>
#include <LibUtilities/BasicUtils/Timer.h>
using namespace std; using namespace std;
......
...@@ -126,7 +126,7 @@ private: ...@@ -126,7 +126,7 @@ private:
int m_checksteps; int m_checksteps;
int NumVar_SFD; int NumVar_SFD;
Timer timer; LibUtilities::Timer timer;
NekDouble cpuTime; NekDouble cpuTime;
NekDouble totalTime; NekDouble totalTime;
NekDouble elapsed; NekDouble elapsed;
......
...@@ -249,7 +249,7 @@ namespace Nektar ...@@ -249,7 +249,7 @@ namespace Nektar
"Only one of IO_CheckTime and IO_CheckSteps " "Only one of IO_CheckTime and IO_CheckSteps "
"should be set!"); "should be set!");
Timer timer; LibUtilities::Timer timer;
bool doCheckTime = false; bool doCheckTime = false;
int step = m_initialStep; int step = m_initialStep;
NekDouble intTime = 0.0; NekDouble intTime = 0.0;
......
...@@ -20,7 +20,7 @@ int main(int argc, char *argv[]) ...@@ -20,7 +20,7 @@ int main(int argc, char *argv[])
NekDouble lambda; NekDouble lambda;
vector<string> vFilenames; vector<string> vFilenames;
//defining timing variables //defining timing variables
Timer timer; LibUtilities::Timer timer;
NekDouble exeTime, fullTime, ppTime = 0.0; NekDouble exeTime, fullTime, ppTime = 0.0;
if(argc < 6)//< allows to parse "verbose" option if(argc < 6)//< allows to parse "verbose" option
......
...@@ -20,7 +20,7 @@ int main(int argc, char *argv[]) ...@@ -20,7 +20,7 @@ int main(int argc, char *argv[])
NekDouble lambda; NekDouble lambda;
vector<string> vFilenames; vector<string> vFilenames;
//defining timing variables //defining timing variables
Timer timer; LibUtilities::Timer timer;
NekDouble exeTime, fullTime, ppTime = 0.0; NekDouble exeTime, fullTime, ppTime = 0.0;
if(argc < 6)//< is added to be able to submit "verbose" option if(argc < 6)//< is added to be able to submit "verbose" option
......
...@@ -20,7 +20,7 @@ int main(int argc, char *argv[]) ...@@ -20,7 +20,7 @@ int main(int argc, char *argv[])
NekDouble lambda; NekDouble lambda;
vector<string> vFilenames; vector<string> vFilenames;
//defining timing variables //defining timing variables
Timer timer; LibUtilities::Timer timer;
NekDouble exeTime, fullTime, ppTime; NekDouble exeTime, fullTime, ppTime;
if(argc < 6)//< allows to parse "verbose" option if(argc < 6)//< allows to parse "verbose" option
......
...@@ -20,7 +20,7 @@ int main(int argc, char *argv[]) ...@@ -20,7 +20,7 @@ int main(int argc, char *argv[])
NekDouble lambda; NekDouble lambda;
vector<string> vFilenames; vector<string> vFilenames;
//defining timing variables //defining timing variables
Timer timer; LibUtilities::Timer timer;
NekDouble exeTime, fullTime, ppTime; NekDouble exeTime, fullTime, ppTime;
if(argc < 6)//< is used to be able to submit "verbose" option if(argc < 6)//< is used to be able to submit "verbose" option
......
...@@ -455,7 +455,7 @@ namespace Nektar ...@@ -455,7 +455,7 @@ namespace Nektar
::AllocateSharedPtr(nsize_p_m1,nsize_p_m1,blkmatStorage); ::AllocateSharedPtr(nsize_p_m1,nsize_p_m1,blkmatStorage);
Timer timer; LibUtilities::Timer timer;
timer.Start(); timer.Start();
for(n = 0; n < nel; ++n) for(n = 0; n < nel; ++n)
{ {
...@@ -1445,7 +1445,7 @@ namespace Nektar ...@@ -1445,7 +1445,7 @@ namespace Nektar
} }
case eSteadyNavierStokes: case eSteadyNavierStokes:
{ {
Timer Generaltimer; LibUtilities::Timer Generaltimer;
Generaltimer.Start(); Generaltimer.Start();
int Check(0); int Check(0);
...@@ -1562,7 +1562,7 @@ namespace Nektar ...@@ -1562,7 +1562,7 @@ namespace Nektar
void CoupledLinearNS::SolveSteadyNavierStokes(void) void CoupledLinearNS::SolveSteadyNavierStokes(void)
{ {
Timer Newtontimer; LibUtilities::Timer Newtontimer;
Newtontimer.Start(); Newtontimer.Start();
Array<OneD, Array<OneD, NekDouble> > RHS_Coeffs(m_velocity.num_elements()); Array<OneD, Array<OneD, NekDouble> > RHS_Coeffs(m_velocity.num_elements());
......
...@@ -489,7 +489,7 @@ namespace Nektar ...@@ -489,7 +489,7 @@ namespace Nektar
// Time loop // Time loop
for(n = 0; n < m_steps; ++n) for(n = 0; n < m_steps; ++n)
{ {
Timer timer; LibUtilities::Timer timer;
timer.Start(); timer.Start();
fields = m_intScheme->TimeIntegrate(n,m_timestep,m_intSoln,m_ode); fields = m_intScheme->TimeIntegrate(n,m_timestep,m_intSoln,m_ode);
//cout<<"integration: "<<fields[0][fields[0].num_elements()-1]<<endl; //cout<<"integration: "<<fields[0][fields[0].num_elements()-1]<<endl;
......
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
#include <string> #include <string>
#include <boost/algorithm/string.hpp> #include <boost/algorithm/string.hpp>
#include <boost/program_options.hpp> #include <boost/program_options.hpp>
#include <LibUtilities/BasicUtils/Timer.h>
#include <FieldUtils/Module.h> #include <FieldUtils/Module.h>
using namespace std; using namespace std;
...@@ -50,7 +51,7 @@ void RunModule(ModuleSharedPtr module, po::variables_map &vm, bool verbose); ...@@ -50,7 +51,7 @@ void RunModule(ModuleSharedPtr module, po::variables_map &vm, bool verbose);
int main(int argc, char* argv[]) int main(int argc, char* argv[])
{ {
Timer timer; LibUtilities::Timer timer;
timer.Start(); timer.Start();
po::options_description desc("Available options"); po::options_description desc("Available options");
...@@ -649,7 +650,7 @@ void PrintExecutionSequence(vector<ModuleSharedPtr> &modules) ...@@ -649,7 +650,7 @@ void PrintExecutionSequence(vector<ModuleSharedPtr> &modules)
void RunModule(ModuleSharedPtr module, po::variables_map &vm, bool verbose) void RunModule(ModuleSharedPtr module, po::variables_map &vm, bool verbose)
{ {
Timer moduleTimer; LibUtilities::Timer moduleTimer;
if(verbose) if(verbose)
{ {
moduleTimer.Start(); moduleTimer.Start();
......
...@@ -299,7 +299,7 @@ void ProcessVarOpti::Process() ...@@ -299,7 +299,7 @@ void ProcessVarOpti::Process()
Thread::ThreadManagerSharedPtr tm = Thread::ThreadManagerSharedPtr tm =
tms.CreateInstance(Thread::ThreadMaster::SessionJob, nThreads); tms.CreateInstance(Thread::ThreadMaster::SessionJob, nThreads);
Timer t; LibUtilities::Timer t;
t.Start(); t.Start();
ofstream resFile; ofstream resFile;
......
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