On Wed, 07 Feb 2007 14:44:08 -0700, Jason Martin <[EMAIL PROTECTED]> wrote:
> > On Linux, grep /proc/cpuinfo for lines beginning with "processor". > Take the line with the biggest number and add one to it. Kinda > kludgey, but that's the first thing that comes to mind. > > On OS X, the command "sysctl hw.ncpu" will give it to you. > > On Solaris, I believe that "procinfo" will give it to you, but I > haven't worked on a Solaris box in a while, so that may be old. > > On Windows, I have no clue. > > I think that on some x86 platforms, you can actually get this > information with the "cpuid" assembly instruction. I'll look that up > and send you some C code to do it if it's possible. Perhaps somebody should write a function number_of_cpus() and put it in a file sage/misc/parallel.py and send me a patch. It would default to 1 if it can't figure it out using heuristics as above. Also, it would be customizable, i.e., there could be a variable one could set in that file that would make number_of_cpus() just return the value of the variable. William --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/ -~----------~----~----~----~------~----~------~--~---