HP-MPI Version 2.0 for Windows Release Note

Hello world! I'm 1 of 4 on banach1
Hello world! I'm 3 of 4 on banach1
Hello world! I'm 0 of 4 on banach1
Hello world! I'm 2 of 4 on banach1
9.3 Building and Running Multihost on Windows HPCS Clusters
The following is an example of basic compilation and run steps to execute hello_world.c on
a cluster with 16-way parallelism. To build and run hello_world.c on a HPCS cluster:
1. Change to a writable directory on a mapped drive. Share the mapped drive to a folder for
the cluster.
2. Open a Visual Studio command window. (This example uses a 64-bit version, so a Visual
Studio 64-bit command window is opened.)
3. Compile the hello_world executable file:
X:\demo> set MPI_CC=cl
X:\demo> "%MPI_ROOT%\bin\mpicc" -mpi64 "%MPI_ROOT%\help\hello_world.c"
Microsoft® C/C++ Optimizing Compiler Version 14.00.50727.42 for 64-bit
Copyright© Microsoft Corporation. All rights reserved.
hello_world.c
Microsoft® Incremental Linker Version 8.00.50727.42
Copyright© Microsoft Corporation. All rights reserved.
/out:hello_world.exe
"/libpath:C:\Program Files (x86)\Hewlett-Packard\HP-MPI\lib"
/subsystem:console
libhpmpi64.lib
libmpio64.lib
hello_world.obj
4. Create a new job requesting the number of CPUs to use. Resources are not yet allocated, but
the job is given a JOBID number which is printed to stdout:
C:\> job new /numprocessors:16 /exclusive:true
Job queued, ID: 4288
5. Add a single-CPU mpirun task to the newly created job. The mpirun job creates more tasks
filling the rest of the resources with the compute ranks, resulting in a total of 16 compute
ranks for this example:
C:\> job add 4288 /numprocessors:1 /exclusive:true /stdout:\\node\path\to\a\shared\file.out
/stderr:\\node\path\to\a\shared\file.err "%MPI_ROOT%\bin\mpirun" -hpc \\node\path\to\hello_world.exe
6. Submit the job. The machine resources are allocated and the job is run.
C:\> job submit /id:4288
To run Multiple-Program Multiple-Data (MPMD) applications or other more complex
configurations that require further control over the application layout or environment, dynamically
create an appfile within the job using the utility "%MPI_ROOT%\bin\mpi_nodes.exe" as in
the following example. The environment variable %CCP_NODES% cannot be used for this purpose
because it only contains the single CPU resource used for the task that executes the mpirun
command. To create the executable, perform Steps 1 through 3 from the previous section. Then
continue with:
1. Create a new job.
C:\> job new /numprocessors:16 /exclusive:true
Job queued, ID: 4288
40 Compiling and Running Applications