parProfiling.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2019-2020 OpenCFD Ltd.
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::functionObjects::parProfiling
28 
29 Group
30  grpUtilitiesFunctionObjects
31 
32 Description
33  Simple (simplistic) mpi-profiling.
34 
35 Usage
36  Example of function object specification:
37  \verbatim
38  profiling
39  {
40  type parProfiling;
41  libs (utilityFunctionObjects);
42 
43  // Report stats on exit only (instead of every time step)
44  executeControl onEnd;
45  writeControl none;
46  }
47  \endverbatim
48 
49 SourceFiles
50  parProfiling.C
51 
52 \*---------------------------------------------------------------------------*/
53 
54 #ifndef functionObjects_parProfiling_H
55 #define functionObjects_parProfiling_H
56 
57 #include "functionObject.H"
58 
59 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
60 
61 namespace Foam
62 {
63 
64 // Forward declaration of classes
65 class Time;
66 
67 namespace functionObjects
68 {
69 
70 /*---------------------------------------------------------------------------*\
71  Class parProfiling Declaration
72 \*---------------------------------------------------------------------------*/
73 
74 class parProfiling
75 :
76  public functionObject
77 {
78  // Private Member Functions
79 
80  //- No copy construct
81  parProfiling(const parProfiling&) = delete;
82 
83  //- No copy assignment
84  void operator=(const parProfiling&) = delete;
85 
86 
87 public:
88 
89  //- Runtime type information
90  TypeName("parProfiling");
91 
92 
93  // Constructors
94 
95  //- Construct from Time and dictionary
97  (
98  const word& name,
99  const Time& runTime,
100  const dictionary& dict
101  );
102 
103 
104  //- Destructor
105  virtual ~parProfiling();
106 
107 
108  // Member Functions
109 
110  //- Report the current profiling information
111  void report();
112 
113  //- Report
114  virtual bool execute();
115 
116  //- Do nothing
117  virtual bool write();
118 
119  //- Report
120  virtual bool end();
121 };
122 
123 
124 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
125 
126 } // End namespace functionObjects
127 } // End namespace Foam
128 
129 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
130 
131 #endif
132 
133 // ************************************************************************* //
runTime
engineTime & runTime
Definition: createEngineTime.H:13
Foam::Time
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:73
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::functionObjects::parProfiling::report
void report()
Report the current profiling information.
Definition: parProfiling.C:120
Foam::functionObjects::parProfiling::execute
virtual bool execute()
Report.
Definition: parProfiling.C:207
Foam::functionObject
Abstract base-class for Time/database function objects.
Definition: functionObject.H:332
Foam::functionObjects::parProfiling::end
virtual bool end()
Report.
Definition: parProfiling.C:220
Foam::functionObjects::parProfiling
Simple (simplistic) mpi-profiling.
Definition: parProfiling.H:73
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::functionObjects::parProfiling::write
virtual bool write()
Do nothing.
Definition: parProfiling.C:214
Foam::functionObject::name
const word & name() const noexcept
Return the name of this functionObject.
Definition: functionObject.C:143
Foam::functionObjects::parProfiling::TypeName
TypeName("parProfiling")
Runtime type information.
Foam::functionObjects::parProfiling::~parProfiling
virtual ~parProfiling()
Destructor.
Definition: parProfiling.C:112
functionObject.H