- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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:
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
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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?
![](/skins/images/DC0E2679F7049B943291D1ED082A478E/responsive_peak/images/icon_anonymous_message.png)
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page