Loading...
Searching...
No Matches
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-2023 OpenCFD Ltd.
9-------------------------------------------------------------------------------
10License
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
26Class
27 Foam::functionObjects::parProfiling
28
29Group
30 grpUtilitiesFunctionObjects
31
32Description
33 Simple (simplistic) mpi-profiling.
34
35Usage
36 Minimal example by using \c system/controlDict.functions:
37 \verbatim
38 profilingFO
39 {
40 // Mandatory entries
41 type parProfiling;
42 libs (utilityFunctionObjects);
43
44 // Optional entries
45 detail <int>; // 0;
46
47 // Inherited entries
48 // Report stats on exit only (instead of every time step)
49 executeControl onEnd;
50 writeControl none;
51 ...
52 }
53 \endverbatim
54
55 where the entries mean:
56 \table
57 Property | Description | Type | Reqd | Deflt
58 type | Type name: parProfiling | word | yes | -
59 libs | Library name: utilityFunctionObjects | word | yes | -
60 detail | The reporting level | int | no | 0
61 \endtable
62
63 The inherited entries are elaborated in:
64 - \link functionObject.H \endlink
65
66SourceFiles
67 parProfiling.C
68
69\*---------------------------------------------------------------------------*/
70
71#ifndef Foam_functionObjects_parProfiling_H
72#define Foam_functionObjects_parProfiling_H
73
74#include "functionObject.H"
75
76// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
77
78namespace Foam
79{
80namespace functionObjects
81{
82
83/*---------------------------------------------------------------------------*\
84 Class parProfiling Declaration
85\*---------------------------------------------------------------------------*/
86
87class parProfiling
88:
89 public functionObject
90{
91 // Private Data
92
93 //- The reporting level
94 // 0: summary, 1: per-proc times, 2: per-proc times/counts
95 int reportLevel_;
96
97public:
98
99 // Generated Methods
100
101 //- No copy construct
102 parProfiling(const parProfiling&) = delete;
103
104 //- No copy assignment
105 void operator=(const parProfiling&) = delete;
107
108 //- Runtime type information
109 TypeName("parProfiling");
110
111
112 // Constructors
113
114 //- Construct from name, Time and dictionary. Enables profilingPstream
116 (
117 const word& name,
118 const Time& runTime,
119 const dictionary& dict
120 );
121
122
123 //- Destructor. Disables profilingPstream
124 virtual ~parProfiling();
125
127 // Member Functions
128
129 //- Report the current profiling information
130 void report();
132 //- Execute the function-object operations
133 virtual bool execute();
134
135 //- Write the function-object results (no-op)
136 virtual bool write();
138 //- Disables profilingPstream
139 virtual bool end();
140};
141
142
143// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
144
145} // End namespace functionObjects
146} // End namespace Foam
147
148// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
149
150#endif
151
152// ************************************************************************* //
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition Time.H:75
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
const word & name() const noexcept
Return the name of this functionObject.
functionObject(const word &name, const bool withNamePrefix=defaultUseNamePrefix)
Construct from components.
Simple (simplistic) mpi-profiling.
virtual ~parProfiling()
Destructor. Disables profilingPstream.
TypeName("parProfiling")
Runtime type information.
parProfiling(const parProfiling &)=delete
No copy construct.
virtual bool execute()
Execute the function-object operations.
void report()
Report the current profiling information.
virtual bool write()
Write the function-object results (no-op).
virtual bool end()
Disables profilingPstream.
void operator=(const parProfiling &)=delete
No copy assignment.
A class for handling words, derived from Foam::string.
Definition word.H:66
engineTime & runTime
Function objects are OpenFOAM utilities to ease workflow configurations and enhance workflows.
Namespace for OpenFOAM.
dictionary dict
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition typeInfo.H:68