Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
OpenFOAM-plus
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Development
OpenFOAM-plus
Commits
ceb076db
Commit
ceb076db
authored
8 years ago
by
mark
Browse files
Options
Downloads
Patches
Plain Diff
ENH: support profiling on Time loop (issue
#441
)
- patch from Bernhard Gschaider
parent
c7cf0e8e
No related branches found
No related tags found
1 merge request
!121
Merge develop into master for v1706 release
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/OpenFOAM/db/Time/Time.C
+16
-0
16 additions, 0 deletions
src/OpenFOAM/db/Time/Time.C
src/OpenFOAM/db/Time/Time.H
+4
-0
4 additions, 0 deletions
src/OpenFOAM/db/Time/Time.H
with
20 additions
and
0 deletions
src/OpenFOAM/db/Time/Time.C
+
16
−
0
View file @
ceb076db
...
...
@@ -28,6 +28,7 @@ License
#include
"argList.H"
#include
"HashSet.H"
#include
"profiling.H"
#include
"demandDrivenData.H"
#include
<sstream>
...
...
@@ -414,6 +415,7 @@ Foam::Time::Time
objectRegistry
(
*
this
),
loopProfiling_
(
nullptr
),
libs_
(),
controlDict_
...
...
@@ -482,6 +484,7 @@ Foam::Time::Time
objectRegistry
(
*
this
),
loopProfiling_
(
nullptr
),
libs_
(),
controlDict_
...
...
@@ -559,6 +562,7 @@ Foam::Time::Time
objectRegistry
(
*
this
),
loopProfiling_
(
nullptr
),
libs_
(),
controlDict_
...
...
@@ -629,6 +633,7 @@ Foam::Time::Time
objectRegistry
(
*
this
),
loopProfiling_
(
nullptr
),
libs_
(),
controlDict_
...
...
@@ -672,6 +677,8 @@ Foam::Time::Time
Foam
::
Time
::~
Time
()
{
deleteDemandDrivenData
(
loopProfiling_
);
forAllReverse
(
controlDict_
.
watchIndices
(),
i
)
{
removeWatch
(
controlDict_
.
watchIndices
()[
i
]);
...
...
@@ -910,6 +917,8 @@ Foam::dimensionedScalar Foam::Time::endTime() const
bool
Foam
::
Time
::
run
()
const
{
deleteDemandDrivenData
(
loopProfiling_
);
bool
isRunning
=
value
()
<
(
endTime_
-
0
.
5
*
deltaT_
);
if
(
!
subCycling_
)
...
...
@@ -962,6 +971,13 @@ bool Foam::Time::run() const
// Update the "is-running" status following the
// possible side-effects from functionObjects
isRunning
=
value
()
<
(
endTime_
-
0
.
5
*
deltaT_
);
// (re)trigger profiling
if
(
profiling
::
active
())
{
loopProfiling_
=
new
profilingTrigger
(
"time.run() "
+
objectRegistry
::
name
());
}
}
return
isRunning
;
...
...
This diff is collapsed.
Click to expand it.
src/OpenFOAM/db/Time/Time.H
+
4
−
0
View file @
ceb076db
...
...
@@ -62,6 +62,7 @@ namespace Foam
// Forward declaration of classes
class
argList
;
class
profilingTrigger
;
/*---------------------------------------------------------------------------*\
Class Time Declaration
...
...
@@ -80,6 +81,9 @@ class Time
//- file-change monitor for all registered files
mutable
autoPtr
<
fileMonitor
>
monitorPtr_
;
//- Profiling trigger for time-loop (for run, loop)
mutable
profilingTrigger
*
loopProfiling_
;
//- Any loaded dynamic libraries. Make sure to construct before
// reading controlDict.
dlLibraryTable
libs_
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment