bug-parallel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

GNU Parallel Bug Reports A modest patch to support RH Enterprise 4.6


From: Nigel Stewart
Subject: GNU Parallel Bug Reports A modest patch to support RH Enterprise 4.6
Date: Fri, 27 Apr 2012 21:58:29 -0500
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:12.0) Gecko/20120420 Thunderbird/12.0

Hi all,

I came across an issue with GNU parallel on a particularly
old build host, concerning --number-of-cpus option:

In (our) build log, before and after:

parallel: Cannot figure out number of cpus. Using 1 at /my/bin/parallel line 
2622.
:::  parallel info: 1 cpus, 1 cores
->
:::  parallel info: 1 cpus, 1 cores

Which appears to be due to /proc/cpuinfo missing the
physical id field for this particularly old kernel:

$ cat /proc/cpuinfo
processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
model           : 10
model name      : Intel(R) Xeon(R) CPU           X5550  @ 2.67GHz
stepping        : 5
cpu MHz         : 2659.656
cache size      : 8192 KB
fpu             : yes
fpu_exception   : yes
cpuid level     : 11
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov 
pat pse36 clflush dts acpi mmx fxsr sse sse2 ss syscall nx rdtscp lm pni cx16 
popcnt lahf_lm
bogomips        : 5323.21
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management:

$ uname -a
Linux hostname 2.6.9-67.ELsmp #1 SMP Wed Nov 7 13:56:44 EST 2007 x86_64 x86_64 
x86_64 GNU/Linux

So this one-line change resorts to using the number of cores on
Linux if the number of cpus is undefined, as follows:

diff a/parallel b/parallel
2600c2600
<         $no_of_cpus = no_of_cpus_gnu_linux();
---
>         $no_of_cpus = no_of_cpus_gnu_linux() || no_of_cores_gnu_linux();

Which seems better overall than defaulting to one CPU and
polluting the log.  I'd be happy to try some other approach
or solution, on this particular machine, as necessary.
For your consideration, and thanks for GNU parallel.

- Nigel

-------------

$ ./parallel --version
GNU parallel 20120422
Copyright (C) 2007,2008,2009,2010,2011,2012 Ole Tange and Free Software 
Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
GNU parallel comes with no warranty.

Web site: http://www.gnu.org/software/parallel

When using GNU Parallel for a publication please cite:

O. Tange (2011): GNU Parallel - The Command-Line Power Tool,
;login: The USENIX Magazine, February 2011:42-47.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]