registration.h Source File

CPP API: registration.h Source File
registration.h
Go to the documentation of this file.
1 /*
2 * Copyright (C) 2020-2026 MEmilio
3 *
4 * Authors: Rene Schmieding
5 *
6 * Contact: Martin J. Kuehn <Martin.Kuehn@DLR.de>
7 *
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
11 *
12 * http://www.apache.org/licenses/LICENSE-2.0
13 *
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
19 */
20 #ifndef MIO_TIMER_REGISTRATION_H
21 #define MIO_TIMER_REGISTRATION_H
22 
25 
26 #include <list>
27 #include <string>
28 
29 namespace mio
30 {
31 namespace timing
32 {
33 
36  std::string name;
37  std::string scope;
39  int thread_id;
40  int rank;
41 };
42 
48 inline std::string qualified_name(const std::string& name, const std::string& scope)
49 {
50  return scope.empty() ? name : scope + "::" + name;
51 }
52 
54 struct Printer {
55  virtual void print(const std::list<TimerRegistration>&, std::ostream&) = 0;
56 
57  virtual ~Printer()
58  {
59  }
60 };
61 
62 } // namespace timing
63 } // namespace mio
64 
65 #endif // MIO_TIMER_REGISTRATION_H
A minimal timer class.
Definition: basic_timer.h:36
std::string qualified_name(const std::string &name, const std::string &scope)
If scope is empty, returns name.
Definition: registration.h:48
A collection of classes to simplify handling of matrix shapes in meta programming.
Definition: models/abm/analyze_result.h:30
Struct with a virtual print method to allow exchanging how TimerRegistrations are evaluated.
Definition: registration.h:54
virtual void print(const std::list< TimerRegistration > &, std::ostream &)=0
virtual ~Printer()
Definition: registration.h:57
Struct used to register (.
Definition: registration.h:35
std::string scope
Definition: registration.h:37
int rank
Definition: registration.h:40
std::string name
Definition: registration.h:36
BasicTimer & timer
Definition: registration.h:38
int thread_id
Definition: registration.h:39