HP-MPI Version 2.0 for Windows Release Note
• C/C++ — Additional Include Directories
Set to "%MPI_ROOT%\include\[32|64]"
• Linker — Additional Dependencies
Set to libhpmpi32.lib or libhpmpi64.lib depending on the application.
• Additional Library Directories
Set to "%MPI_ROOT%\lib"
9.5 Building and Running on a Windows 2008 Cluster Using Appfiles
The example teaches you the basic compilation and run steps to execute hello_world.c on a
cluster with 4-way parallelism. To build and run hello_world.c on a cluster using an appfile,
perform Steps 1 and 2 from “Building and Running on a Single Host” (page 39).
NOTE: Specify the bitness using -mpi64 or -mpi32 for mpicc to link in the correct libraries.
Verify you are in the correct bitness compiler window. Using -mpi64 in a Visual Studio 32-bit
command window does not work.
1. Create a file "appfile" for running on nodes n01 and n02 as:
C:\> -h n01 -np 2 \\node01\share\path\to\hello_world.exe -h n02 -np 2 \\node01\share\path\to\hello_world.exe
2. For the first run of the hello_world executable, use -cache to cache your password:
C:\> "%MPI_ROOT%\bin\mpirun" -cache -f appfile
Password for MPI runs:
When typing, the password is not echoed to the screen.
The HP-MPI Remote Launch service must be registered and started on the remote nodes.
mpirun will authenticated with the service and create processes using your encrypted
password to obtain network resources.
If you do not provide a password, the password is incorrect, or you use -nopass, remote
processes are created but do not have access to network shares. In the following example,
the hello_world.exe file cannot be read.
3. Analyze hello_world output.
HP-MPI prints the output from running the hello_world executable in non-deterministic
order. The following is an example of the output:
Hello world! I'm 1 of 4 on n01
Hello world! I'm 3 of 4 on n02
Hello world! I'm 0 of 4 on n01
Hello world! I'm 2 of 4 on n02
9.6 Running with an Appfile Using HPCS
Using an appfile with HPCS has been greatly simplified in this release of HP-MPI. The previous
method of writing a submission script that uses mpi_nodes.exe to dynamically generate an
appfile based on the HPCS allocation is still supported. However, the preferred method is to
allow mpirun.exe to determine which nodes are required for the job (by reading the
user-supplied appfile), request those nodes from the HPCS scheduler, then submit the job to
HPCS when the requested nodes have been allocated. The user writes a brief appfile calling out
the exact nodes and rank counts needed for the job. For example:
Perform Steps 1 and 2 from “Building and Running on a Single Host” (page 39).
1. Create an appfile for running on nodes n01 and n02 as:
C:\> -h n01 -np 2 hello_world.exe
-h n02 -np 2 hello_world.exe
42 Compiling and Running Applications