if (this_image() == 1) then
write(,‘(a)’,advance=‘no’) 'Enter your name: ’
read(,‘(a)’) name
do i = 2, num_images()
name[i] = name
end do
end if
sync all
write(*,‘(3a,i0)’) 'Hello ‘,trim(name),’ from image ', this_image()
read(,)
end program Hello_World
I installed the mpi libraries and added /Qcorray to the ifort.cfg
Now the the code compiles without errors but it doesn’t run.
It closes immediately with following error:
‘hellompi.exe’ (Win32): Loaded ‘C:\Windows\System32\sechost.dll’.
The thread 0x3818 has exited with code 4294967295 (0xffffffff).
The thread 0x58b8 has exited with code 4294967295 (0xffffffff).
The thread 0x4b4c has exited with code 4294967295 (0xffffffff).
The program ‘[7844] hellompi.exe’ has exited with code 4294967295 (0xffffffff).
I need this mpi support because I am studying the wonderfull book ‘Modern Fortran’ by Milan Curcic.
Please use the </> button to format code. I copied your sample program and ended up correcting the “helpful” markup: two asterisks indicate italic text, so your read and write statements are mangled and some of the quotes turned out to be “smart”.
I compiled (using -Qcoarrray) and ran it on Windows with a plain installation of Intel Fortran oneAPI and got the “hello” text the expected 24 times.
I did NOT add the option to ifort.cfg, but I do not think that was the essential difference.
If I inspect the executable, there is no sign of a dependency on sechost.dll.
Thank you.
I did a fresh install of visual studio and the intel software but now I get fatal error LNK1181: cannot open input file 'impi.lib’
I checked: impi.lib is where it should be.
I suppose that ‘cannot open’ means that the program found the lib but cannot open it for some reason.
I suppose that you compile from the command line. I build from within visual studio 2022.
Yes, I did use the command-line I prefer that over setting up a VS solution for small programs.
But it is the linker that complains about the missing library. Can you try to build the program via the command-line? From the Start menu open the “Intel oneAPI command prompt” (I used the 64-bits environment) and simply build it with -Qcoarray as the option.
Thank you all for your comments.
Compiling works now but the program does not execute.
I get a system error.
Execution can not be continued because libicaf.dll is not found.
So frustrating. I already wasted two days of my life with this.
Back to my Manjaro distro I suppose.
Roger
I had something similar experience with MPI with Ifort. Very unfriendly documentation and no basic instructions. Even finding the required information proved to be a daunting task. I quit too!
Do you get this error by runnig the executable from the Intel oneAPI command prompt, as @Arjen suggested ?
Because reading this
to me it looks like you don’t have such paths to the runtime libraries in the Windows PATHenvironment variable (which you’d strictly need when using dynamic linking)
@rmoortgat , with this VS solution .sln file, it is needed the project file (.vfprog) as well. It is the one containing both compilation and linking (VS specific) instructions
Those are the configurations that VS creates by default whenever you create a new VS solution file. You could remove all unwanted configurations via the VS GUI (or by hand if you wish).
No need to be sorry at all @rmoortgat !!!
I went through your same struggles when I firstly approached these things as well.
They might appear very foggy at first.
And everyone here is there to help anyone.
The project file is named hellompi.vfproj, you can see it is mentioned in the solution file you attached.
Usually, it is placed in the same directory where you find the solution .sln file, as in your case as well, since the relative path to "hellompi.vfproj is not preceded by anything. meaning that it is found in the same directory of the solution file.
Let’s keep this task for a later step, after you have solved the first issue. In any case, what matters is which target platform you build (which you made it clear is x64).
I dicovered that the coarray programs run from within the intel command line and not from the Powershell.
c:\FORTRAN\hellompi>hello
Enter your name: roger
Hello roger from image 1
Hello roger from image 6
Hello roger from image 5
Hello roger from image 10
Hello roger from image 2
Hello roger from image 9
Hello roger from image 12
Hello roger from image 11
Hello roger from image 8
Hello roger from image 3
Hello roger from image 7
Hello roger from image 4
Yes, that would be due to the path - it must include the directory holding the DLLs. I never use PowerShell myself, but I guess adding the right paths will not be a particularly vexing problem, just tedious.
:: initializing oneAPI environment...
Initializing Visual Studio command-line environment...
Visual Studio version 17.8.0 environment configured.
"C:\Program Files\Microsoft Visual Studio\2022\Community\"
Visual Studio command-line environment initialized for: 'x64'
: advisor -- latest
'powershell' is not recognized as an internal or external command,
operable program or batch file.
C:\Program Files (x86)\Intel\oneAPI\advisor\latest\env>
powershell not recognised anymore due to latest update of powershell, now the command is pwsh. Where can I change this?