Note: this is documentation for an old release. View the latest documentation at docs.fenicsproject.org/dolfinx/v0.9.0/cpp/doxygen/db/d41/timing_8h_source.html
DOLFINx 0.7.3
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 <dolfinx/common/Table.h>
10#include <mpi.h>
11#include <set>
12#include <string>
13#include <tuple>
14
15namespace dolfinx
16{
17
22enum class TimingType : int
23{
24 wall = 0,
25 user = 1,
26 system = 2
27};
28
33Table timings(std::set<TimingType> type);
34
41void list_timings(MPI_Comm comm, std::set<TimingType> type,
42 Table::Reduction reduction = Table::Reduction::max);
43
49std::tuple<std::size_t, double, double, double> timing(std::string task);
50
51} // namespace dolfinx
Reduction
Types of MPI reduction available for Table, to get the max, min or average values over an MPI_Comm.
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. MPI_AVG reduction is printed.
Definition timing.cpp:22
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:29
Table timings(std::set< TimingType > type)
Return a summary of timings and tasks in a Table.
Definition timing.cpp:17
TimingType
Timing types:
Definition timing.h:23