ergo
SCF_statistics.h
Go to the documentation of this file.
1 /* Ergo, version 3.7, a program for linear scaling electronic structure
2  * calculations.
3  * Copyright (C) 2018 Elias Rudberg, Emanuel H. Rubensson, Pawel Salek,
4  * and Anastasia Kruchinina.
5  *
6  * This program is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation, either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program. If not, see <http://www.gnu.org/licenses/>.
18  *
19  * Primary academic reference:
20  * Ergo: An open-source program for linear-scaling electronic structure
21  * calculations,
22  * Elias Rudberg, Emanuel H. Rubensson, Pawel Salek, and Anastasia
23  * Kruchinina,
24  * SoftwareX 7, 107 (2018),
25  * <http://dx.doi.org/10.1016/j.softx.2018.03.005>
26  *
27  * For further information about Ergo, see <http://www.ergoscf.org>.
28  */
29 
38 #ifndef SCF_STATISTICS_HEADER
39 #define SCF_STATISTICS_HEADER
40 #include <map>
41 #include "utilities.h"
42 
43 struct SCF_timer {
44  SCF_timer();
45  void stop();
48  double elapsedTimeWall;
49 private:
52  double startTimeWall;
54 };
55 
56 
58  typedef std::map<std::string, SCF_timer> TimerMap;
59  typedef std::map<std::string, double> ValueMap;
60  public:
61  void start_timer(std::string identifier);
62  void stop_timer(std::string identifier);
63  void add_value(std::string identifier, double value);
64  void add_values( ValueMap & values_to_add);
65  void output_mfile(std::string name);
66  protected:
69  private:
70  void output_value( std::ofstream & os, std::string id, double value);
71 
72 };
73 
74 
75 
76 
77 #endif
78 
double elapsedTimeCPU_sys
Definition: SCF_statistics.h:46
void output_value(std::ofstream &os, std::string id, double value)
Definition: SCF_statistics.cc:138
Basic OS access utilities.
double elapsedTimeCPU_usr
Definition: SCF_statistics.h:47
std::map< std::string, double > ValueMap
Definition: SCF_statistics.h:59
Definition: SCF_statistics.h:57
double startTimeCPU_sys
Definition: SCF_statistics.h:50
void stop()
Definition: SCF_statistics.cc:48
double startTimeWall
Definition: SCF_statistics.h:52
void start_timer(std::string identifier)
Definition: SCF_statistics.cc:59
double startTimeCPU_usr
Definition: SCF_statistics.h:51
Definition: SCF_statistics.h:43
ValueMap values
Definition: SCF_statistics.h:68
void stop_timer(std::string identifier)
Definition: SCF_statistics.cc:62
void add_values(ValueMap &values_to_add)
Definition: SCF_statistics.cc:74
std::map< std::string, SCF_timer > TimerMap
Definition: SCF_statistics.h:58
SCF_timer()
Definition: SCF_statistics.cc:42
void output_mfile(std::string name)
Definition: SCF_statistics.cc:81
double elapsedTimeWall
Definition: SCF_statistics.h:48
TimerMap timers
Definition: SCF_statistics.h:67
bool stopped_already
Definition: SCF_statistics.h:53
void add_value(std::string identifier, double value)
Definition: SCF_statistics.cc:68