Merge branch 'master' of ssh://git.sv.gnu.org/srv/git/parallel

This commit is contained in:
Ole Tange 2013-02-10 11:09:12 +01:00
commit 0be46ce826

View file

@ -2883,6 +2883,8 @@ sub no_of_cpus {
$no_of_cpus = no_of_cpus_gnu_linux() || no_of_cores_gnu_linux(); $no_of_cpus = no_of_cpus_gnu_linux() || no_of_cores_gnu_linux();
} elsif ($^O eq 'freebsd') { } elsif ($^O eq 'freebsd') {
$no_of_cpus = no_of_cpus_freebsd(); $no_of_cpus = no_of_cpus_freebsd();
} elsif ($^O eq 'netbsd') {
$no_of_cpus = no_of_cpus_netbsd();
} elsif ($^O eq 'solaris') { } elsif ($^O eq 'solaris') {
$no_of_cpus = no_of_cpus_solaris(); $no_of_cpus = no_of_cpus_solaris();
} elsif ($^O eq 'aix') { } elsif ($^O eq 'aix') {
@ -2891,6 +2893,7 @@ sub no_of_cpus {
$no_of_cpus = no_of_cpus_darwin(); $no_of_cpus = no_of_cpus_darwin();
} else { } else {
$no_of_cpus = (no_of_cpus_freebsd() $no_of_cpus = (no_of_cpus_freebsd()
|| no_of_cpus_netbsd()
|| no_of_cpus_darwin() || no_of_cpus_darwin()
|| no_of_cpus_solaris() || no_of_cpus_solaris()
|| no_of_cpus_aix() || no_of_cpus_aix()
@ -2915,6 +2918,8 @@ sub no_of_cores {
$no_of_cores = no_of_cores_gnu_linux(); $no_of_cores = no_of_cores_gnu_linux();
} elsif ($^O eq 'freebsd') { } elsif ($^O eq 'freebsd') {
$no_of_cores = no_of_cores_freebsd(); $no_of_cores = no_of_cores_freebsd();
} elsif ($^O eq 'netbsd') {
$no_of_cores = no_of_cores_netbsd();
} elsif ($^O eq 'openbsd') { } elsif ($^O eq 'openbsd') {
$no_of_cores = no_of_cores_openbsd(); $no_of_cores = no_of_cores_openbsd();
} elsif ($^O eq 'solaris') { } elsif ($^O eq 'solaris') {
@ -2925,6 +2930,7 @@ sub no_of_cores {
$no_of_cores = no_of_cores_darwin(); $no_of_cores = no_of_cores_darwin();
} else { } else {
$no_of_cores = (no_of_cores_freebsd() $no_of_cores = (no_of_cores_freebsd()
|| no_of_cores_netbsd()
|| no_of_cores_openbsd() || no_of_cores_openbsd()
|| no_of_cores_darwin() || no_of_cores_darwin()
|| no_of_cores_solaris() || no_of_cores_solaris()
@ -3025,6 +3031,24 @@ sub no_of_cores_freebsd {
return $no_of_cores; return $no_of_cores;
} }
sub no_of_cpus_netbsd {
# Returns:
# Number of physical CPUs on NetBSD
# undef if not NetBSD
my $no_of_cpus = `sysctl -n hw.ncpu`;
chomp $no_of_cpus;
return $no_of_cpus;
}
sub no_of_cores_netbsd {
# Returns:
# Number of CPU cores on NetBSD
# undef if not NetBSD
my $no_of_cores = `sysctl -n hw.ncpu`;
chomp $no_of_cores;
return $no_of_cores;
}
sub no_of_cores_openbsd { sub no_of_cores_openbsd {
# Returns: # Returns:
# Number of CPU cores on OpenBSD # Number of CPU cores on OpenBSD