Intel® MPI Library Developer Guide for Windows* OS

ID 768730
Date 3/31/2023
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

Configuring a Microsoft Visual Studio* Project

To configure a Microsoft Visual Studio* project with Intel® MPI Library, do the following:

  1. In Microsoft Visual Studio*, create a console application project or open an existing one.

  2. Open the project properties, go to Configuration Properties > Debugging and set the following parameters:

    Command: $(I_MPI_ONEAPI_ROOT)\bin\mpiexec.exe

    Command arguments: -n <processes-number> "$(TargetPath)"

    Environment: PATH=$(I_MPI_ONEAPI_ROOT)\bin\$(ConfigurationName);$(I_MPI_ONEAPI_ROOT)\libfabric\bin;$(PATH)

    NOTE:
    If you have installed the Microsoft Visual Studio* integration, go to Project > Properties > Intel Libraries for oneAPI > Use Intel MPI Library and set it to Yes. You can skip the steps below.
  3. In Configuration Properties > C/C++ or Fortran, as appropriate, set the following parameter:

    Additional Include Directories: $(I_MPI_ONEAPI_ROOT)\include

  4. In Configuration Properties > Linker, set the following parameter:

    Additional Library Directories: $(I_MPI_ONEAPI_ROOT)\lib\$(ConfigurationName);$(I_MPI_ONEAPI_ROOT)\lib

  5. In Configuration Properties > Linker > Input, set the following parameters:

    • For Fortran, set Additional Dependencies: impi.lib
    • For C++, set Additional Dependencies: impi.lib and impicxx.lib

After completing these steps, you can build the solution and run the application. To run the application from Visual Studio, you can use the Ctrl + F5 key combination (Start Without Debugging). For other available options, see Running Applications.