$showProgress = 0; # Set to true to get a "." with each run program.
$newline = "\r\n"; # Set to \r\n for Windows-friendly, \n for Unix only
$batchRun = 0; # Set to true to batch the execution of the tests
$showProgress = 0; # Set to true to get a "." with each run program.
$newline = "\r\n"; # Set to \r\n for Windows-friendly, \n for Unix only
$batchRun = 0; # Set to true to batch the execution of the tests
- # (i.e., run them together, then test output,
+ # (i.e., run them together, then test output,
# rather than build/run/check for each test)
$testCount = 0; # Used with batchRun to count tests.
$batrundir = "."; # Set to the directory into which to run the examples
# rather than build/run/check for each test)
$testCount = 0; # Used with batchRun to count tests.
$batrundir = "."; # Set to the directory into which to run the examples
# Get some arguments from the environment
# Currently, only the following are understood:
# VERBOSE
# Get some arguments from the environment
# Currently, only the following are understood:
# VERBOSE
# Define this to leave the XML output file open to receive additional data
if (defined($ENV{'NOXMLCLOSE'}) && $ENV{'NOXMLCLOSE'} eq 'YES') {
$closeXMLOutput = 0;
# Define this to leave the XML output file open to receive additional data
if (defined($ENV{'NOXMLCLOSE'}) && $ENV{'NOXMLCLOSE'} eq 'YES') {
$closeXMLOutput = 0;
# Process arguments and override any defaults
#---------------------------------------------------------------------------
foreach $_ (@ARGV) {
# Process arguments and override any defaults
#---------------------------------------------------------------------------
foreach $_ (@ARGV) {
- if (/--?mpiexec=(.*)/) {
- # Use mpiexec as given - it may be in the path, and
+ if (/--?mpiexec=(.*)/) {
+ # Use mpiexec as given - it may be in the path, and
}
elsif (/--?np=(.*)/) { $np_default = $1; }
elsif (/--?maxnp=(.*)/) { $np_max = $1; }
elsif (/--?tests=(.*)/) { $listfiles = $1; }
elsif (/--?srcdir=(.*)/) { $srcdir = $1;
}
elsif (/--?np=(.*)/) { $np_default = $1; }
elsif (/--?maxnp=(.*)/) { $np_max = $1; }
elsif (/--?tests=(.*)/) { $listfiles = $1; }
elsif (/--?srcdir=(.*)/) { $srcdir = $1;
elsif (/--?verbose/) { $verbose = 1; }
elsif (/--?showprogress/) { $showProgress = 1; }
elsif (/--?debug/) { $debug = 1; }
elsif (/--?verbose/) { $verbose = 1; }
elsif (/--?showprogress/) { $showProgress = 1; }
elsif (/--?debug/) { $debug = 1; }
# ProcessDir( directory-name, list-file-name )
sub ProcessDir {
my $dir = $_[0]; $dir =~ s/\/$//;
# ProcessDir( directory-name, list-file-name )
sub ProcessDir {
my $dir = $_[0]; $dir =~ s/\/$//;
# This file describes the tests in the format
# programname number-of-processes [ key=value ... ]
# If the second value is not given, the default value is used.
# This file describes the tests in the format
# programname number-of-processes [ key=value ... ]
# If the second value is not given, the default value is used.
if (! -s "$listfile" && -s "$srcdir/$curdir/$listfile" ) {
$listfileSource = "$srcdir/$curdir/$listfile";
}
if (! -s "$listfile" && -s "$srcdir/$curdir/$listfile" ) {
$listfileSource = "$srcdir/$curdir/$listfile";
}
# Some tests require that support routines are built first
# This is specified with !<dir>:<target>
if (/^\s*\!([^:]*):(.*)/) {
# Some tests require that support routines are built first
# This is specified with !<dir>:<target>
if (/^\s*\!([^:]*):(.*)/) {
# If a minimum MPI version is specified, check against the
# available MPI. If the version is unknown, we ignore this
# If a minimum MPI version is specified, check against the
# available MPI. If the version is unknown, we ignore this
if ($mpiVersion ne "" && $MPIMajorVersion ne "unknown" &&
$MPIMinorVersion ne "unknown") {
my ($majorReq,$minorReq) = split(/\./,$mpiVersion);
if ($mpiVersion ne "" && $MPIMajorVersion ne "unknown" &&
$MPIMinorVersion ne "unknown") {
my ($majorReq,$minorReq) = split(/\./,$mpiVersion);
# look for a new list file
&ProcessDir( $programname, $listfile );
}
# look for a new list file
&ProcessDir( $programname, $listfile );
}
- &AddMPIProgram( $programname, $np, $ResultTest,
+ &AddMPIProgram( $programname, $np, $ResultTest,
$InitForRun, $timeLimit, $progArgs,
$progEnv, $mpiexecArgs, $xfail );
}
else {
$InitForRun, $timeLimit, $progArgs,
$progEnv, $mpiexecArgs, $xfail );
}
else {
- &RunMPIProgram( $programname, $np, $ResultTest,
- $InitForRun, $timeLimit, $progArgs,
+ &RunMPIProgram( $programname, $np, $ResultTest,
+ $InitForRun, $timeLimit, $progArgs,
if ($programname eq "configure") { next; } # Ignore configure script
if ($programname eq "config.status") { next; } # Ignore configure helper
if (-x $programname) { $found_exec++; }
if ($programname eq "configure") { next; } # Ignore configure script
if ($programname eq "config.status") { next; } # Ignore configure helper
if (-x $programname) { $found_exec++; }
if ($found_exec) {
print "Found executables\n" if $debug;
open (PGMS, "ls -1 |" ) || die "Cannot list programs\n";
if ($found_exec) {
print "Found executables\n" if $debug;
open (PGMS, "ls -1 |" ) || die "Cannot list programs\n";
print "Found source files\n" if $debug;
open (PGMS, "ls -1 *.c |" ) || die "Cannot list programs\n";
while (<PGMS>) {
print "Found source files\n" if $debug;
open (PGMS, "ls -1 *.c |" ) || die "Cannot list programs\n";
while (<PGMS>) {
# ToDo: Add a way to limit the time that any particular program may run.
# The arguments are
# name of program, number of processes, name of routine to check results
# ToDo: Add a way to limit the time that any particular program may run.
# The arguments are
# name of program, number of processes, name of routine to check results
# Run the optional setup routine. For example, the timeout tests could
# be set to a shorter timeout.
if ($InitForTest ne "") {
# Run the optional setup routine. For example, the timeout tests could
# be set to a shorter timeout.
if ($InitForTest ne "") {
if ($found_error) {
&RunTestFailed( $programname, $np, $curdir, $inline, $xfail );
}
if ($found_error) {
&RunTestFailed( $programname, $np, $curdir, $inline, $xfail );
}
&RunTestPassed( $programname, $np, $curdir, $xfail );
}
&RunPostMsg( $programname, $np, $curdir );
&RunTestPassed( $programname, $np, $curdir, $xfail );
}
&RunPostMsg( $programname, $np, $curdir );
# Set a default timeout on tests (3 minutes for now)
my $timeout = $defaultTimeLimit;
if (defined($timeLimit) && $timeLimit =~ /^\d+$/) {
# Set a default timeout on tests (3 minutes for now)
my $timeout = $defaultTimeLimit;
if (defined($timeLimit) && $timeLimit =~ /^\d+$/) {
# individual mpi program runs. In that case, we may
# want to treat these also as "run manually".
$timeout = $timeLimit;
}
print BATOUT "export MPIEXEC_TIMEOUT=$timeout\n";
# individual mpi program runs. In that case, we may
# want to treat these also as "run manually".
$timeout = $timeLimit;
}
print BATOUT "export MPIEXEC_TIMEOUT=$timeout\n";
# Run the optional setup routine. For example, the timeout tests could
# be set to a shorter timeout.
if ($InitForTest ne "") {
# Run the optional setup routine. For example, the timeout tests could
# be set to a shorter timeout.
if ($InitForTest ne "") {
- # environment variable or command line option (e.g., for Cray aprun,
- # the option -t <sec> must be given, there is no environment variable
+ # environment variable or command line option (e.g., for Cray aprun,
+ # the option -t <sec> must be given, there is no environment variable
print STDOUT "." if $showProgress;
# Save and restore the environment if necessary before running mpiexec.
if ($progEnv ne "") {
print STDOUT "." if $showProgress;
# Save and restore the environment if necessary before running mpiexec.
if ($progEnv ne "") {
# export NAME=oldValue (if set!)
print STDERR "Batch output does not permit changes to environment\n";
}
# export NAME=oldValue (if set!)
print STDERR "Batch output does not permit changes to environment\n";
}
# in the summary file (which is otherwise written by the
# RunMPIProgram step)
&RunPreMsg( $programname, $np, $curdir );
# in the summary file (which is otherwise written by the
# RunMPIProgram step)
&RunPreMsg( $programname, $np, $curdir );
# Check for that this program has exited. If it is still running,
# issue a warning and leave the application. Of course, this
# Check for that this program has exited. If it is still running,
# issue a warning and leave the application. Of course, this
# status return is NONZERO and there are no processes left over.
# This test currently checks only for the return status.
sub TestTimeout {
# status return is NONZERO and there are no processes left over.
# This test currently checks only for the return status.
sub TestTimeout {
if (/job ending due to env var MPIEXEC_TIMEOUT/) { next; }
# Allow 'APPLICATION TIMED OUT' (hydra)
if (/\[mpiexec@.*\] APPLICATION TIMED OUT/) { last; }
if (/job ending due to env var MPIEXEC_TIMEOUT/) { next; }
# Allow 'APPLICATION TIMED OUT' (hydra)
if (/\[mpiexec@.*\] APPLICATION TIMED OUT/) { last; }
# Here should go a check of the processes
# open( PFD, "ps -fu $LOGNAME | grep -v grep | grep $programname |" );
# while (<PFD>) {
# Here should go a check of the processes
# open( PFD, "ps -fu $LOGNAME | grep -v grep | grep $programname |" );
# while (<PFD>) {