HP-MPI Version 1.2 for Windows Release Note
6. Submit the job. The machine resources are allocated and the job is run.
>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. See “Running HP-MPI from HPCS” (page 17). To create the executable, perform
Steps 1 through 3 from the previous section. Then continue with:
1. Create a new job.
>job new /numprocessors:16 /exclusive:true
Job queued, ID: 4288
2. Submit a script. Verify MPI_ROOT is set in the environment (See the mpirun manpage for
more information):
> job add 4288 /numprocessors:1 /env:MPI_ROOT="%MPI_ROOT%"
/exclusive:true /stdout:\\node\path\to\a\shared\file.out
/stderr:\\node\path\to\a\shared\file.err path\submission_script.vbs
Where submission_script.vbs contains code such as:
Option Explicit
Dim sh, oJob, JobNewOut, appfile, Rsrc, I, fs
Set sh = WScript.CreateObject(“WScript.Shell”)
Set fs = CreateObject(“Scripting.FileSystemObject”)
Set oJob = sh.exec(“%MPI_ROOT%\bin\mpi_nodes.exe”)
JobNewOut = oJob.StdOut.Readall
Set appfile = fs.CreateTextFile(“<path>\appfile”, True)
Rsrc = Split(JobNewOut, “ “)
For I = LBound(Rsrc) + 1 to UBound(Rsrc) Step 2
appfile.WriteLine(“-h” + Rsrc(I) + “-np” + Rsrc(I+1) + _
“ ““<path>\foo.exe”” “)
Next
appfile.Close
Set oJob = sh.exec(“““%MPI_ROOT%\bin\mpirun.exe”” -TCP -f _
““<path>\appfile”” “)
wscript.Echo oJob.StdOut.Readall
3. Submit the job as in the previous example:
> job submit /id:4288
The above example using submission_script.vbs is only an example. Other scripting
languages can be used to convert the output ofmpi_nodes.exe into an appropriate appfile.
1.8.4 Building an MPI Application with Visual Studio and Using the Property Pages
To build an MPI application in C or C++ with VS2008, use the property pages provided by HP-MPI
to help link applications.
Two pages are included with HP-MPI, and are located at the installation location in %MPI_ROOT%\
help\HPMPI.vsprops and %MPI_ROOT%\help\HPMPI64.vsprops.
Go to VS Project→View→Property Manager and expand the project. This displays the different
configurations and platforms set up for builds. Include the appropriate property page
1.8 Building and Running Applications 27