mirror of
https://git.savannah.gnu.org/git/parallel.git
synced 2024-12-25 14:17:53 +00:00
parallel: HPUX CPU/core detection. Thanks to Javier Tarradas.
This commit is contained in:
parent
635e5081d6
commit
9ca429b5ce
22
src/parallel
22
src/parallel
|
@ -2931,6 +2931,8 @@ sub no_of_cpus {
|
|||
$no_of_cpus = no_of_cpus_aix();
|
||||
} elsif ($^O eq 'darwin') {
|
||||
$no_of_cpus = no_of_cpus_darwin();
|
||||
} elsif ($^O eq 'hpux') {
|
||||
$no_of_cpus = no_of_cpus_hpux();
|
||||
} else {
|
||||
$no_of_cpus = (no_of_cpus_freebsd()
|
||||
|| no_of_cpus_netbsd()
|
||||
|
@ -2968,6 +2970,8 @@ sub no_of_cores {
|
|||
$no_of_cores = no_of_cores_aix();
|
||||
} elsif ($^O eq 'darwin') {
|
||||
$no_of_cores = no_of_cores_darwin();
|
||||
} elsif ($^O eq 'hpux') {
|
||||
$no_of_cores = no_of_cores_hpux();
|
||||
} else {
|
||||
$no_of_cores = (no_of_cores_freebsd()
|
||||
|| no_of_cores_netbsd()
|
||||
|
@ -3166,6 +3170,24 @@ sub no_of_cores_aix {
|
|||
return $no_of_cores;
|
||||
}
|
||||
|
||||
sub no_of_cpus_hpux {
|
||||
# Returns:
|
||||
# Number of physical CPUs on HP-UX
|
||||
# undef if not HP-UX
|
||||
my $no_of_cpus =
|
||||
(`/usr/bin/mpsched -s 2>/dev/null | grep 'Locality Domain Count' | awk '{ print \$4 }'`);
|
||||
return $no_of_cpus;
|
||||
}
|
||||
|
||||
sub no_of_cores_hpux {
|
||||
# Returns:
|
||||
# Number of CPU cores on HP-UX
|
||||
# undef if not HP-UX
|
||||
my $no_of_cores =
|
||||
(`/usr/bin/mpsched -s 2>/dev/null | grep 'Processor Count' | awk '{ print \$4 }'`);
|
||||
return $no_of_cores;
|
||||
}
|
||||
|
||||
sub sshcommand {
|
||||
my $self = shift;
|
||||
if (not defined $self->{'sshcommand'}) {
|
||||
|
|
Loading…
Reference in a new issue