On 2/7/07, 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.

Here's the python code for Linux:

tlon[~]> python -c "import commands;ncpu=int(commands.getoutput('grep
processor /proc/cpuinfo | wc -l'));print 'Number of CPUs:',ncpu"
Number of CPUs: 2


Cheers,

f

--~--~---------~--~----~------------~-------~--~----~
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/
-~----------~----~----~----~------~----~------~--~---

Reply via email to