Running HPF Programs on the NOW

The following is a description of how to run HPF programs on the Berkeley NOW. 
 

Setting up your environment

Type:

source /usr/castle/proj/cs267/cs267.cshrc

Log into the NOW

Compiling a program

You'll now be able to compile a sample program.  Copy the following file to a directory: karp.hpf
This is a hpf file that computes PI through integration.
 
Now, execute the following command to compile the program.  By default, the compiler will add the libraries necessary to communicate via sockets.  There are many other compiler options listed in the pghpf's web pages.

pghpf -Mstats karp.hpf -o karp

This will compile the karp program, and insert profiling code that will assist in reporting the memory used/messages sent by the program.  The compiler will produce a file called 'karp'

If you experienced problems trying to compile, make sure that your path was set up correctly as noted in the first section above.

Running a program

Setting things up

Running the program

Advanced

 
The HPF compiler also supports some of CM FORTRAN.  By default, CM FORTRAN is accepted in some cases.  See the  HPF documentation for more details.
 

HPF on MPI

Compiling a HPF program with MPI

  • First, setup your environment as to compile a socket version of HPF program.
  • To compile with MPI option, you have to setup two environment variables before compiling:
  • setenv HPF_MPI "/disks/barad-dur/now/MPI/mpich/lib/solaris/hpf/"
    setenv HPF_SOCKET "-lglunix -lLAM -lsocket -lnsl -lposix4 -lLanaiDevice -lbfd -liberity -lthread -lm"
  • Then, compile your program with the -Mmpi option:
  • pghpf -Dmpi your_program.hpf -o your_executable

     
    Running the executable
  • Setup the environment for the MPI. For more information consult the MPI on NOW HowTo
  • Then, run your executable as follows:
  • your_executable -pghpf -np #_of_nodes
    Note: MPI command line arguments that defined in MPI on NOW HowTo can still be used.
     
    chad@cs.berkeley.edu