Makefile.incto represent your system.
include/gthread.hto represent your system.
make profileif you want to use profiling libraries with TOMPI
mpiccscript (see below), so compile the preprocessor:
mpiccto reflect your system.
hello -nthread nwhere
nis an integer should print many hellos.
Useful for testing how many threads you can use, ignoring the application's memory requirements (neglidgible for hello).
fanin -nthread nwhere
nis an integer does Cholesky factorization.
By default, solves a 100x100 system. This is very small, so it should run under a second or so for 4 processes.
mergesort -nthread 4(to use another value, change
A simple parallel merge sort using a local bubble sort (unless you define
QSORT to 1). By default only sorts an integer array of size
5,000, so it should run in a few seconds for 4 processes. Also checks for
syseval -nthread 2(or more, but this is useless)
Evaluates the speed of point-to-point communication. Uses a
sophisticated measurement algorithm to evaluate speeds for messages
of size 0, 1 byte, 10 bytes, 100 bytes, 1K, 10K, 100K, and 1Meg.
Stores the results in the file "
-I/path/to/TOMPI/includeand using the following link switch:
-L/path/to/TOMPI/src -lmpiOtherwise, you have to compile all your code using the
mpiccscript in the
mpiccdirectory, in place of your C compiler (
cc). Fortran isn't supported yet. For a list of
mpiccoptions, read mpicc/README.
To run your programs, add an
-nthread argument followed by the
number of threads (MPI processes) you wish to use. Currently there is no
mpiexec script. You can also set the
number of threads in an environment variable
There is another option,
-threadinfo (or by setting the
TOMPI_THREADINFO) which prints information
on the underlying thread system that your program is using.
For a list of supported MPI concepts, type "
mpicmds" in the TOMPI
directory (or see the output for the latest
version). The collective communication hasn't been optimized anywhere near to
the level the point-to-point communication has; collective communication uses
In addition, there are two global variables you can play with. You can set the stack size of a process in a portable manner as follows:
#ifdef MPII_STACK_SIZE MPII_Stack_size = number_of_bytes; #endifYou can also set the number of physical processors to use.
#ifdef MPII_NUM_PROC MPII_Num_proc = number_of_processors; #endifNote that these parameters may not supported by your thread system. Currently, stack size is supported by all except possibly POSIX threads (it depends on whether your implementation supports the stacksize attribute), and number of processors is supported by Solaris threads and Cthreads.