Zoltan2
Loading...
Searching...
No Matches
Zoltan2_TimerManager.hpp
Go to the documentation of this file.
1// @HEADER
2// *****************************************************************************
3// Zoltan2: A package of combinatorial algorithms for scientific computing
4//
5// Copyright 2012 NTESS and the Zoltan2 contributors.
6// SPDX-License-Identifier: BSD-3-Clause
7// *****************************************************************************
8// @HEADER
9
14#ifndef ZOLTAN2_TIMERMANAGER_HPP
15#define ZOLTAN2_TIMERMANAGER_HPP
16
17#include <Zoltan2_Standards.hpp>
19#include <Teuchos_TimeMonitor.hpp>
20
21#include <map>
22#include <iostream>
23#include <fstream>
24#include <bitset>
25
26namespace Zoltan2{
27
29
30private:
31 RCP<const Comm<int> > comm_;
32 std::ostream *myOS_;
33 std::ofstream *fileOS_;
34 TimerType ttype_;
35 std::bitset<NUM_TIMING_OPTIONS> typeSelector_;
36
37 Array<RCP<Teuchos::Time> > timers_;
38 std::map<std::string, int> timerMap_;
39 int stopHint_;
40
41public:
42
45 TimerManager(const RCP<const Comm<int> > & comm, std::ofstream *of,
46 TimerType tt);
47
50 TimerManager(const RCP<const Comm<int> > & comm, std::ostream *os,
51 TimerType tt);
52
56
59 void start(TimerType tt, const std::string &name);
60
63 void stop(TimerType tt, const std::string &name);
64
68
71 void print() const;
72};
73
74} // namespace Zoltan2
75
76#endif
Defines Parameter related enumerators, declares functions.
Gathering definitions used in software development.
void stop(TimerType tt, const std::string &name)
Stop the named timer.
void print() const
Print out global summary, do not reset timers.
void start(TimerType tt, const std::string &name)
Start the named timer.
void printAndResetToZero()
Print out global summary of timers and reset timers to zero.
Created by mbenlioglu on Aug 31, 2020.
TimerType
The type of timers which should be active.