Loading...
Searching...
No Matches
timing.h
// Copyright (C) 2005-2010 Anders Logg, 2015 Jan Blechta
//
// This file is part of DOLFIN.
//
// DOLFIN is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// DOLFIN is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with DOLFIN. If not, see <http://www.gnu.org/licenses/>.
#ifndef __TIMING_H
#define __TIMING_H
#include <string>
#include <cstdint>
#include <dolfin/log/Table.h>
namespace dolfin
{
enum class TimingClear : bool { keep = false, clear = true };
enum class TimingType : int { wall = 0, user = 1, system = 2 };
void tic();
double toc();
double time();
Table timings(TimingClear clear, std::set<TimingType> type);
void list_timings(TimingClear clear, std::set<TimingType> type);
// NOTE: Function marked as 'collective on COMM_WORLD' (instead of
// 'collective on Logger::mpi_comm()') as user has no clue what the
// function has to do with Logger
void dump_timings_to_xml(std::string filename, TimingClear clear);
// NOTE: Function marked as 'collective on COMM_WORLD' (instead of
// 'collective on Logger::mpi_comm()') as user has no clue what the
// function has to do with Logger
std::tuple<std::size_t, double, double, double>
timing(std::string task, TimingClear clear);
}
#endif
dolfin
Definition adapt.h:30
dolfin::timing
std::tuple< std::size_t, double, double, double > timing(std::string task, TimingClear clear)
Definition timing.cpp:69
dolfin::toc
double toc()
Return elapsed wall time (should not be used internally in DOLFIN!).
Definition timing.cpp:43
dolfin::list_timings
void list_timings(TimingClear clear, std::set< TimingType > type)
Definition timing.cpp:58
dolfin::time
double time()
Return wall time elapsed since some implementation dependent epoch.
Definition timing.cpp:48
dolfin::TimingClear
TimingClear
Definition timing.h:33
dolfin::dump_timings_to_xml
void dump_timings_to_xml(std::string filename, TimingClear clear)
Definition timing.cpp:63
dolfin::TimingType
TimingType
Definition timing.h:42
dolfin::timings
Table timings(TimingClear clear, std::set< TimingType > type)
Definition timing.cpp:53
dolfin::tic
void tic()
Start timing (should not be used internally in DOLFIN!).
Definition timing.cpp:38