Taking time measures only if parallel.doMeasure() is true.
This commit is contained in:
parent
414e011296
commit
4ab5b2fd89
1 changed files with 14 additions and 6 deletions
|
|
@ -7,6 +7,8 @@
|
||||||
# include <vector>
|
# include <vector>
|
||||||
# include <map>
|
# include <map>
|
||||||
|
|
||||||
|
# include "utils/eoParallel.h"
|
||||||
|
|
||||||
# ifdef WITH_MPI
|
# ifdef WITH_MPI
|
||||||
# include <boost/serialization/access.hpp>
|
# include <boost/serialization/access.hpp>
|
||||||
# include <boost/serialization/vector.hpp>
|
# include <boost/serialization/vector.hpp>
|
||||||
|
|
@ -119,16 +121,22 @@ class eoTimerStat
|
||||||
|
|
||||||
void start( const std::string & key )
|
void start( const std::string & key )
|
||||||
{
|
{
|
||||||
_timers[ key ].restart();
|
if( eo::parallel.doMeasure() )
|
||||||
|
{
|
||||||
|
_timers[ key ].restart();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void stop( const std::string& key )
|
void stop( const std::string& key )
|
||||||
{
|
{
|
||||||
Stat & s = _stats[ key ];
|
if( eo::parallel.doMeasure() )
|
||||||
eoTimer & t = _timers[ key ];
|
{
|
||||||
s.utime.push_back( t.usertime() );
|
Stat & s = _stats[ key ];
|
||||||
s.stime.push_back( t.systime() );
|
eoTimer & t = _timers[ key ];
|
||||||
s.wtime.push_back( t.wallclock() );
|
s.utime.push_back( t.usertime() );
|
||||||
|
s.stime.push_back( t.systime() );
|
||||||
|
s.wtime.push_back( t.wallclock() );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
std::map< std::string, Stat > stats()
|
std::map< std::string, Stat > stats()
|
||||||
|
|
|
||||||
Reference in a new issue