Blame test/mpi/README

Packit 0848f5
MPICH Test Suite
Packit 0848f5
Packit 0848f5
This test suite is a *supplement* to other test suites, including the
Packit 0848f5
original MPICH testsuite, the Intel testsuite, and the IBM MPI test suite
Packit 0848f5
(or test suites derived from that test, including the MPI C++ tests).
Packit 0848f5
Packit 0848f5
Building the Test Suite
Packit 0848f5
=======================
Packit 0848f5
In many cases, configure will find the MPI implementation
Packit 0848f5
automatically.  In some cases, it will need some help.  For example:
Packit 0848f5
Packit 0848f5
For IBM MPI, where the compilation commands are not mpicc and mpif77 etc.:
Packit 0848f5
Packit 0848f5
./configure CC=xlc MPICC=mpcc F77=xlf MPIF77=mpxlf CXX=xlC \
Packit 0848f5
                       MPICXX="mpCC -cpp" FC=xlf90 MPIFC=mpxlf90 \
Packit 0848f5
		       --disable-spawn \
Packit 0848f5
		       --enable-strictmpi
Packit 0848f5
Packit 0848f5
(or the _r versions of the compilers)
Packit 0848f5
Packit 0848f5
If mpicc and friends are not in your default path (and you do not want to
Packit 0848f5
add them), you can specify the path with --with-mpi=<path>.  For example,
Packit 0848f5
if they are in /usr/local/mympi/bin, use
Packit 0848f5
Packit 0848f5
./configure --with-mpi=/usr/local/mympi 
Packit 0848f5
Packit 0848f5
(configure will append the bin to the path that you give).
Packit 0848f5
Packit 0848f5
You may need to add MPI_SIZEOF_OFFSET=8 .
Packit 0848f5
Packit 0848f5
The option "-cpp" is needed for at least some versions of mpCC to define the
Packit 0848f5
C++ bindings of the MPI routines.
Packit 0848f5
Packit 0848f5
For implementations that do not implement all of MPI-2, there are --disable
Packit 0848f5
options, including --disable-spawn and --disable-cxx.  To restrict tests to 
Packit 0848f5
just what is defined in the MPI specification, use --enable-strictmpi .
Packit 0848f5
Packit 0848f5
The script that runs the tests assumes that the MPI implementation
Packit 0848f5
supports mpiexec; you should consider this the first test of the implementation.
Packit 0848f5
Packit 0848f5
Setting Options
Packit 0848f5
===============
Packit 0848f5
The following environment variables will modify the behavior of the tests
Packit 0848f5
Packit 0848f5
MPITEST_DEBUG - if set, output information for debugging the test suite
Packit 0848f5
MPITEST_VERBOSE - if set to an integer value, output messages whose
Packit 0848f5
                  level is at least that value (0 is a good choice here)
Packit 0848f5
MPITEST_RETURN_WITH_CODE - Set the return code from the test programs based on
Packit 0848f5
			 success or failure, with a zero for success and one
Packit 0848f5
			 for failure (value must be yes, YES, true, or TRUE to 
Packit 0848f5
			 turn this on)
Packit 0848f5
MPITEST_THREADLEVEL_DEFAULT - Set the default thread level.  Values are 
Packit 0848f5
			      multiple, serialized, funneled, and single.
Packit 0848f5
Packit 0848f5
Batch Systems
Packit 0848f5
=============
Packit 0848f5
For systems that run applications through a batch system, the option "-batch"
Packit 0848f5
to the runtests script will create a script file that can be edited and 
Packit 0848f5
submitted to the batch system.  The script checktests can be run to 
Packit 0848f5
summarize the results.  
Packit 0848f5
Packit 0848f5
Specifically, (assuming the bash shell, and that the directory "btest", a
Packit 0848f5
subdirectory of the test suite directory, is used for running the tests):
Packit 0848f5
Packit 0848f5
export MPITEST_BATCHDIR=`pwd`/btest
Packit 0848f5
runtests -batch -tests=testlist
Packit 0848f5
... edit btest/runtests.batch to make it a value batch submissions script
Packit 0848f5
... run that script and wait for the batch job to complete
Packit 0848f5
cd btest && ../checktests 
Packit 0848f5
Packit 0848f5
If a program other than mpiexec is used in the batch form to run programs, then
Packit 0848f5
specify that to runtests:
Packit 0848f5
Packit 0848f5
    runtests -batch -mpiexec=aprun -tests=testlist
Packit 0848f5
Packit 0848f5
(Here, aprun is the command used on Cray XE6 systems.)
Packit 0848f5
Packit 0848f5
Note that some programs that are used to run MPI programs add extra output, 
Packit 0848f5
which can confuse any tool that depends on clean output in STDOUT.  Since
Packit 0848f5
such unfortunate behavior is common, the option -ignorebogus can be given 
Packit 0848f5
to checktests:
Packit 0848f5
Packit 0848f5
cd btest && ../checktests --ignorebogus
Packit 0848f5
Packit 0848f5
See "More control over running tests" to see how to control how many
Packit 0848f5
processes per node on used.  For example, on a Cray XE-6, this command
Packit 0848f5
line to runtests can be used:
Packit 0848f5
Packit 0848f5
  runtests -batch -tests=testlist -ppnarg="-N %d" -ppn=2 -showprogress \
Packit 0848f5
           -mpiexec=aprun
Packit 0848f5
Packit 0848f5
This runs at most 2 processes per node.  Note that this can take a long
Packit 0848f5
time to execute because it builds all of the executables required for the
Packit 0848f5
tests (over 800 of them!).  The "-showprogress" flag lets you know that
Packit 0848f5
something is happening, but is not necessary.
Packit 0848f5
Packit 0848f5
Controlling the Tests that are Run
Packit 0848f5
==================================
Packit 0848f5
The tests are actually built and run by the script "runtests".  This script
Packit 0848f5
can be given a file that contains a list of the tests to run.  This file has
Packit 0848f5
two primary types of entries:
Packit 0848f5
Packit 0848f5
    directories:  Enter directory and look for the file "testlist".
Packit 0848f5
                  Recursively run the contents of that file
Packit 0848f5
    program names: Build and run that program
Packit 0848f5
Packit 0848f5
Lines may also be commented out with "#".
Packit 0848f5
Packit 0848f5
The simplest program line contains the name of the program and the number of
Packit 0848f5
MPI processes to use.  For example, the following will build the
Packit 0848f5
program sendrecv1 and run it with 4 processes:
Packit 0848f5
Packit 0848f5
sendrecv1 4
Packit 0848f5
Packit 0848f5
In addition, the program line can contain key=value pairs that provide 
Packit 0848f5
special information about running the test.  For example, 
Packit 0848f5
Packit 0848f5
sendflood 8 timeLimit=600
Packit 0848f5
Packit 0848f5
says to build and run the program sendflood with 8 MPI processes and
Packit 0848f5
permit the test to run for 600 seconds (by default, at least for
Packit 0848f5
MPICH, the default timelimit is 180 seconds).  Other key=value pairs
Packit 0848f5
can be used to select whether a program should be run at all,
Packit 0848f5
depending on the abilities of the MPI implementation (this is
Packit 0848f5
particularly important for Fortran programs, since preprocessor
Packit 0848f5
support for Fortran is a non-standard extension to the Fortran
Packit 0848f5
language, and there are some compilers that would not accept Fortran
Packit 0848f5
programs that used the preprocessor).
Packit 0848f5
Packit 0848f5
The most important key=value pairs are:
Packit 0848f5
Packit 0848f5
Packit 0848f5
timeLimit=n : Use a timelimit of n seconds
Packit 0848f5
Packit 0848f5
arg=string  : Run the program with string as an argument to the program
Packit 0848f5
Packit 0848f5
mpiexecarg=string  : Run the program with string as an argument to mpiexec
Packit 0848f5
Packit 0848f5
env=name=value : Run the program with environment variable "name" given the
Packit 0848f5
                 value "value"
Packit 0848f5
Packit 0848f5
mpiversion=x.y : Build and run the program only if the MPI version is at 
Packit 0848f5
                 least x.y.  For example, 
Packit 0848f5
Packit 0848f5
                distgraph1 4 mpiversion=2.2
Packit 0848f5
Packit 0848f5
		will build and run distgraph1 with 4 MPI processes only 
Packit 0848f5
		if the MPI version is at least 2.2.
Packit 0848f5
Packit 0848f5
strict=bool : If bool is false, only build and run the program if 
Packit 0848f5
              --enable-strictmpi was not used in configuring the test suite.
Packit 0848f5
	      That is, a line such as 
Packit 0848f5
Packit 0848f5
              neighb_coll 4 strict=false
Packit 0848f5
Packit 0848f5
              Says that this test is not valid for a strict MPI implementation;
Packit 0848f5
              it contains extensions to the standard, or in the case of some
Packit 0848f5
	      MPICH development, MPIX routines
Packit 0848f5
Packit 0848f5
resultTest=proc : This is used to change the way in which the success or 
Packit 0848f5
                  failure of a test is evaluated.  proc is one of several 
Packit 0848f5
                  Perl subroutines defined within the runtest program.  These
Packit 0848f5
                  are primarily used within the testsuite for tests programs
Packit 0848f5
                  exit with expected status values or that timeouts are 
Packit 0848f5
                  in fact handled.
Packit 0848f5
Packit 0848f5
Packit 0848f5
More control over running tests
Packit 0848f5
===============================
Packit 0848f5
Packit 0848f5
You can provide a "processes per node" argument to the run command (typically
Packit 0848f5
mpiexec) with either options to "runtests" or environment variables.
Packit 0848f5
The two values are
Packit 0848f5
Packit 0848f5
-ppnarg=string or MPITEST_PPNARG
Packit 0848f5
   The string used to specify the number of processes per node.  The number
Packit 0848f5
   of processes to use will be substituted for the %d in the string.  For
Packit 0848f5
   example,
Packit 0848f5
Packit 0848f5
   export MPITEST_PPNARG="-ppn %d"
Packit 0848f5
Packit 0848f5
-ppn=n or MPITEST_PPNMAX
Packit 0848f5
   The maximum number of processes per node.  For example
Packit 0848f5
Packit 0848f5
   runtests ... -ppn=2
Packit 0848f5
Packit 0848f5
   This allows the runtests script to ensure that the value of the
Packit 0848f5
   processes per node argument does not exceed the total number of processes;
Packit 0848f5
   some run commands (e.g., aprun on Cray) require that the number of
Packit 0848f5
   processes per node be no greater than the total number of processes.
Packit 0848f5
Packit 0848f5
Note that for most systems it will be important to run the tests
Packit 0848f5
multiple times, using this option to ensure that the tests that
Packit 0848f5
involve more than one process are run each of the following cases:
Packit 0848f5
1) Multiple MPI processes per chip (likely using shared memory to
Packit 0848f5
communicate between processes)
Packit 0848f5
2) MPI processes on separate chips within the same node (also likely
Packit 0848f5
using shared memory between processes, but may use a different
Packit 0848f5
approach to handle the NUMA nature of this case)
Packit 0848f5
3) MPI processes on separate nodes (likely using the best available
Packit 0848f5
interconnect).
Packit 0848f5
Note, this depends on the nature of the MPI implementation; these
Packit 0848f5
options make it easier to run the necessary cases.  If you run only
Packit 0848f5
the first case, which is often the default case, you may not
Packit 0848f5
effectively test the MPI implementation.