HP-MPI Version 1.1 for Windows Release Note
HP-MPI V1.1 for Windows Release Note
Building and running applications
37
> job add 4288 /numprocessors:1 ^
/env:MPI_ROOT="%MPI_ROOT%" ^
/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
Step 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 of mpi_nodes.exe into an appropriate appfile.
Building an MPI application with Visual Studio and using the
property pages
To build an MPI application in C or C++ with VS2005, 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.