ADAPTOR is a source-distribution that depends on certain characteristics of the machine and compilers. The configuration script configure generates a number of files that will contain all the machine-specific data needed for the ADAPTOR translation system. The configuration script configure has been created by the GNU tool autoconf.
After running configure the following files will be generated from corresponding template files (same name but with the additional suffix .in):
src/Makefile Makefile to generate fadapt src1/Makefile Makefile to generate adaptor dalib/Makefile Makefile to generate LIBADP dalib/MACHINE_CONF.m4 machine dependent macros for LIBADP .fadaptrc configuraton file for fadapt .adaptorrc configuraton file for adaptor
In the first place, the configure script creates the three Makefile's for the source-to-source translation fadapt, the compiler driver adaptor, and the runtime system LIBADP.
The C Compiler is needed to translate the source-to-source transformation fadapt, the compiler driver adaptor and to build the ADAPTOR runtime system dalib. If the default C compiler and the default C compilation flags are not properly chosen, the default choices can be reset in the following way:
export CC=cc export CFLAGS=-w -O ... configure
Though the C compiler and the compilation flags can be changed directly in the Makefile's, the C compiler is also needed to evaluate the Fortran-C interface to find out which Fortran data types are how supported in C.
Though the Fortran compiler itself is not needed to build the ADAPTOR system, the Fortran compiler becomes important for the configuration of the ADAPTOR compilation system, especially for the compiler driver adaptor. But the source-to-source translation fadapt has also some compiler-specific dependencies and the Fortran-C interface for the ADAPTOR runtime system LIBADP depends heavily on the Fortran compiler.
The Fortran compiler to be used for the ADAPTOR compilation is specified by the variable F77 that has to be set before calling the configure script. If the variable is not set, the default Fortran compiler (e.g. f77 or f90) is used.
export F77=pgf90
The configure script tries to identify a compilation flag so that the Fortran compiler accepts extended source lines. This flag can also be specified directly in the following way:
export F77_EXTEND=-extend_source export F77_EXTEND=-e export F77_EXTEND=-Mextend
As the generated Fortran sources might produce compiler warnings it is convenient to specify a flag that suppresses warning messages.
export F77_NOWARN=-w
Some Fortran compilers have some very specific switches for the optimization. These switches should be set in the following way:
export F77_OPT=-O ! used as default export F77_OPT=-O3 -mips4
For the compilation of Fortran sources generated for multiprocessing via thread parallelism it is very important to specify a flag that local variables of subprograms are not SAVE but put on the stack. Otherwise the concurrent call of subprograms would not be thread-safe. Typical examples of such flags are:
export F77_MP=-auto ! Intel Fortran Compiler export F77_MP=-automatic ! Lahey Fortran Compiler export F77_MP=-Mrecursive ! PGI Fortran Compiler export F77_MP=-mp ! SGI Fortran Compiler export F77_MP=-stackvar ! Sun Fortran compiler export F77_MP=-qnosave ! IBM Fortran compiler
The configure script tests the flag for an example program to see that it works correctly.
Furthermore, the configure script runs some example programs with the target Fortran compiler to identify certain configuration parameters needed for ADAPTOR. These programs will identify:
The corresponding programs are located in the directory config_tools and should not be modified.
The configure script tries to compile, link and run a simple C program with PThreads. Usually the link step needs the specification of a PThread library to be linked with.
export THR_LIB=-lpthread
Here are some values that might be tried on certain machines:
THR_LIB="-mt -lpthread -R /usr/lib/lwp" ! SunOs, UltraSparc
HPF programs translated for distributed memory architectures are based on MPI and therefore the ADAPTOR system needs access to an MPI implementation. The configure script tries to compile, link and run a simple C program with MPI parallelism. Usually the compile step needs an include directory where it can find the file mpi.h and the link step needs the specification of an MPI library to be linked with.
Note: For some internal reasons the compiler scripts mpif77 and mpicc are not used. Therefore the ADAPTOR installation has to know by its own where to find include files and libraries.
The following values for the variables MPI_INC and MPI_LIB will be taken as default:
export MPI_INC= export MPI_LIB=-lmpi | or -lmpich
If the MPI installation is not directly accessible, its home can be specified by the variable MPI_HOME.
export MPI_HOME=... # implies # export MPI_LIB=-L$(MPI_HOME)/lib -lmpi # export MPI_INC=-L$(MPI_HOME)/include
On some machines, the MPI linking needs some special libraries. If this is the case, the variable MPI_ADDLIBS has to be set.
export MPI_ADDLIBS=-lnsl -lsocket -lrt -lnsl -laio export MPI_ADDLIBS=-L/opt/gm-1.4.1/binary/lib -lgm
On some machines, these additional libraries can be identified with the following command:
mpif77 -linkinfo
PAPI (Performance Application Programming Interface) [Muc01] aims to provide the tool designer and application engineer with a consistent interface and methodology for use of the performance counter hardware found in most major microprocessors. ADAPTOR uses for its performance monitoring features this interface to enable the user to see the relation between software performance and processor events.
For its correct use, ADAPTOR has to know where it finds the include file papi.h and the corresponding library. The following variables should be set for the installation before calling configure:
export PAPI_INC=-I/home/brandes/papi-2.3.4.3/src export PAPI_LIB="-L/home/brandes/papi-2.3.4.3/src -lpapi"
If the environment variable PAPI_HOME has been set, the installation will take the following settings as default:
PAPI_INC="-I${PAPI_HOME}/include" PAPI_LIB="-L${PAPI_HOME}/lib -lpapi"
If PAPI itself has been installed by
make DESTDIR=dir install
PAPI_HOME should be set to the installation directory dir.
The PAPI interface within ADAPTOR has been written version independent, so it should work with PAPI Version 2.3 and PAPI Version 3.0 (beta). If PAPI is not available on your machine or the configuration could not identify the PAPI installation, there will be a warning. The PAPI interface is not necessary at all for the ADAPTOR tool.
Note: Before using the PAPI interface with ADAPTOR you should make sure that the PAPI installation works correctly on your machine.
ADAPTOR also supports performance monitoring with the PCL interface [BM03]. This software package should have been installed on your machine before running the configure script. If PCL is not available, the PCL interface for ADAPTOR will not be generated. If PCL itself has been installed by gmake install PCL_HOME should be set to the installation directory (which is /usr/local by default).
PCL_HOME="/usr/local/"
For its correct use, ADAPTOR has to know where it finds the include file pcl.h and has to know how to link PCL programs. If the variables PCL_INC and PCL_LIB have not been specified explicitly, the configuration takes the following settings:
PCL_INC="-I${PCL_HOME}\include" PCL_LIB="-L${PCL_HOME}\lib -lpcl"
It is also possible to set these two variables PCL_INC and PCL_LIB explicitly before calling configure:
export PCL_INC=-I/home/brandes/pcl_sun/src export PCL_LIB="-L/home/brandes/pcl_sun/bin/sparc-sun-solaris2.9 -lpcl -lcpc"
If neither of all the variables has been set, it is assumed that the C compiler will find the include file and the PCL library (PCL_LIB=-lpcl) in any case.
The PCL interface has been tested with Version 2.2. But it should work with older versions as well as might hopefully with upcoming versions. If PCL is not available on your machine or the configuration could not identify the PCL installation, there will be a warning. The PCL interface is not necessary at all for the ADAPTOR tool.
Perfctr is a package that adds support to the Linux kernel for using the Performance-Monitoring Counters (PMCs) found in many modern x86-class processors. This package and future versions of this package can be downloaded from
http://www.csd.uu.se/~mikpe/linux/perfctr/
PAPI and PCL use this package on Linux platforms with Intel processors to get access to the Performance Monitoring Counters (PMCs). On Linux platforms with Intel Pentium 4, ADAPTOR can use this interface directly instead of using the PAPI and PCL interface. By this way, it is possible to use more machine-specific performance counters and to avoid certain overhead introduced by PAPI or PCL.
The perfctr installation of the user-space library, the include files, and the 'perfex' application program, should have been completed by
make PREFIX=$PREFIX install
The installation directory PREFIX should be set for the variable PERFCTR_HOME.
export PERFCTR_HOME=$PREFIX
Similar to PAPI and PCL, it is also possible to set the two variables PERFCTR_INC and PERFCTR_LIB explicitly before calling configure:
export PERFCTR_INC=-I$(INCLDIR) export PERFCTR_LIB=-L$(LIBDIR) -lperfctr
If neither of all the variables has been set, it is assumed that the C compiler will find the include file and the perfctr library (PERFCTR_LIB=-lperfctr) in any case.
The Vampirtrace profiling tool produces tracefiles that can be analyzed with the VAMPIR performance analysis tool [BHNW01]. By default, VampirTrace records only all calls to the MPI library, but it also allows arbitrary user defined events to be recorded. The ADAPTOR runtime system can use VampirTrace to generate trace records at the entry and exit of source code regions and for values of performance counters (e.g. cache misses, floating point instructions, cycles). It can use VampirTrace for MPI programs and for serial programs (and hopefully OpenMP very soon).
For the installation, it is necessary to specify the installation directory where VampirTrace is installed.
export VT_ROOT = ...
The installation assumes to find the include file and the library at the following places:
VT_LIB = $(VT_ROOT)/lib VT_INC = $(VT_ROOT)/include
The include file is needed to compile the ADAPTOR runtime interface for VampirTrace. The library is needed to link instrumented and compiled programs correctly.
If any value regarding your installation changes, e.g. you want to use another Fortran compiler as target compiler or you have a new home for the MPI installation, the safest way to do it is the following one:
make distclean ! deletes executables and configuration files export F77=... ! set new configuration parameters configure ! run the configuration script make ! generate the ADAPTOR system again
If there are only small changes, it might also be possible to make some modifications within the files generated by the configure script (see Section 4.1).
If you have any problems in finding correct values for all the variables used for the ADAPTOR installation, you should look in the directory $PHOME/config_tools for the example programs. The best way is to make all example programs by setting the variables in the makefile correctly and rerun the configure script with the variables used in the makefile.
cd $PHOME/config_tools make - edit makefile to get all programs running