On Aug 27, 2009, at 12:02 AM, Dr. David Kirkby wrote: > Robert Bradshaw wrote: >> >>> Should my 'solaris_system_information' command be installed in >>> a .spkg >>> of its own, that only gets built on Solaris? Should the command >>> then be >>> installed to $SAGE_HOME/local/bin ? >>> >>> I can write the C code without problem, but I am stuck on exactly >>> how to >>> integrate it into Sage. >> >> Probably belongs in devel/sage/c_lib. Just make them functions that >> return longs (bytes is the most logical unit), and then we can make >> getusage invoke them directly. > > I was anticipating making this a stand alone executable to replace > 'top', since 'top' is being called that way. (I would tend to agree > that > getting information from a library function is probably a better > way to > do this, but I don't know enough python to do all this.)
If you provide the c functions, I'll provide the Python wrappers. > At the moment 'make test' is bringing my Solaris box to an almost > standstill, as 'top' is being called thousands of times per second. > > Note also the code at present in Sage assumes the data will be in MB, > which is what 'top' usually reports. I'm not 100% sure that would > be so > with very small or very large processes. Certainly Sun's 'prstat' > changes between kB and MB, and perhaps even GB (can't say I have > tested > that). If it's in bytes, we can always choose KB, MB or GB later. > If my code returns things like load averages, then clearly in that > case > it will need to return an array of floating point numbers, not a > 'long'. Sure, it could populate a float*. I assume we'd always know how many values there'd be (e.g. number of processors). - Robert --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
