HP-MPI Version 1.2 for Windows Release Note

C:\> Documents and Settings\smith>s:S:\> cd smithS:\smith>
"%MPI_ROOT%\bin\mpirun.exe" -ccp -np 6 -hostlist mpiccp1,mpiccp2
HelloWorld.exe
mpirun: Submitting job to scheduler and exiting
Submitting job to ccp scheduler on this node
mpirun: HPMPI Job 1117 submitted to cluster mpiccp1
Here the S: drive is interpreted as the mapped network drive. The rank HelloWorld.exe is
located in the current directory, and the stdout and stderr files are placed in the current working
directory.
In the example above,mpirun is instructed to run 6 ranks across the machines mpiccp1 and
mpiccp2 with the layout having ranks 0, 2, and 4 on mpiccp1 and ranks 1, 3, and 5 on mpiccp2.
So mpirun creates a HPCS job allocation specifically requesting hosts mpiccp1 and mpiccp2,
and launches the task onto those nodes.
1.8 Building and Running Applications
This section provides instructions for compiling and running applications.
1.8.1 Compiling and Running Your First Application
To quickly become familiar with compiling and running HP-MPI programs, start with the C
version of the hello_world program. This program is called hello_world.c and prints out the
text string "Hello world! I’m r of s on host" where r is a process’s rank, s is the size of the
communicator, and host is the host on which the program is run. The processor name is the
host name for this implementation. HP-MPI returns the hostname for
MPI_Get_processor_name.
The source code for hello_world.c is stored in %MPI_ROOT%\help and is shown below.
#include <stdio.h>
#include "mpi.h"
void main(argc, argv)
int argc;
char *argv[];
{
int rank, size, len;
char name[MPI_MAX_PROCESSOR_NAME];
MPI_Init(&argc, &argv);
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
MPI_Comm_size(MPI_COMM_WORLD, &size);
MPI_Get_processor_name(name, &len);
printf("Hello world!I'm %d of %d on %s\n", rank, size, name);
MPI_Finalize();
exit(0);
}
1.8.2 Building and Running on a Single Host
The example decribes the basic compilation and run steps to execute hello_world.c on your
local host with 4-way parallelism. To build and run hello_world.c on a local host named
banach1:
1. Change to a writable directory, and copy hello_world.c from the help directory:
> copy "%MPI_ROOT%\help\hello_world.c" .
2. Compile the hello_world executable file.
In a proper compiler command window (for example, Visual Studio command window),
use mpicc to compile your program:
> "%MPI_ROOT%\bin\mpicc" -mpi64 hello_world.c
1.8 Building and Running Applications 25