Intel® MPI Library For Windows OS: Developer Guide
Intel® MPI Library For Windows OS: Developer Guide
Developer Guide
Contents
Legal Information ........................................................................................................................................................... 4
1. Introduction ................................................................................................................................................................ 5
1.1. Introducing Intel® MPI Library ............................................................................................................................................. 5
1.2. Conventions and Symbols.................................................................................................................................................... 5
1.3. Related Information ................................................................................................................................................................ 5
2. Installation and Licensing ........................................................................................................................................ 7
2.1. Installation ................................................................................................................................................................................... 7
2.2. Licensing for Intel® MPI Library Distributions .............................................................................................................. 7
3. Prerequisite Steps ...................................................................................................................................................... 8
3.1. User Authorization ................................................................................................................................................................... 8
4. Compiling and Linking ............................................................................................................................................10
4.1. Compiling an MPI Program ............................................................................................................................................... 10
4.1.1. Compiling an MPI/OpenMP* Program ............................................................................................................. 10
4.1.2. Test MPI Programs .................................................................................................................................................... 10
4.2. Configuring a Visual Studio* Project ............................................................................................................................. 11
5. Running Applications ..............................................................................................................................................12
5.1. Running an MPI Program ................................................................................................................................................... 12
5.2. Running an MPI/OpenMP* Program ............................................................................................................................. 12
5.3. MPMD Launch Mode ............................................................................................................................................................ 13
5.4. Job Schedulers Support ..................................................................................................................................................... 13
5.4.1. Microsoft* HPC Pack* .............................................................................................................................................. 14
5.4.2. Altair* PBS Pro* .......................................................................................................................................................... 14
5.4.3. Controlling Per-Host Process Placement ....................................................................................................... 14
5.5. Cross-OS Launch Mode ...................................................................................................................................................... 14
6. Configuring Program Launch .................................................................................................................................16
6.1. Selecting Library Configuration ...................................................................................................................................... 16
6.2. Controlling Process Placement ....................................................................................................................................... 16
6.2.1. Specifying Hosts ........................................................................................................................................................ 16
6.2.2. Using Machine File .................................................................................................................................................... 17
6.2.3. Using Argument Sets ............................................................................................................................................... 17
6.3. Selecting Fabrics .................................................................................................................................................................... 18
6.3.1. Default Behavior ........................................................................................................................................................ 18
6.3.2. Defining Fabric List ................................................................................................................................................... 19
6.3.3. Selecting Specific Fabric ........................................................................................................................................ 19
6.3.4. Advanced Fabric Control........................................................................................................................................ 19
7. Statistics and Analysis ............................................................................................................................................20
7.1. Getting Debug Information ............................................................................................................................................... 20
7.2. Gathering Statistics ............................................................................................................................................................... 21
7.2.1. Native Statistics .......................................................................................................................................................... 21
7.2.2. IPM Statistics ............................................................................................................................................................... 21
7.2.3. Native and IPM Statistics ........................................................................................................................................ 22
7.2.4. Region Control with MPI_Pcontrol .................................................................................................................... 22
2
Intel® MPI Library Developer Guide for Windows* OS
3
Legal Information
Legal Information
No license (express or implied, by estoppel or otherwise) to any intellectual property rights is granted by this
document.
Intel disclaims all express and implied warranties, including without limitation, the implied warranties of
merchantability, fitness for a particular purpose, and non-infringement, as well as any warranty arising from
course of performance, course of dealing, or usage in trade.
This document contains information on products, services and/or processes in development. All information
provided here is subject to change without notice. Contact your Intel representative to obtain the latest
forecast, schedule, specifications and roadmaps.
The products and services described may contain defects or errors known as errata which may cause
deviations from published specifications. Current characterized errata are available on request.
Intel technologies features and benefits depend on system configuration and may require enabled hardware,
software or service activation. Learn more at Intel.com, or from the OEM or retailer.
Intel, the Intel logo, VTune, Xeon, and Xeon Phi are trademarks of Intel Corporation in the U.S. and/or other
countries.
Optimization Notice
Intel's compilers may or may not optimize to the same degree for non-Intel microprocessors for optimizations
that are not unique to Intel microprocessors. These optimizations include SSE2, SSE3, and SSSE3 instruction
sets and other optimizations. Intel does not guarantee the availability, functionality, or effectiveness of any
optimization on microprocessors not manufactured by Intel. Microprocessor-dependent optimizations in this
product are intended for use with Intel microprocessors. Certain optimizations not specific to Intel
microarchitecture are reserved for Intel microprocessors. Please refer to the applicable product User and
Reference Guides for more information regarding the specific instruction sets covered by this notice.
Notice revision #20110804
4
1. Introduction
The Intel® MPI Library Developer Guide explains how to use the Intel® MPI Library in some common usage
scenarios. It provides information regarding compiling, running, debugging, tuning and analyzing MPI
applications, as well as troubleshooting information.
This Developer Guide helps a user familiar with the message passing interface start using the Intel® MPI Library.
For full information, see the Intel® MPI Library Developer Reference.
5
Introduction
Intel® MPI Library Release Notes for updated information on requirements, technical support, and
known limitations.
Intel® MPI Library Developer Reference for in-depth knowledge of the product features, commands,
options, and environment variables.
Intel® MPI Library for Windows* OS Knowledge Base for additional troubleshooting tips and tricks,
compatibility notes, known issues, and technical notes.
For additional resources, see:
Intel® MPI Library Product Web Site
Intel® Software Documentation Library
Intel® Software Products Support
6
2. Installation and Licensing
2.1. Installation
If you have a previous version of the Intel® MPI Library for Windows* OS installed, you do not need to uninstall
it before installing a newer version.
To install Intel MPI Library, double-click on the distribution file w_mpi_p_<version>.<package_num>.exe
(complete product), and w_mpi-rt_p_<version>.<package_num>.exe (RTO component only).
You will be asked to choose a directory in which the contents of the self-extracting installation file will be
placed before the actual installation begins. After installation, the files will still be located in this directory. By
default, C:\Program Files (x86)\Intel\Download is used on machines with Intel® 64 architecture.
Follow the prompts outlined by the installation wizard to complete the installation. See full description of the
installation process and requirements in the Intel® MPI Library for Windows* OS Installation Guide. You can
also find information about silent installation and cluster installation in the installation guide.
NOTE
You need the domain administrator rights when you install the Intel® MPI Library on Windows* OS. Otherwise,
you cannot proceed with the Active Directory* setup on Windows* OS. See the Intel® MPI Library Developer
Reference for more Active Directory* setup information.
7
3. Prerequisite Steps
Before you start using any of the Intel® MPI Library functionality, make sure to establish the proper
environment for Intel MPI Library. Follow these steps:
1. Set up the Intel MPI Library environment. Run the mpivars.bat script:
> <installdir>\bin\mpivars.bat
By default, <installdir> is C:\Program Files
(x86)\IntelSWTools\mpi\<version>\intel64.
NOTE
The mpivars.bat script sets dynamic environment variables for Intel® MPI Library. To use the Intel MPI
Library functionality, launch its commands in the same command-line session where you run the
mpivars.bat script.
2. To run an MPI application on a cluster, Intel MPI Library needs to know names of all its nodes. Create a
text file listing the cluster node names. The format of the file is one name per line, and the lines
starting with # are ignored. To get the name of a node, use the hostname utility.
A sample host file may look as follows:
> type hosts
# this line is ignored
clusternode1
clusternode2
clusternode3
clusternode4
3. Make sure the Hydra service is installed and running on the cluster nodes. To check this, enter the
command:
> hydra_service -status
If the service is not running, use the following command to install and run it:
> hydra_service -install
4. Register your Windows* user credentials to enable the process manager to launch MPI jobs.
Credentials are encrypted and stored in the registry:
> mpiexec -register
If you do not do this in advance, you will be prompted to enter credentials when running an MPI job
with mpiexec.
You can also use the domain-based authorization, which does not ask for your credentials, but
requires some additional configuration. See User Authorization for details.
After completing these steps, you are ready to use Intel® MPI Library.
8
Intel® MPI Library Developer Guide for Windows* OS
The password-based authorization is the most common method of providing remote node access through a
user’s existing account name and password. Intel MPI Library allows you to encrypt your login information and
store it in the registry with the mpiexec –register command. You need to do this once, during the first
application run.
The domain-based authorization uses Microsoft* Security Service Provided Interface* (SSPI*) to allow user
authentication on the remote machines. This is done in accordance with the established domain policies, as
defined by the cluster administrator. No user account information (user name and password) is stored on the
machine.
To enable the domain-based authorization method on a Windows* OS cluster, the administrator needs to
setup Active Directory* delegation for the compute nodes and cluster users.
For more details on how to enable the Active Directory setup, see the Developer Reference, section
Miscellaneous > User Authorization.
9
4. Compiling and Linking
NOTE
By default, the resulting executable file is linked with the multi-threaded optimized library. If you need to use
another library configuration, see Selecting Library Configuration.
For details on the available compiler wrapper scripts, see the Developer Reference.
See Also
Intel® MPI Library Developer Reference, section Command Reference > Compiler Commands
10
Intel® MPI Library Developer Guide for Windows* OS
11
5. Running Applications
See Also
Controlling Process Placement
Job Schedulers Support
12
Intel® MPI Library Developer Guide for Windows* OS
corresponding domain (set of logical processors). If OMP_NUM_THREADS is not set, each node is
treated as a separate domain, which allows as many threads per MPI process as there are cores.
NOTE
For pinning OpenMP* threads within the domain, use the KMP_AFFINITY environment variable. See the Intel®
compiler documentation for more details.
3. Run your hybrid program as a regular MPI program. You can set the OMP_NUM_THREADS and
I_MPI_PIN_DOMAIN variables directly in the launch command. For example:
> mpiexec -n 4 -genv OMP_NUM_THREADS=4 -genv I_MPI_PIN_DOMAIN=omp myprog.exe
See Also
Intel® MPI Library Developer Reference, section Tuning Reference > Process Pinning > Interoperability with
OpenMP*.
13
Running Applications
14
Intel® MPI Library Developer Guide for Windows* OS
-genv I_MPI_FABRICS=shm:tcp
-host <hostname>
-hostos <os> for nodes operating on the other OS
-env I_MPI_ROOT and -env LD_LIBRARY_PATH – local environment variables for the specified
host
-bootstrap service – specifies the remote node access mechanism
For example, the following command runs the IMB-MPI1 benchmark under the Windows-Linux
heterogeneous environment:
> mpiexec -demux select -bootstrap service -genv I_MPI_FABRICS shm:tcp ^
-env I_MPI_ROOT=<linux_installdir> -env
LD_LIBRARY_PATH=<linux_installdir>/<arch>/lib ^
-hostos linux -host <lin_host> -n 2 <linux_installdir>/<arch>/bin/IMB-MPI1 pingpong
:^
-host <win_host> -n 3 <windows_installdir>\<arch>\bin\IMB-MPI1 pingpong
15
6. Configuring Program Launch
Argument Definition
NOTE
You do not need to recompile the application to change the configuration. Run the mpivars.bat script with
appropriate arguments before an application launch.
16
Intel® MPI Library Developer Guide for Windows* OS
An alternative to using the -hosts option is creation of a host file that lists the cluster nodes. The format of
the file is one name per line, and the lines starting with # are ignored. Use the -f option to pass the file to
mpiexec. For example:
> type hosts
#nodes
node1
node2
> mpiexec -n 4 -ppn 2 -f hosts testc.exe
This program launch produces the same output as the previous example.
If the -ppn option is not specified, the process manager assigns as many processes to the first node as there
are physical cores on it. Then the next node is used. That is, assuming there are four cores on node1 and you
launch six processes overall, four processes are launched on node1, and the remaining two processes are
launched on node2. For example:
> mpiexec -n 6 -hosts node1,node2 testc.exe
Hello world: rank 0 of 6 running on node1
Hello world: rank 1 of 6 running on node1
Hello world: rank 2 of 6 running on node1
Hello world: rank 3 of 6 running on node1
Hello world: rank 4 of 6 running on node2
Hello world: rank 5 of 6 running on node2
NOTE
If you use a job scheduler, specifying hosts is unnecessary. The processes manager uses the host list provided
by the scheduler.
17
Configuring Program Launch
See Also
Controlling Process Placement with the Intel® MPI Library (online article)
Job Schedulers Support
dapl Direct Access Programming Library* (DAPL)-capable network fabrics, such as InfiniBand* and
iWarp* (through DAPL).
tcp TCP/IP-capable network fabrics, such as Ethernet and InfiniBand* (through IPoIB*).
Use the I_MPI_FABRICS environment variable to specify a fabric. Additional environment variables for
controlling fabric selection are I_MPI_FABRICS_LIST and I_MPI_FALLBACK. Their description is available in
the Developer Reference, section Tuning Reference > Fabrics Control.
See below for more information.
18
Intel® MPI Library Developer Guide for Windows* OS
NOTE
These parameters are intended for experienced users, and under normal circumstances, you are not
recommended to adjust them manually.
19
7. Statistics and Analysis
Intel® MPI Library provides a variety of options for analyzing MPI applications. Some of these options are
available within the Intel MPI Library, while some require additional analysis tools. For such tools, Intel MPI
Library provides compilation and runtime options and environment variables for easier interoperability.
NOTE
High values of I_MPI_DEBUG can output a lot of information and significantly reduce performance of your
application. A value of I_MPI_DEBUG=5 is generally a good starting point, which provides sufficient
information to find common errors.
By default, each printed line contains the MPI rank number and the message. You can also print additional
information in front of each message, like process ID, time, host name and other information, or exclude some
information printed by default. You can do this in two ways:
Add the '+' sign in front of the debug level number. In this case, each line is prefixed by the string
<rank>#<pid>@<hostname>. For example:
> mpiexec -genv I_MPI_DEBUG=+2 -n 2 testc.exe
[0#3520@clusternode1] MPI startup(): Multi-threaded optimized library
...
To exclude any information printed in front of the message, add the '-' sign in a similar manner.
Add the appropriate flag after the debug level number to include or exclude some information. For
example, to include time but exclude the rank number:
> mpiexec -genv I_MPI_DEBUG=2,time,norank -n 2 testc.exe
11:59:59 MPI startup(): Multi-threaded optimized library
...
For the list of all available flags, see description of I_MPI_DEBUG in the Developer Reference.
To redirect the debug information output from stdout to stderr or a text file, use the
I_MPI_DEBUG_OUTPUT environment variable:
> mpiexec -genv I_MPI_DEBUG=2 -genv I_MPI_DEBUG_OUTPUT=debug_output.txt -n 2
testc.exe
Note that the output file name should not be longer than 256 symbols.
See Also
Intel® MPI Library Developer Reference, section Miscellaneous > Other Environment Variables > I_MPI_DEBUG
20
Intel® MPI Library Developer Guide for Windows* OS
21
Statistics and Analysis
NOTE
The I_MPI_STATS_SCOPE environment variable is not applicable when both types of statistics are collected.
22
Intel® MPI Library Developer Guide for Windows* OS
Each region contains its own independent statistics information about MPI functions called inside the region.
All open regions are closed automatically inside the MPI_Finalize function call.
The MPI_Pcontrol function cannot be used for the following permanent regions:
Main region – contains statistics information about all MPI calls from MPI_Init to MPI_Finalize.
The main region gets the "*" name in the IPM statistics output. The native statistics output for this
region is stats.txt by default.
Complementary region – contains statistics information not included into any named region. The
region gets the "ipm_noregion" name in the IPM statistics output. The default output file for this
region is stats_noregion.txt for the native statistics format.
If named regions are not used, the main and complementary regions are identical, and the complementary
region is ignored.
See Also
Intel® MPI Library Developer Reference, section Miscellaneous > Statistics Gathering Mode
23
Statistics and Analysis
See Also
Intel® Trace Collector User and Reference Guide
Tutorial: Detecting and Resolving Errors with MPI Correctness Checker
24
8. Tuning with mpitune Utility
Besides the standard capabilities for compiling and running MPI applications, Intel® MPI Library provides an
automatic utility for optimizing Intel MPI Library parameters for a particular cluster or application. This utility is
called mpitune and is available in the <installdir>\bin directory.
Intel® MPI Library has a wide variety of parameters affecting application performance. The defaults for those
parameters are set for common usage and generally provide good performance for most clusters and
applications out of the box. However, to achieve the best performance for your particular cluster or
application, you can use the mpitune utility to adjust the parameters. Note that if performance improvement
is insignificant after adjusting a certain parameter, mpitune can keep its default value.
The following operation modes are available in mpitune:
Cluster specific. In this mode, mpitune evaluates a given cluster environment by running a
benchmarking program to find the most optimal settings. Intel® MPI Benchmarks are used by default.
Application specific. In this mode, mpitune evaluates performance of a given MPI application by
running the actual application.
The general workflow for both modes is as follows:
1. Generate a configuration file containing the optimal settings for the cluster or application.
2. Apply the settings during the application launch.
See the information below for details. For advanced usage scenarios, see the related online tutorial.
25
Tuning with mpitune Utility
NOTE
When you use the -tune option, explicitly specify the fabric, the number of processes per node, and the total
number of processes, as shown in the examples above. This makes the Intel® MPI Library pick up the
appropriate configuration file.
Alternatively, you can pass a specific configuration file to -tune, for example:
> mpiexec -tune <path_to_your_config_file>\mpitune_config.conf
26
Intel® MPI Library Developer Guide for Windows* OS
See Also
Selecting Fabrics
NOTE
Executing mpitune without arguments initiates the tuning process. To print help, you need to use the --help
(-h) option.
The full list of mpitune options and related environment variables is also available in the Intel® MPI Library
Developer Reference.
Some specific scenarios of using mpitune options are given below.
27
Tuning with mpitune Utility
28
9. Troubleshooting
This section provides the following troubleshooting information:
General Intel® MPI Library troubleshooting procedures
Typical MPI failures with corresponding output messages and behavior when a failure occurs
Recommendations on potential root causes and solutions
9.2.1. Example 1
Symptom/Error Message
Error connecting to the Service
[mpiexec@node01] ..\hydra\utils\sock\sock.c (270): unable to connect from "node01"
to "node02" (No error) read from stdin failed, error 9.
[mpiexec@node01] ..\hydra\tools\demux\demux_select.c (78): select error (No such
file or directory)
[mpiexec@node01] ..\hydra\pm\pmiserv\pmiserv_pmci.c (501): error waiting for event
[mpiexec@node01] ..\hydra\ui\mpich\mpiexec.c (1063): process manager error waiting
for completion
29
Troubleshooting
Cause
The Hydra service is not running on one of the nodes.
Solution
Check the current status of the Hydra service on all the nodes.
9.2.2. Example 2
Symptom/Error Message
Error connecting to the Service
[mpiexec@node01] ..\hydra\utils\sock\sock.c (224): unable to get host address for
node02 (11001) read from stdin failed, error 9.
[mpiexec@node01] ..\hydra\tools\demux\demux_select.c (78): select error (No such
file or directory)
[mpiexec@node01] ..\hydra\pm\pmiserv\pmiserv_pmci.c (501): error waiting for event
[mpiexec@node01] ..\hydra\ui\mpich\mpiexec.c (1063): process manager error waiting
for completion
Cause
One of the nodes is unreachable.
Solution
Check that all the nodes are operable.
9.2.3. Example 3
Symptom/Error Message
pmi_proxy not found on node02. Set Intel MPI environment variables read from stdin
failed, error 9.
[mpiexec@node01] ..\hydra\tools\demux\demux_select.c (78): select error (No such
file or directory)
[mpiexec@node01] ..\hydra\pm\pmiserv\pmiserv_pmci.c (501): error waiting for event
[mpiexec@node01] ..\hydra\ui\mpich\mpiexec.c (1063): process manager error waiting
for completion
Cause
The Intel® MPI Library runtime scripts are not available. A possible reason is that the shared space cannot be
reached.
Solution
Check MPI availability on all the nodes. Possibly, there are some problems with network shared drive.
9.2.4. Example 4
Symptom/Error Message
[-1:5612]ERROR:execvp error on file: <mpi_application_path>,
The filename, directory name, or volume label syntax is incorrect
30
Intel® MPI Library Developer Guide for Windows* OS
Cause
The MPI application is not available on some nodes.
Solution
Check the availability of the MPI application across the nodes. Possibly there are some problems with network
shared drive.
9.2.5. Example 5
Symptom/Error Message
[3:node01] unexpected disconnect completion event from [8:node02]
Cause
One of MPI processes is terminated. The MPI application was run over the dapl fabric.
Solution
Try to find out the reason of the MPI process termination.
9.2.6. Example 6
Symptom/Error Message
Attempting to use an MPI routine before initializing MPI
Cause
A cross-linked application with dependencies on different Intel® MPI Library configurations.
Solution
1. Check your application dependencies with dumpbin Microsoft* Visual Studio* utility:
> dumpbin /DEPENDENTS app.exe
Microsoft (R) COFF/PE Dumper Version 11.00.61030.0
Copyright (C) Microsoft Corporation. All rights reserved.
Dump of file app.exe
File Type: EXECUTABLE IMAGE
Image has the following dependencies:
impi.dll
foo.dll
2. Check the third-party library dependencies as well:
> dumpbin /DEPENDENTS foo.dll
Microsoft (R) COFF/PE Dumper Version 11.00.61030.0
Copyright (C) Microsoft Corporation. All rights reserved.
Dump of file foo.dll
File Type: DLL
31
Troubleshooting
9.2.7. Example 7
Symptom/Error Message
> hydra_service -start
OpenSCManager failed:
Access is denied. (error 5)
Cause
You should have administrator privileges to start the Hydra service. Once the Hydra service has started, all
users can launch processes with mpiexec.
Solution
Run the command line in the command prompt with administrator privileges:
> hydra_service -start
Intel(R) MPI Library Hydra Process Manager started.
32