Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mpim-sw
cdo
Commits
273cfaf8
Commit
273cfaf8
authored
Nov 07, 2017
by
Uwe Schulzweida
Browse files
Use getPeakRSS().
parent
b136647c
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/process.cc
View file @
273cfaf8
...
...
@@ -1241,8 +1241,11 @@ processClosePipes(void)
}
}
void
cdoFinish
(
void
)
extern
"C"
{
size_t
getPeakRSS
(
);
}
void
cdoFinish
(
void
)
{
int
processID
=
processSelf
().
m_ID
;
int
nvars
,
ntimesteps
;
...
...
@@ -1327,9 +1330,7 @@ cdoFinish(void)
{
int
mu
[]
=
{
'b'
,
'k'
,
'm'
,
'g'
,
't'
};
int
muindex
=
0
;
long
memmax
;
memmax
=
memTotal
();
size_t
memmax
=
getPeakRSS
();
while
(
memmax
>
9999
)
{
memmax
/=
1024
;
...
...
@@ -1337,7 +1338,7 @@ cdoFinish(void)
}
if
(
memmax
)
snprintf
(
memstring
,
sizeof
(
memstring
),
" %
ld
%c
"
,
memmax
,
mu
[
muindex
]);
snprintf
(
memstring
,
sizeof
(
memstring
),
" %
zu
%c"
,
memmax
,
mu
[
muindex
]);
processEndTime
(
&
p_usertime
,
&
p_systime
);
p_cputime
=
p_usertime
+
p_systime
;
...
...
@@ -1352,11 +1353,11 @@ cdoFinish(void)
#if defined(HAVE_SYS_TIMES_H)
if
(
cdoBenchmark
)
fprintf
(
stderr
,
" ( %.2fs %.2fs %.2fs
%s)
\n
"
,
c_usertime
,
c_systime
,
c_cputime
,
memstring
);
fprintf
(
stderr
,
" ( %.2fs %.2fs %.2fs%s
)
\n
"
,
c_usertime
,
c_systime
,
c_cputime
,
memstring
);
else
{
if
(
!
cdoSilentMode
)
fprintf
(
stderr
,
" ( %.2fs )
\n
"
,
c_cputime
);
fprintf
(
stderr
,
" ( %.2fs
%s
)
\n
"
,
c_cputime
,
memstring
);
}
if
(
cdoBenchmark
&&
processID
==
0
)
fprintf
(
stderr
,
"total: user %.2fs sys %.2fs cpu %.2fs mem%s
\n
"
,
p_usertime
,
p_systime
,
p_cputime
,
memstring
);
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment