Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP-MPI User's Guide > Chapter 2 Getting started

Getting started using Windows

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

 » Glossary

 » Index

Configuring your environment

The default install directory location for HP-MPI for Windows is one of the following directories:

On 64-bit Windows:

C:\Program Files (x86)\Hewlett-Packard\HP-MPI

On 32-bit Windows:

C:\Program Files \Hewlett-Packard\HP-MPI

The default install will define the system environment variable MPI_ROOT, but will not put "%MPI_ROOT%\bin" in the system path or your user path.

If you choose to move the HP-MPI installation directory from its default location:

  • Change the system environment variable MPI_ROOT to reflect the new location.

  • You may need to add "%MPI_ROOT%\bin\mpirun.exe" and "%MPI_ROOT%\bin\mpid.exe" to the firewall exceptions depending on how your system is configured.

HP-MPI must be installed in the same directory on every execution host.

To determine the version of an HP-MPI installation, use the -version flag on the mpirun command:

C:\> "%MPI_ROOT%\bin\mpirun" -version

Compiling and running your first application

To quickly become familiar with compiling and running HP-MPI programs, start with the C version of the familiar 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 source code for hello_world.c is stored in %MPI_ROOT%\help and can be seen in “Compiling and running your first application”.

Building and running on a single host

The example teaches you the basic compilation and run steps to execute hello_world.c on your local host with four-way parallelism. To build and run hello_world.c on a local host named mpiccp1:

  1. Change to a writable directory.

  2. Open a Visual Studio command window. (This example uses a 64-bit version, so a Visual Studio x64 command window is opened.)

  3. Compile the hello_world executable file:

    C:\demo> "%MPI_ROOT%\bin\mpicc" -mpi64 ^
    "%MPI_ROOT%\help\hello_world.c"

    Microsoft® C/C++ Optimizing Compiler Version 14.00.50727.42 for x64
    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. Run the hello_world executable file:

    C:\demo> "%MPI_ROOT%\bin\mpirun" -np 4 hello_world.exe

    where -np 4 specifies 4 as the number of processors to run.

  5. 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 0 of 4 on mpiccp1 
    Hello world! I'm 3 of 4 on mpiccp1
    Hello world! I'm 1 of 4 on mpiccp1
    Hello world! I'm 2 of 4 on mpiccp1

Building and running multihost on Windows CCS 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 CCS cluster:

  1. Change to a writable directory.

  2. Open a Visual Studio command window. (This example uses a 64-bit version, so a Visual Studio x64 command window is opened.)

  3. Compile the hello_world executable file:

    C:\demo> "%MPI_ROOT%\bin\mpicc" -mpi64 ^
    "%MPI_ROOT%\help\hello_world.c"

    Microsoft® C/C++ Optimizing Compiler Version 14.00.50727.42 for x64
    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:

    > job new /numprocessors:16

  5. Add a single-CPU mpirun task to the newly created job. Note that mpirun will create more tasks filling the rest of the resources with the compute ranks, resulting in a total of 16 compute ranks for this example:

    > job add JOBID /numprocessors:1
            /stdout:\\node\path\to\a\shared\file.out
            /stderr:\\node\path\to\a\shared\file.err
            "%MPI_ROOT%\bin\mpirun" -ccp \\node\path ^
         \to\hello_world.exe

  6. Submit the job. The machine resources are allocated and the job is run.

    > job submit /id:JOBID

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. Note that 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 CCP”. 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

  2. Submit a script. Verify MPI_ROOT is set in the environment (See the mpirun man page for more information):

    > job add JOBID /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
  3. Submit the job as in the previous example:

    > job submit /id:JOBID

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 on Windows with Visual Studio and using the property pages

To build an MPI application on Windows 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 (MPI_ROOT) in help\HPMPI.vsprops and HPMPI64.vsprops.

Go to VS Project, select View, select Property Manager and expand the project. This will display the different configurations and platforms set up for builds. Include the appropriate property page (HPMPI.vsprops for 32-bit apps, HPMPI64.vsprops for 64-bit apps) in the Configuration/Platform section.

Select this page by either double-clicking the page or by right-clicking on the page and selecting Properties. Go to the User Macros section. Set MPI_ROOT to the desired location (i.e. the installation location of HP-MPI). This should be set to the default installation location:

%ProgramFiles(x86)%\Hewlett-Packard\HP-MPI

NOTE: This is the default location on 64-bit machines. The location for 32-bit machines is %ProgramFiles%\Hewlett-Packard\HP-MPI

The MPI application can now be built with HP-MPI.

The property page sets the following fields automatically, but can also be set manually if the property page provided is not used:

  • 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"

Directory structure for Windows

All HP-MPI for Windows files are stored in the directory specified at install time. The default directory is C:\Program Files (x86)\
Hewlett-Packard\HP-MPI. The directory structure is organized as described in Table 2-3 “Directory Structure for Windows”. If you move the HP-MPI installation directory from its default location, set the MPI_ROOT environment variable to point to the new location.

Table 2-3 Directory Structure for Windows

SubdirectoryContents
bin

Command files for the HP-MPI utilities

help

Source files for the example programs, Visual Studio Property pages

include\32

32-bit header files

include\64

64-bit header files

lib

HP-MPI libraries

man

HP-MPI man pages in HTML format

devtoolsWindows HP-MPI services
licensesRepository for HP-MPI license file

doc

Release notes, Debugging with HP-MPI Tutorial

 

Windows man pages

The man pages are located in the "%MPI_ROOT%\man\" subdirectory for Windows. They can be grouped into three categories: general, compilation, and run time. There is one general man page, MPI.1, that is an overview describing general features of HP-MPI. The compilation and run-time man pages are those that describe HP-MPI utilities.

Table 2-4 “Windows man page categories” describes the three categories of man pages in the man1 subdirectory that comprise man pages for HP-MPI utilities.

Table 2-4 Windows man page categories

Categoryman pagesDescription
GeneralMPI.1

Describes the general features of
HP-MPI

Compilationmpicc.1 mpif90.1

Describes the available compilation utilities. Refer to “Compiling applications” for more information

Runtimempidebug.1
mpienv.1 mpimtsafe.1mpirun.1
mpistdio.1
autodbl.1

Describes runtime utilities, environment variables, debugging, thread-safe and diagnostic libraries

 

Licensing Policy for Windows

HP-MPI 1.0 for Windows uses FLEXlm licensing technology. A license is required to use HP-MPI for Windows. Licenses can be purchased from HP’s software depot at http://www.hp.com/go/softwaredepot, or contact your HP representative.

Demo licenses for HP-MPI are also available from HP’s software depot.

HP-MPI has an Independent Software Vendor (ISV) program that allows participating ISVs to freely distribute HP-MPI with their applications. When the application is part of the HP-MPI ISV program, there is no licensing requirement for the end user. The ISV provides a licensed copy of HP-MPI. Contact your application vendor to find out if they participate in the HP-MPI ISV program. The copy of HP-MPI distributed with a participating ISV will only work with that application. An HP-MPI license is required for all other applications.

Licensing for Windows

HP-MPI 1.0 for Windows uses FLEXlm licensing technology. A license file can be named either as license.dat or any file name with an extension of .lic. The license file must be placed in the installation directory (default C:\Program Files (x86)\Hewlett-Packard\
HP-MPI\licenses
) on all the runtime systems, and on the license server.

You will need to provide the hostname and hostid number of the system where the FLEXlm daemon for HP-MPI for Windows will run. The hostid can be obtained by typing the following command if HP-MPI is already installed on the system:

%MPI_ROOT%\bin\licensing\<arch>\lmutil lmhostid

The hostname can be obtained using the control panel by following Control Panel -> System -> Computer Name tab.

The default search path used to find an MPI license file is:

"%MPI_ROOT%\licenses:.".

If the license needs to be placed in another location which would not be found by the above search, the user may set the environment variable LM_LICENSE_FILE to explicitly specify the location of the license file.

For more information, see http://licensing.hp.com.

Installing License Files

A valid license file contains the system hostid and the associated license key. License files can be named either as license.dat or any name with extension of *.lic (like mpi.lic, for example). The license file must be copied to the installation directory (default C:\Program Files (x86)\Hewlett-Packard\HP-MPI\
licenses
) on all runtime systems, and to the license server.

The command to run the license server is:

"%MPI_ROOT%\bin\licensing\<arch>\lmgrd" -c mpi.lic

License Testing

Build and run the hello_world program in %MPI_ROOT%\help\hello_world.c to check for a license. If your system is not properly licensed, you will receive the following error message:

(“MPI BUG: Valid MPI license not found in search path”)
Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 1979-2007 Hewlett-Packard Development Company, L.P.