Blame test/mpi/README

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