69 for (
int i = 0 ; i <
size_ ; ++i)
76 time_[timerID]->ResetStartTime();
80 inline int AddTime(
const std::string what,
int dataID,
const int timerID = 0)
91 timerID >= (
int)(
data_.
size()), std::logic_error,
92 "Amesos_Time::AddTime(...): Error, dataID="<<dataID
93 <<
" is >= data_.size()="<<
data_.
size() <<
" for dataName=\""<<what<<
"\"!"
97 data_[dataID].timeVal_ +=
time_[timerID]->ElapsedTime();
102 inline double GetTime(
const std::string what)
const
105 for (
int i=0; i<dataSize; ++i) {
106 if (
data_[i].timeName_ == what ) {
107 return data_[i].timeVal_;
117 if ( dataID < 0 || dataID >= (
int)(
data_.
size()) ) {
120 return data_[dataID].timeVal_;
127 for (
int i=0; i<dataSize; ++i) {
double timeVal_
Current timing data.
double GetTime(const int dataID) const
Gets the cumulative time using the dataID.
std::string timeName_
Character string identifying this timing data.
Amesos_Time_Data(std::string timeName, double timeVal)
Constructor.
Array< Amesos_Time_Data > data_
Fast accessable container for timing data.
ParameterList & set(std::string const &name, T const &value, std::string const &docString="", RCP< const ParameterEntryValidator > const &validator=null)
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
Amesos_Time_Data: Simple struct for storing associated data for Amesos_Time.
void CreateTimer(const Epetra_Comm &Comm, int size=1)
Initializes the Time object.
virtual ~Amesos_Time()
Default destructor.
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
void GetTiming(Teuchos::ParameterList &list) const
Load up the current timing information into the parameter list.
int size_
Number of Epetra_Time objects allocated in this object.
void resize(size_type new_size, const value_type &x=value_type())
Amesos_Time: Container for timing information.
int AddTime(const std::string what, int dataID, const int timerID=0)
Adds to field what the time elapsed since last call to ResetTimer().
void push_back(const value_type &x)
Amesos_Time()
Default constructor to create size timers.
virtual ~Amesos_Time_Data()
Destructor.
Array< RCP< Epetra_Time > > time_
Time object.
void ResetTimer(const int timerID=0)
Resets the internally stored time object.
double GetTime(const std::string what) const
Gets the cumulative time using the string.