| High Performance Fortran (HPF) Exercise |
Make sure that you are logged into your assigned SP node with your assigned userid for this exercise. Ask the instructor if you have any questions.
The $WORKSHOP variable defines the root location for the workshop files, and may vary from workshop to workshop. Find out if this has already been setup for your workshop:
echo $WORKSHOP
If this environment variable is not set, check with the instructor for the correct location. Then, depending upon your shell, set $WORKSHOP:
| csh/tcsh | setenv WORKSHOP /u/nmcibm/workshop |
|---|---|
| bsh/ksh | export WORKSHOP=/u/nmcibm/workshop |
Make sure that you have a .rhosts file in your home directory. It should contain the name of every SP node which you may be using. If you have completed the POE exercises, this file may already be present. If not, use your favorite Unix editor to create it, or copy the example .rhosts file provided for the MHPCC SP training system:
cp $WORKSHOP/samples/rhosts ~/.rhosts
mkdir ~/hpf
cd ~/hpf
Copy all of the HPF exercise files (both serial and parallel versions) to your HPF subdirectory:
cp $WORKSHOP/hpf/samples/serial/* ~/hpf
cp $WORKSHOP/hpf/samples/* ~/hpf
You should notice several files. These files comprise the exercise codes. For HPF, the following exercise codes have been implemented:
Select any or all of the exercise files. Start by reviewing the serial version of the code. Compile and then execute the serial version. For example, to compile the serial Fortran version of the Array Decomposition exercise:
make -f make.ser_array.f
ser_array
First, review the source code for the parallel HPF version. Notice the HPF directives and how parallelism has been implemented.
Compile the parallel HPF version of the exercise code (a makefile has been provided). For example, to compile the Fortran version of the Array Decomposition exercise:
make -f make.hpf_array.f
Prior to execution, you will need to set the necessary POE environment variables, such as MP_PROCS, MP_EUILIB, etc. See the POE tutorial and/or the POE lab exercise for details about setting POE environment variables.
The name of the executable may be found by reviewing the makefile. For example:
hpf_array
Run as many of the exercise codes as time permits.
This concludes the HPF exercises.