Commit 273cfaf8 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

Use getPeakRSS().

parent b136647c
......@@ -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);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment