Intel® MPI Library
Get help with building, analyzing, optimizing, and scaling high-performance computing (HPC) applications.
2190 Discussions

Visual studio and Intel HPC Toolkit

benjamu
Beginner
314 Views

Dear community,

 

I am trying to compile a simple mpi fortran code (see below) using visual studio 2022 and Intel HPC Toolkit 2024.2 (latest version).

I have followed the instructions in the following guide:

https://www.intel.com/content/www/us/en/docs/mpi-library/developer-guide-windows/2021-13/configuring-a-microsoft-visual-studio-project.html

with my directory path C:\Program Files (x86)\Intel\oneAPI\mpi\2021.13\lib

and I still get the same error below:

Erreur error #7002: Error in opening the compiled module file. Check INCLUDE paths. [MPI]

 

The compiler in Visual is not able to link with the library impi.lib

I looked for solutions on the internet but without success.

 

Can you help me solve this problem?

 

Thanks in advance

 

program Console4
use mpi
implicit none

integer i, size, rank, namelen, ierr
character (len=MPI_MAX_PROCESSOR_NAME) :: name
integer stat(MPI_STATUS_SIZE)

call MPI_INIT (ierr)

call MPI_COMM_SIZE (MPI_COMM_WORLD, size, ierr)
call MPI_COMM_RANK (MPI_COMM_WORLD, rank, ierr)
call MPI_GET_PROCESSOR_NAME (name, namelen, ierr)

if (rank.eq.0) then

print *, 'Hello world: rank ', rank, ' of ', size, ' running on ', name

do i = 1, size - 1
call MPI_RECV (rank, 1, MPI_INTEGER, i, 1, MPI_COMM_WORLD, stat, ierr)
call MPI_RECV (size, 1, MPI_INTEGER, i, 1, MPI_COMM_WORLD, stat, ierr)
call MPI_RECV (namelen, 1, MPI_INTEGER, i, 1, MPI_COMM_WORLD, stat, ierr)
name = ''
call MPI_RECV (name, namelen, MPI_CHARACTER, i, 1, MPI_COMM_WORLD, stat, ierr)
print *, 'Hello world: rank ', rank, ' of ', size, ' running on ', name
enddo

else

call MPI_SEND (rank, 1, MPI_INTEGER, 0, 1, MPI_COMM_WORLD, ierr)
call MPI_SEND (size, 1, MPI_INTEGER, 0, 1, MPI_COMM_WORLD, ierr)
call MPI_SEND (namelen, 1, MPI_INTEGER, 0, 1, MPI_COMM_WORLD, ierr)
call MPI_SEND (name, namelen, MPI_CHARACTER, 0, 1, MPI_COMM_WORLD, ierr)

endif

call MPI_FINALIZE (ierr)


end program Console4

Labels (3)
0 Kudos
5 Replies
TobiasK
Moderator
243 Views

@benjamu 
can you please add:
C:\Program Files (x86)\Intel\oneAPI\mpi\2021.13\include\mpi

0 Kudos
benjamu
Beginner
221 Views

Thanks @TobiasK 

 

By adding this element in Additional Include Directories and in Additional Library Directories, it works now:

 

Additional Include Directories: C:\Program Files (x86)\Intel\oneAPI\mpi\2021.13\include;C:\Program Files (x86)\Intel\oneAPI\mpi\2021.13\include\mpi

Additional Library Directories C:\Program Files (x86)\Intel\oneAPI\mpi\2021.13\include;C:\Program Files (x86)\Intel\oneAPI\mpi\2021.13\include\mpi

0 Kudos
benjamu
Beginner
220 Views

With the above modification, I can't compile and generate an executable, unfortunately when I execute using 1 proc I get the following error :

Abort(1090447) on node 0 (rank 0 in comm 0): Fatal error in PMPI_Init: Unknown error class, error stack:
MPIR_Init_thread(192)........:
MPID_Init(1665)..............:
MPIDI_OFI_mpi_init_hook(1586):
(unknown)(): Unknown error class

0 Kudos
benjamu
Beginner
204 Views

By creating a new project and not starting from an existing one, it works.

 

In short, to make the compilation work, I added the following to the project properties :

Debug
Command : C:\Program Files (x86)\Intel\oneAPI\mpi\2021.13\bin\mpiexec.exe
Command arguments : -n 1 "$(TargetPath)"
Environnement : PATH=C:\Program Files (x86)\Intel\oneAPI\mpi\2021.13\bin; C:\Program Files (x86)\Intel\oneAPI\mpi\2021.13\opt\mpi\libfabric\bin;$(PATH)
Fortran
Additional Include Directories : C:\Program Files (x86)\Intel\oneAPI\mpi\2021.13\include;C:\Program Files (x86)\Intel\oneAPI\mpi\2021.13\include\mpi
Linker
Additional Library Directories : C:\Program Files (x86)\Intel\oneAPI\mpi\2021.13\lib
Input
Additional Dependencies: impi.lib

0 Kudos
benjamu
Beginner
190 Views

When I create a new project, I don't get the previous errors when I execute the code with Visual studio (Abort(1090447) on node 0 (rank 0 in comm 0): Fatal error in PMPI_Init ... ). On the other hand, when I close and then open the saved project, I get the same errors as before when I run the code in visual studio  (Abort(1090447) on node 0 (rank 0 in comm 0): Fatal error in PMPI_Init ... ).

For your information, if I use "Intel oneAPI command prompt for Intel 64 for Visual Studio 2022" it works.

 

I don't know what to do anymore. Could you help me?

0 Kudos
Reply