DOLFINx 0.9.0
DOLFINx 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 DOLFINx (https://www.fenicsproject.org)
4//
5// SPDX-License-Identifier: LGPL-3.0-or-later
6
7#pragma once
8
9#include "Table.h"
10#include <mpi.h>
11#include <set>
12#include <string>
13#include <tuple>
14
15namespace dolfinx
16{
18enum class TimingType : int
19{
20 wall = 0,
21 user = 1,
22 system = 2
23};
24
28Table timings(std::set<TimingType> type);
29
37void list_timings(MPI_Comm comm, std::set<TimingType> type,
38 Table::Reduction reduction = Table::Reduction::max);
39
45std::tuple<std::size_t, double, double, double> timing(std::string task);
46
47} // namespace dolfinx
Reduction
Definition Table.h:33
Top-level namespace.
Definition defines.h:12
void list_timings(MPI_Comm comm, std::set< TimingType > type, Table::Reduction reduction=Table::Reduction::max)
List a summary of timings and tasks.
Definition timing.cpp:19
std::tuple< std::size_t, double, double, double > timing(std::string task)
Return timing (count, total wall time, total user time, total system time) for given task.
Definition timing.cpp:26
Table timings(std::set< TimingType > type)
Return a summary of timings and tasks in a Table.
Definition timing.cpp:14
TimingType
Timing types.
Definition timing.h:19
@ wall
Wall-clock time.
@ system
System (kernel) time.
@ user
User (cpu) time.