Debian Codegraph @

packages/shylu/shylu_dd/frosch/src/Tools/FROSch_Timers.h

raw
1 // @HEADER
2 // *****************************************************************************
3 // ShyLU: Scalable Hybrid LU Preconditioner and Solver
4 //
5 // Copyright 2011 NTESS and the ShyLU contributors.
6 // SPDX-License-Identifier: BSD-3-Clause
7 // *****************************************************************************
8 // @HEADER
9
10 #ifndef _FROSCH_TIMERS_HPP
11 #define _FROSCH_TIMERS_HPP
12
13 #include <ShyLU_DDFROSch_config.h>
14
15 // The level of detail of the timers used in FROSch is determined by FROSCH_TIMER_DETAILS
16 // Currently, we support no timers (0), selected timers (1), and all timers (2)
17 #ifndef FROSCH_TIMER_DETAILS
18 #define FROSCH_TIMER_DETAILS 1
19 #endif
20
21 #if FROSCH_TIMER_DETAILS > 1
22 #ifndef FROSCH_TIMER_START
23 #define FROSCH_TIMER_START(A,S) Teuchos::RCP<Teuchos::TimeMonitor> A = rcp(new Teuchos::TimeMonitor(*Teuchos::TimeMonitor::getNewTimer(std::string("FROSch: ") + std::string(S))));
24 #endif
25
26 #ifndef FROSCH_TIMER_START_LEVELID
27 #define FROSCH_TIMER_START_LEVELID(A,S) Teuchos::RCP<Teuchos::TimeMonitor> A = rcp(new Teuchos::TimeMonitor(*Teuchos::TimeMonitor::getNewTimer(std::string("FROSch: ") + std::string(S) + " (Level " + std::to_string(this->LevelID_) + std::string(")"))));
28 #endif
29
30 #ifndef FROSCH_TIMER_STOP
31 #define FROSCH_TIMER_STOP(A) A.reset();
32 #endif
33
34 #ifndef FROSCH_DETAILTIMER_START
35 #define FROSCH_DETAILTIMER_START(A,S) FROSCH_TIMER_START(A,S);
36 #endif
37
38 #ifndef FROSCH_DETAILTIMER_START_LEVELID
39 #define FROSCH_DETAILTIMER_START_LEVELID(A,S) FROSCH_TIMER_START_LEVELID(A,S);
40 #endif
41
42 #ifndef FROSCH_DETAILTIMER_STOP
43 #define FROSCH_DETAILTIMER_STOP(A) FROSCH_TIMER_STOP(A);
44 #endif
45
46 #ifndef FROSCH_TIMER_START_SOLVER
47 #define FROSCH_TIMER_START_SOLVER(A,S) Teuchos::RCP<Teuchos::TimeMonitor> A = rcp(new Teuchos::TimeMonitor(*Teuchos::TimeMonitor::getNewTimer(std::string("FROSch: ") + std::string(S) + " (" + this->Description_ + std::string(")"))));
48 #endif
49
50 #ifndef FROSCH_TIMER_START_SUBDOMAINSOLVER
51 #define FROSCH_TIMER_START_SUBDOMAINSOLVER(A,S) Teuchos::RCP<Teuchos::TimeMonitor> A = rcp(new Teuchos::TimeMonitor(*Teuchos::TimeMonitor::getNewTimer(std::string("FROSch: ") + std::string(S) + " (" + this->Description_ + std::string(")"))));
52 #endif
53 #elif FROSCH_TIMER_DETAILS == 1
54 #ifndef FROSCH_TIMER_START
55 #define FROSCH_TIMER_START(A,S) Teuchos::RCP<Teuchos::TimeMonitor> A = rcp(new Teuchos::TimeMonitor(*Teuchos::TimeMonitor::getNewTimer(std::string("FROSch: ") + std::string(S))));
56 #endif
57
58 #ifndef FROSCH_TIMER_START_LEVELID
59 #define FROSCH_TIMER_START_LEVELID(A,S) Teuchos::RCP<Teuchos::TimeMonitor> A = rcp(new Teuchos::TimeMonitor(*Teuchos::TimeMonitor::getNewTimer(std::string("FROSch: ") + std::string(S) + " (Level " + std::to_string(this->LevelID_) + std::string(")"))));
60 #endif
61
62 #ifndef FROSCH_TIMER_STOP
63 #define FROSCH_TIMER_STOP(A) A.reset();
64 #endif
65
66 #ifndef FROSCH_DETAILTIMER_START
67 #define FROSCH_DETAILTIMER_START(A,S)
68 #endif
69
70 #ifndef FROSCH_DETAILTIMER_START_LEVELID
71 #define FROSCH_DETAILTIMER_START_LEVELID(A,S)
72 #endif
73
74 #ifndef FROSCH_DETAILTIMER_STOP
75 #define FROSCH_DETAILTIMER_STOP(A)
76 #endif
77
78 #ifndef FROSCH_TIMER_START_SOLVER
79 #define FROSCH_TIMER_START_SOLVER(A,S)
80 #endif
81
82 #ifndef FROSCH_TIMER_START_SUBDOMAINSOLVER
83 #define FROSCH_TIMER_START_SUBDOMAINSOLVER(A,S)
84 #endif
85 #else
86 #ifndef FROSCH_TIMER_START
87 #define FROSCH_TIMER_START(A,S)
88 #endif
89
90 #ifndef FROSCH_TIMER_START_LEVELID
91 #define FROSCH_TIMER_START_LEVELID(A,S)
92 #endif
93
94 #ifndef FROSCH_TIMER_STOP
95 #define FROSCH_TIMER_STOP(A)
96 #endif
97
98 #ifndef FROSCH_DETAILTIMER_START
99 #define FROSCH_DETAILTIMER_START(A,S)
100 #endif
101
102 #ifndef FROSCH_DETAILTIMER_START_LEVELID
103 #define FROSCH_DETAILTIMER_START_LEVELID(A,S)
104 #endif
105
106 #ifndef FROSCH_DETAILTIMER_STOP
107 #define FROSCH_DETAILTIMER_STOP(A)
108 #endif
109
110 #ifndef FROSCH_TIMER_START_SOLVER
111 #define FROSCH_TIMER_START_SOLVER(A,S)
112 #endif
113
114 #ifndef FROSCH_TIMER_START_SUBDOMAINSOLVER
115 #define FROSCH_TIMER_START_SUBDOMAINSOLVER(A,S)
116 #endif
117 #endif
118
119 #endif