Peter Jeremy wrote:
> 
>> At the moment 'make test' is bringing my Solaris box to an almost 
>> standstill, as 'top' is being called thousands of times per second.
> 
> Just calling fork() and exec() thousands of times a second will put a
> significant load on a typical system.

That's what was happening on my machine.

>> Note also the code at present in Sage assumes the data will be in MB, 
>> which is what 'top' usually reports.
> 
> Actually, 'top' output varies between KB, MB and GB depending on the
> process size.

The code I posted earlier:

      elif U == 'sunos':
          # An evil and ugly workaround some Solaris race condition.
          while True:
               try:
                    m = float(top().split()[-5].strip('M'))
                    break
               except:
                    pass
      else:


will probably break if the output is anything other than MB in that 
case, as I assume the "strip('M')" is converting the number of MB to an 
integer, which later gets changed to a float.

Anyway, it is obvious the above code needs some changes.

> Do we want a getusage() function that returns all the information in
> an array, or a number of individual functions that each return one
> piece (or closely related pieces) of information?  For the former,
> should it be a vector (eg n-th element is 5-min load average) or a
> hash (5-min load average has a key of 'LA5' or similar).  (And BTW,
> not all OSs measure load averages over the same periods).  Once that
> is decided, the most natural units for that information can be
> determined.

Realistically any function returning an array of data is going to have 
to make calls to individual smaller functions, as otherwise the code 
will hard to read. So it seems most sensible to me to write it as small 
functions, then if at a later date, create a function which calls lots 
of other functions.

I think the immediate goal should be to provide something that does not 
bring a Solaris system to its knees.


--~--~---------~--~----~------------~-------~--~----~
To post to this group, send an email to [email protected]
To unsubscribe from this group, send an email to 
[email protected]
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to