Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cdo
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mpim-sw
cdo
Commits
2978f63b
Commit
2978f63b
authored
4 weeks ago
by
Uwe Schulzweida
Browse files
Options
Downloads
Patches
Plain Diff
Call FileStream::enableTimers()
parent
33accb73
No related branches found
Branches containing commit
No related tags found
1 merge request
!352
config/default: added -fsanitize=signed-integer-overflow...
Pipeline
#103087
passed
4 weeks ago
Stage: build
Stage: check
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/cdo.cc
+14
-6
14 additions, 6 deletions
src/cdo.cc
src/fileStream.h
+4
-1
4 additions, 1 deletion
src/fileStream.h
with
18 additions
and
7 deletions
src/cdo.cc
+
14
−
6
View file @
2978f63b
...
...
@@ -40,6 +40,7 @@
#include
"parser.h"
#include
"factory.h"
#include
"cdo_def_options.h"
#include
"fileStream.h"
static
ProcessManager
g_processManager
;
...
...
@@ -347,17 +348,21 @@ static void
timer_report
(
std
::
vector
<
cdo
::
iTimer
*>
&
timers
)
{
FILE
*
fp
=
stdout
;
fprintf
(
fp
,
"
\n
Timer report: shift = %g
\n
"
,
cdo
::
timerShift
);
if
(
Options
::
cdoVerbose
)
fprintf
(
fp
,
"
\n
Timer report: shift = %g
\n
"
,
cdo
::
timerShift
);
fprintf
(
fp
,
" Name Calls Min Average Max Total
\n
"
);
for
(
auto
&
timer
:
timers
)
{
auto
total
=
timer
->
elapsed
();
auto
avg
=
timer
->
sum
;
if
(
timer
->
calls
>
0
)
avg
/=
timer
->
calls
;
if
(
timer
->
calls
>
0
)
{
auto
total
=
timer
->
elapsed
();
auto
avg
=
timer
->
sum
;
avg
/=
timer
->
calls
;
// if (timer.stat != rt_stat_undef)
fprintf
(
fp
,
"%8s %7d %12.4g %12.4g %12.4g %12.4g
\n
"
,
timer
->
name
.
c_str
(),
timer
->
calls
,
timer
->
min
,
avg
,
timer
->
max
,
total
);
// if (timer.stat != rt_stat_undef)
fprintf
(
fp
,
"%8s %7d %12.4g %12.4g %12.4g %12.4g
\n
"
,
timer
->
name
.
c_str
(),
timer
->
calls
,
timer
->
min
,
avg
,
timer
->
max
,
total
);
}
}
}
...
...
@@ -438,6 +443,9 @@ main(int argc, char *argv[])
allTimers
.
push_back
(
&
cdo
::
writeTimer
);
g_processManager
.
buildProcessTree
(
processStructure
);
FileStream
::
enableTimers
(
g_processManager
.
get_num_processes
()
==
1
&&
Threading
::
ompNumMaxThreads
==
1
);
// if (g_processManager.get_num_processes() == 1) { cdiDefGlobal("NETCDF_LAZY_GRID_LOAD", true); }
totalTimer
.
start
();
g_processManager
.
run_processes
();
...
...
This diff is collapsed.
Click to expand it.
src/fileStream.h
+
4
−
1
View file @
2978f63b
...
...
@@ -47,11 +47,13 @@ public:
// FileStreamOnly
int
getFileID
();
static
void
enableTimers
(
const
bool
p_enable
)
enableTimers
(
bool
p_enable
)
{
FileStream
::
TimerEnabled
=
p_enable
;
}
static
bool
timersEnabled
()
{
...
...
@@ -65,6 +67,7 @@ protected:
private
:
std
::
string
m_filename
;
void
checkDatarange
(
int
varID
,
double
*
array
,
size_t
numMissVals
);
protected
:
FileStream
()
=
default
;
};
...
...
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