DOLFIN
DOLFIN C++ interface
Loading...
Searching...
No Matches
timing.h
1// Copyright (C) 2005-2010 Anders Logg, 2015 Jan Blechta
2//
3// This file is part of DOLFIN.
4//
5// DOLFIN is free software: you can redistribute it and/or modify
6// it under the terms of the GNU Lesser General Public License as published by
7// the Free Software Foundation, either version 3 of the License, or
8// (at your option) any later version.
9//
10// DOLFIN is distributed in the hope that it will be useful,
11// but WITHOUT ANY WARRANTY; without even the implied warranty of
12// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13// GNU Lesser General Public License for more details.
14//
15// You should have received a copy of the GNU Lesser General Public License
16// along with DOLFIN. If not, see <http://www.gnu.org/licenses/>.
17
18#ifndef __TIMING_H
19#define __TIMING_H
20
21#include <string>
22#include <cstdint>
23#include <dolfin/log/Table.h>
24
27
28namespace dolfin
29{
33 enum class TimingClear : bool { keep = false, clear = true };
34
42 enum class TimingType : int { wall = 0, user = 1, system = 2 };
43
45 void tic();
46
48 double toc();
49
51 double time();
52
67 Table timings(TimingClear clear, std::set<TimingType> type);
68
79 void list_timings(TimingClear clear, std::set<TimingType> type);
80 // NOTE: Function marked as 'collective on COMM_WORLD' (instead of
81 // 'collective on Logger::mpi_comm()') as user has no clue what the
82 // function has to do with Logger
83
95 void dump_timings_to_xml(std::string filename, TimingClear clear);
96 // NOTE: Function marked as 'collective on COMM_WORLD' (instead of
97 // 'collective on Logger::mpi_comm()') as user has no clue what the
98 // function has to do with Logger
99
114 std::tuple<std::size_t, double, double, double>
115 timing(std::string task, TimingClear clear);
116
117}
118
119#endif
Definition adapt.h:30
std::tuple< std::size_t, double, double, double > timing(std::string task, TimingClear clear)
Definition timing.cpp:69
double toc()
Return elapsed wall time (should not be used internally in DOLFIN!)
Definition timing.cpp:43
void list_timings(TimingClear clear, std::set< TimingType > type)
Definition timing.cpp:58
double time()
Return wall time elapsed since some implementation dependent epoch.
Definition timing.cpp:48
TimingClear
Definition timing.h:33
void dump_timings_to_xml(std::string filename, TimingClear clear)
Definition timing.cpp:63
TimingType
Definition timing.h:42
Table timings(TimingClear clear, std::set< TimingType > type)
Definition timing.cpp:53
void tic()
Start timing (should not be used internally in DOLFIN!)
Definition timing.cpp:38