Examples
Co-Array Fortran Sample Programs
Downloading the Sources
To reduce the effort needed to distribute the Co-Array Fortran Sample Programs (caf-programs), we have opted to distribute it in source form only. Source files for the programs are distributed via anonymous CVS checkout.
- To retrieve the source files from CVS, you will need to download hipersoft-anonssh an ssh script that contains a key that will grant you read-only access to the Hipersoft CVS repositories at Rice University. Save this script in ${HOME}/bin/hipersoft-anonssh and change permissions to make it executable.
 
 
- Set up the required CVS environment variables to enable you to access the caf-programs repository.
 
 (csh variants) setenv CVS_RSH ${HOME}/bin/hipersoft-anonssh
 setenv CVSROOT :ext:anoncvs@koolkat2.cs.rice.edu:/Volumes/cvsrep/developer
 
 (sh variants)
 export CVS_RSH=${HOME}/bin/hipersoft-anonssh
 export CVSROOT=:ext:anoncvs@koolkat2.cs.rice.edu:/Volumes/cvsrep/developer
 
 
- Use CVS to check out the CAFC sources using the command
 
 cvs co caf-programs
External Packages
caf-programs need the following external packages: the Rice Co-Array Fortran Compiler (CAFC), MPI and possibly other vendor-specific communication libraries, such as GM and Quadrics.
CAFC Notes:
Review the instructions on downloading and installing CAFC.MPI Notes:
Downloaded MPICH. Information about vendor MPI implementations can be obtained from vendors' web sites.
Building caf-programs
- Change to the caf-programs directory
 cd caf-programs
- Generate the configure script
 autoconf
- Run the configure script. Use configure --help for all available options. The most important options are
 
 --with-cafc CAF compiler
 --with-mpi MPI root
 --with-gm Myrinet GM root (if necessary)
 --with-VendorCXX vendor C++ compiler
 --with-VendorF90=PATH path to Fortran compiler (/usr/local/bin/f90)
 
 The configure script will try to infer the vendor C, C++ and Fortran 90 compilers. The default values are:
 
 - Linux (IA32): gcc, g++, ifc
 - Linux (IA64): gcc, g++, efc
 - Alpha : cc, cxx, f90
 - IRIX64 : cc, CC, f90
- Build the unit tests:
 cd TestSuite
 cd barrier; make; cd -
 cd cafsum; make; cd -
 cd ccafsum; make; cd -
 cd dcafsum; make; cd -
 cd synchteam;make; cd -
 cd ..
- Build the CAF implementation of the NAS benchmarks (based on version 2.3) MG, CG, BT and SP:
 
 cd NPB-2.3
 cd MG-CAF; make CLASS= NPROCS= ; cd -
 cd CG-CAF; make CLASS= NPROCS= ; cd -
 cd BT-CAF; make CLASS= NPROCS= ; cd -
 cd SP-CAF; make CLASS= NPROCS= ; cd -
 cd -
 
 This will create executables in the NPB-2.3/bin directory.
 
- Build the MPI implementation of the NAS benchmarks 2.3 MG, CG, BT and SP:
 
 cd NPB-2.3
 cd MG; make CLASS= NPROCS= ; cd -
 cd CG; make CLASS= NPROCS= ; cd -
 cd BT; make CLASS= NPROCS= ; cd -
 cd SP; make CLASS= NPROCS= ; cd -
 cd -
 
 This will create executables in the NPB-2.3/bin directory.
 
- Build the sequential implementation of the NAS benchmarks 2.3 MG, CG, BT and SP:
 
 cd NPB-2.3-SER
 cd MG; make CLASS= ; cd -
 cd CG; make CLASS= ; cd -
 cd BT; make CLASS= ; cd -
 cd SP; make CLASS= ; cd -
 cd -
 
 This will create executables in the NPB-2.3-SER/bin directory.
 
We would welcome any advice on the compilation/linking flags for various vendor compilers that lead to the highest performance of these codes.
 
             
            