Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

open mpi test code not running

zhzhu1218
Novice
1,175 Views

Hi,

 

I just installed the latest openAPI base kit and the openAPI HPC kit. I'm using Visual Studio 2022 to run Fortran codes. I tried to run the mpi test code (test.f90) that comes with the HPC toolkit, but have been running into errors. For further information, I've configured the Visual Studio project as suggested here (https://www.intel.com/content/www/us/en/docs/mpi-library/developer-guide-windows/2021-9/configuring-a-microsoft-visual-studio-project.html).

 

Any clue what's going on here?

 

Thanks!

 

zhzhu1218_0-1686688529211.png

 

1 Solution
jimdempseyatthecove
Honored Contributor III
1,120 Views

This sounds like a path issue. The message indicates it found a mpi.mod file, but it is not of a version/platform compatible with the compiler chosen. Assure that you are not mixing platforms (Win32 vs x64 (vs x86)) amongst Build, Link and environment variables.

Jim Dempsey

View solution in original post

13 Replies
Ron_Green
Moderator
1,162 Views

from the errors it is not finding the Intel MPI include directory.  Specifically, this configuration

 

  1. In Configuration Properties > C/C++ or Fortran, as appropriate, set the following parameter:

    Additional Include Directories: $(I_MPI_ONEAPI_ROOT)\include

 

check that Configuration Property

0 Kudos
zhzhu1218
Novice
1,144 Views

Hey Ron,

 

Thanks for the response! I checked that configuration property, and also checked that the module "mpi.mod" is in the path in the directory. The code is now running with an error "this module was generated for a different platform or by an incompatible compiler or compiler release." Is it possible that something didn't install correctly?

 

Thanks again!

 

0 Kudos
jimdempseyatthecove
Honored Contributor III
1,121 Views

This sounds like a path issue. The message indicates it found a mpi.mod file, but it is not of a version/platform compatible with the compiler chosen. Assure that you are not mixing platforms (Win32 vs x64 (vs x86)) amongst Build, Link and environment variables.

Jim Dempsey

zhzhu1218
Novice
1,112 Views

Thanks so much Jim! This might be very elementary, but what exactly should I do to make sure the Build, Link, and environment variables are consistent?

0 Kudos
zhzhu1218
Novice
1,106 Views

I tried changing the configuration to x64 and now it works! Thanks Jim! 

0 Kudos
jimdempseyatthecove
Honored Contributor III
1,105 Views

First: Start | System Information | Software Environment | Environment Variables

Check to see if I_MPI_ONEAPI_ROOT is defined properly (and verify the path and sub paths contains the files).

I haven't run an MPI test program on my system, but I notice that  I_MPI_ONEAPI_ROOT has...\2021.9.0 whereas my newer version of OneAPI is 2023.1.0, so I do not know if that will present an issue (i.e. possibly I should install a 2023 version of Intel's MPI).

A second thing to check is the include paths in MS VS

**** OK ran a failing test ***

When I create a new project (MS VS 2019) using OneAPI 2023.1.0 but specifying include folder off of I_ONEAPI_ROOT (the 2021.9.0) I get the same error as you (incompatible version).

We need to go to the Intel OneAPI website to locate the (if there is) newer version of mpi, download and install.

 

Jim Dempsey

Ron_Green
Moderator
1,105 Views

@zhzhu1218 what configuration are you building? 

Intel MPI only supports 64bit applications.  You must set configuration to x64, NOT ia32.  Needs to be a 64bit build.

 

If you try to build default ia32 32bit configuration you will get the error about the .mod file 

jimdempseyatthecove
Honored Contributor III
1,104 Views

My bad. MS VS defaulted to 32-bit app.

Ron, why isn't there an MS VS integration option to select an MPI build? It is a bit cumbersome and error prone to manually specify the additional include path (both compiler and linker) and the library path (linker).

 

Am I missing something?

 

Jim Dempsey

0 Kudos
zhzhu1218
Novice
1,103 Views

@Ron_Green - i was initially building on a x86 configuration, and once I switched to 64 bit the problem was solved

@jimdempseyatthecove I also find the manual specification quite cumbersome, especially since this is required for every new program

0 Kudos
Ron_Green
Moderator
1,080 Views

MPI vendors provide compiler "wrappers" to make the compilation easier.  These are for the command line.  for example, if hello_mpi.f90 is an MPI program:

 

mpiifort -o hello hello_mpi.f90

 

sets the include directories, lib directories, and pulls in the .lib or .dll files at link time.  The wrapper makes it easy!

But I do not know how to tell Visual Studio to use 'mpiifort' instead of 'ifort' for the compiler.  
So command line is easy, Visual Studio needs changes to the configuration since it does not know about MPI by default.

 

 

zhzhu1218
Novice
1,078 Views

@Ron_Green @jimdempseyatthecove , not directly related to the original problem, but have you folks also noticed that when running mpi codes on visual studio, the console automatically closes after debugging? The same doesn't happen when running codes that don't use the mpi library / mpiexec.exe

Any clue how this can be fixed?

0 Kudos
Ron_Green
Moderator
1,067 Views

@zhzhu1218 I do not know how to keep the console window open.

0 Kudos
jimdempseyatthecove
Honored Contributor III
1,060 Views

Put a break point at the end of the program

or place a PAUSE statement at the end of the program (conditionally enabled in Debug build).

Jim Dempsey

 

0 Kudos
Reply