How can I get MPI module to work with Fortran using Code:Blocks on Windows 10?

175 Views Asked by At

I have recieved some code from a colleague which is written in Fortan .f90 files, and was used before on Linux. I am trying to get the code to function on Windows 10 using Code::Blocks. The problem is there is an MPI module which is not being found and I can't work out how to add it to the project.

I am not a computer scientist so please bear with me. I have recieved some code from a colleague which is written in Fortan .f90 files, and was used before on Linux. I am trying to get this code to work on Windows as I have not used Linux.

I started by installing and configuring codeblocks using this guide (https://www.quora.com/How-can-I-run-a-Fortran-code-in-a-Windows-computer)

Which worked great for simple scripts.

Now, running the main code, I have a problem as there is a MPI module which cannot be found by the software: here is an example of some of the code.

module mpi_param
use mpi
implicit none
!
integer :: i_num,nb_proc
integer :: p1, p2,p3
integer :: i_proc, j_proc, k_proc,i_err
integer, dimension(mpi_status_size) :: i_etat
integer, dimension (1:6) :: i_send

!
end module mpi_param

Now, I have downloaded the microsoft MPI so I have the folder;

C:\Program Files (x86)\Microsoft SDKs\MPI

and I have also tried with cygwin downloading all the openmpi packages mentioned here;

https://sourceware.org/legacy-ml/cygwin/2014-06/msg00410.html

So I have an mpi.mod the file in this directory

C:\cygwin64

I have added those paths to the build options compiler search directories in codeblocks, but I continue to get the message, when I build;

||Fatal Error: Can't open module file 'mpi.mod' for reading at (1): No such file or directory|

I added the mpi.f90 file or mpi.mod file to the project but that didn't work either.

How can I get code:blocks to 'SEE' or 'FIND' or 'USE' the mpi module? (sorry I don't know the correct terminology)

Honestly, I don't really know/understand what I am doing, I am just trying to get the code running at least, but I am completely lost.

Should I give up on this path and try with Linux somehow? Shall I try something instead of Code::Blocks?

0

There are 0 best solutions below