Running HPF Programs on the NOW
The following is a description of how to run HPF programs on the Berkeley
Setting up your environment
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
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
- There are two ways to execute programs - securely and unsecurely. We
strongly recommend that you use the secure method.
- rkinit to the remote machine that you are running on: (You don't have
to rkinit to all remote machines, since the rsh command will transfer the
ticket to the other remote machines.)
This will set up a ticket on the current machine you are running on.
You should only run 'kinit' to create tickets on the machine that you are
typing at, otherwise your kerberos password will be transfered over the
network in the clear. At the machine you are typing at, you should
run 'rkinit' to install tickets on machines remotely - rkinit will not
issue your password in cleartext.
For example, if you are typing at the machine whenever.cs.berkeley.edu
and you wanted to run programs from the machine u0.cs.berkeley.edu, you
- Unsecurely (not recommended)
- Add the current hostname to your .rhosts file
For example, if you are logged into u0.cs.berkeley.edu, then add
to the end of your ~/.rhosts file.
Running the program
Run it on 4 processors
- SECURELY: ./karp -pghpf -np 4 -host remote_host1,remote_host2,remote_host3
- UNSECURELY: ./karp -pghpf -np 4 -host remote_host1,remote_host2,remote_host3
-stat alls -rsh /bin/rsh
where remote_host1,remote_host2,remote_host3 are the names of 3 machines
that you are going to run on, e.g. u1,u2,u3
Note that HPF will automatically run a copy on the current host,
so you specify only the N-1 remote hosts on the command line.
**TODO: create a 'rsh'-like shell to spawn jobs using GLUnix.
HPF expects a rsh tool to spawn off jobs.
Consult the HPF documentation
for the entire list of options, but here are some common ones:
- -v for verbose runtime
- -dyn for dynmically pick nodes based on load average
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.