my $mpirun = "";
my ($libs, $ccflags) = ("", "");
+$ENV{MPI_OPTIONS} //= "--hostfile ./debian/mpihostfile";
+
if ($ENV{FORCE_MPIRUN}) {
$mpirun = $ENV{FORCE_MPIRUN};
}
else {
foreach my $mpi_try (qw(mpiexec mpirun)) {
- my $test = join("",`$mpi_try -n 1 echo test`);
+ my $test = join("",`$mpi_try $ENV{MPI_OPTIONS} -n 1 echo test`);
$mpirun = $mpi_try unless $! =~ /No such file or directory/;
last if $mpirun;
}
if (!$mpirun) {
- print STDERR "Failed to run `$mpirun -n 1 echo test`: $!\n";
+ print STDERR "Failed to run `$mpirun $ENV{MPI_OPTIONS} -n 1 echo test`: $!\n";
print STDERR "It looks like you don't have mpi installed, re-run build with env: FORCE_MPIRUN=1 to ignore\n";
exit(0);
}
+$ENV{MPI_OPTIONS} //= "--hostfile ./debian/mpihostfile";
+
my $mpirun = "";
foreach my $mpi_try (qw(mpiexec mpirun)) {
- my $test = join("",`$mpi_try -n 1 perl -e "print qq{honk},qq{honk\n}"`);
+ my $test = join("",`$mpi_try $ENV{MPI_OPTIONS} -n 1 perl -e "print qq{honk},qq{honk\n}"`);
$mpirun = $mpi_try if $test =~ /honkhonk/;
last if $mpirun;
}
$incs .= " -I$_" foreach @INC;
my @newout = sort {
(($a =~ /(\d+)/g)[0] <=> ($b =~ /(\d+)/g)[0])
-} `$mpirun -np 2 $^X $incs ic.pl`;
+} `$mpirun $ENV{MPI_OPTIONS} -np 2 $^X $incs ic.pl`;
print "1..26\n";
if (@newout < 25) {
print "not ok 1 # mpirun failed. Do you need to start mpd?\n";