POV-Ray : Newsgroups : povray.unix : Solaris CPU time accounting Server Time
22 Dec 2024 03:48:21 EST (-0500)
  Solaris CPU time accounting (Message 1 to 2 of 2)  
From: John Martin
Subject: Solaris CPU time accounting
Date: 25 Mar 2008 22:10:01
Message: <web.47e9bdccd4b82d06c7064b8c0@news.povray.org>
I built povray 3.7.0 beta 25b on Solaris and noticed the CPU time
accounting was wrong:

 Render Time:
   Photon Time:      0 hours  0 minutes  0 seconds (0.338 seconds)
               using 7 thread(s) with 0.-07 CPU-seconds total
   Radiosity Time:   0 hours  0 minutes  3 seconds (3.966 seconds)
               using 4 thread(s) with 0.-04 CPU-seconds total
   Trace Time:       0 hours  2 minutes 35 seconds (155.919 seconds)
               using 4 thread(s) with 0.-04 CPU-seconds total

This can be fixed by using getrusage().  A suggested source fix
is below.  The CPU time in the output will then be correct:

 Render Time:
   Photon Time:      0 hours  0 minutes  0 seconds (0.430 seconds)
               using 7 thread(s) with 1.349 CPU-seconds total
   Radiosity Time:   0 hours  0 minutes  5 seconds (5.736 seconds)
               using 4 thread(s) with 22.032 CPU-seconds total
   Trace Time:       0 hours  3 minutes 18 seconds (198.617 seconds)
               using 4 thread(s) with 782.070 CPU-seconds total


--- ./vfe/unix/platformbase.cpp Tue Mar 25 21:50:49 2008
***************
*** 196,202 ****
--- 196,206 ----
  #endif
  #ifdef HAVE_GETRUSAGE
    struct rusage ru;
+ #if defined(__sun)
+   if (getrusage(m_ThreadTimeOnly ? RUSAGE_LWP : RUSAGE_SELF, &ru) == 0)
+ #else
    if (getrusage(RUSAGE_SELF, &ru) == 0)
+ #endif
     return (unsigned POV_LONG) (1000)*(ru.ru_utime.tv_sec + ru.ru_stime.tv_sec)
      + (unsigned POV_LONG)(ru.ru_utime.tv_usec + ru.ru_stime.tv_usec)/1000;
  #endif
***************
*** 226,231 ****
--- 230,242 ----
    if (clock_gettime(CLOCK_THREAD_CPUTIME_ID, &ts) == 0)
     return true;
  #endif
+ #ifdef HAVE_GETRUSAGE
+ #if defined(__sun)
+   struct rusage ru;
+   if (getrusage(RUSAGE_LWP, &ru) == 0)
+    return true;
+ #endif
+ #endif
    return false;
   }


Post a reply to this message

From: Nicolas Calimet
Subject: Re: Solaris CPU time accounting
Date: 4 Aug 2008 12:28:19
Message: <48972e23$1@news.povray.org>
> This can be fixed by using getrusage().  A suggested source fix
> is below.

	Thanks for the report and your patch that will be included in the
next beta.

	- NC


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.