High Performance Fortran (HPF) Exercise


  1. Login To The SP machine

    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.

  2. Verify The Environment Variable $WORKSHOP

    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
    

  3. Create Your .rhosts File

    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

  4. Create a subdirectory for the HPF exercise files

    mkdir ~/hpf
    cd ~/hpf

  5. Copy The HPF Example Files

    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

  6. List The Contents Of Your HPF Subdirectory

    You should notice several files. These files comprise the exercise codes. For HPF, the following exercise codes have been implemented:

  7. Compile And Run The Serial Version Of An Exercise Code

    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

  8. Compile The Parallel Version Of An Exercise Code

    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

  9. Set The Necessary POE Environment Variables

    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.

  10. Run the executables

    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.