n2p2 - A neural network potential package
Updater.cpp
Go to the documentation of this file.
1// n2p2 - A neural network potential package
2// Copyright (C) 2018 Andreas Singraber (University of Vienna)
3//
4// This program is free software: you can redistribute it and/or modify
5// it under the terms of the GNU General Public License as published by
6// the Free Software Foundation, either version 3 of the License, or
7// (at your option) any later version.
8//
9// This program is distributed in the hope that it will be useful,
10// but WITHOUT ANY WARRANTY; without even the implied warranty of
11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12// GNU General Public License for more details.
13//
14// You should have received a copy of the GNU General Public License
15// along with this program. If not, see <https://www.gnu.org/licenses/>.
16
17#include "Updater.h"
18
19using namespace std;
20using namespace nnp;
21
22Updater::Updater(size_t const sizeState) : timing (false ),
23 timingReset(true ),
24 sizeState (sizeState),
25 prefix ("" )
26{
27}
28
29void Updater::setupTiming(string const& prefix)
30{
31 this->prefix = prefix;
32 timing = true;
33
34 return;
35}
36
37std::map<std::string, Stopwatch> Updater::getTiming() const
38{
39 return sw;
40}
41
43{
44 timingReset = false;
45 return;
46}
virtual std::map< std::string, Stopwatch > getTiming() const
Return timings gathered in stopwatch map.
Definition: Updater.cpp:37
std::string prefix
Prefix for timing stopwatches.
Definition: Updater.h:112
virtual void resetTimingLoop()
Start a new timing loop (e.g.
Definition: Updater.cpp:42
bool timingReset
Internal loop timer reset switch.
Definition: Updater.h:108
bool timing
Whether detailed timing is enabled.
Definition: Updater.h:106
virtual void setupTiming(std::string const &prefix="upd")
Activate detailed timing.
Definition: Updater.cpp:29
std::map< std::string, Stopwatch > sw
Stopwatch map for timing.
Definition: Updater.h:114
Definition: Atom.h:29