Topic: MS MPI Package in SF

Hi Jeff,

     After a few trials in OpenMP with unsatisfactory improvement by the nature of my problem, I switched to MPI and downloaded the MS MPI package from SF.

      This link was helpful in guiding me through. But I found some problems, mostly due to my older version of SF (version 1.45). My version doesn't have the Start menu as mentioned in that link.

      So here is what I did. I copied the prime_mpi.f90 under

     

 C:\Users\Wenya\AppData\Local\sfpm\32\share\msmpi\examples 

   
      and mpi.f90
   
     

 C:\Users\Wenya\AppData\Local\sfpm\64\include 

      into my working directory (somewhere on D disk), make a new project with the two files, and compile and run.

      It should work. But SF shows the following error
   
     

     "C:\Program Files (x86)\Simply Fortran\mingw-w64\bin\gfortran.exe" -c -o "build\mpi.o" -g -m32 -IC:/Users/Wenya/AppData/Local/sfpm/32/include -fcheck=all -fno-range-check -Jmodules ".\mpi.f90"
.\mpi.f90:362.35:

       PARAMETER (MPI_ADDRESS_KIND=SIZEOF(IGNORED_POINTER__))
                                   1
Error: Intrinsic function 'sizeof' at (1) is not permitted in an initialization expression
.\mpi.f90:486.11:

       USE MPI_CONSTANTS,ONLY:MPI_ADDRESS_KIND
           1
Fatal Error: File 'mpi_constants.mod' opened at (1) is not a GNU Fortran module file
Error(E42): Last command making (build\mpi.o) returned a bad status
Error(E02): Make execution terminated

      The problem seems lie in the

 SIZEOF 

that messes up the parameter

 MPI_ADDRESS_KIND 

in the MPI_CONSTANTS module.

       What should I do to fix that? According to the previous post by brendan , SF should have no problem in running examples, right? Did I miss something? Thank you very much!

Re: MS MPI Package in SF

I believe the Fortran files you mentioned were possibly modified when creating the included .mod module files, but the modified Fortran was not properly included with the package.  Let me check our build system, and I'll let you know when the updated package is available.

Jeff Armstrong
Approximatrix, LLC

Re: MS MPI Package in SF

Thanks Jeff! Good to know that I'm not misunderstanding things.

Re: MS MPI Package in SF

I actually looked at the package project, and it appears to use the same Fortran code that your compiler is failing on compilation.  I think the actual problem is that GNU Fortran 4.8 did not allow the use of SIZEOF in the parameter declarations, but GNU Fortran 4.9 and higher did.

For your case, I would change the offending line from:

PARAMETER (MPI_ADDRESS_KIND=SIZEOF(IGNORED_POINTER__))

to either the 32-bit equivalent:

PARAMETER (MPI_ADDRESS_KIND=4)

or 64-bit equivalent:

PARAMETER (MPI_ADDRESS_KIND=8)

depending on your project type.

Jeff Armstrong
Approximatrix, LLC