logo
down
shadow

MSMPI in-place MPI_Allreduce not working with MinGW-w64 gfortran


MSMPI in-place MPI_Allreduce not working with MinGW-w64 gfortran

Content Index :

MSMPI in-place MPI_Allreduce not working with MinGW-w64 gfortran
Tag : fortran , By : damomurf
Date : January 12 2021, 07:00 PM

may help you . It turns out that the trouble is that in MSMPI the variable MPI_IN_PLACE is contained in an internal COMMON block /MPIPRIV1/ and it is a known bug in gfortran that the compiler fails to properly import COMMON block variables from DLLs.
Nevertheless, broken things can be fixed, and in the end all that was needed was to apply a patch to gfortran code and compile it from scratch in MSYS2 (phew...), and add the directive
!GCC$ ATTRIBUTES DLLIMPORT ::  MPI_BOTTOM, MPI_IN_PLACE

Comments
No Comments Right Now !

Boards Message :
You Must Login Or Sign Up to Add Your Comments .

Share : facebook icon twitter icon

MPI_Allreduce not working as expected - Red Black SOR


Tag : c , By : adrianmooreuk
Date : March 29 2020, 07:55 AM
around this issue MPI_REAL is for Fortran's REAL type that usually corresponds to float in C. The data you are reducing is of type double, therefore you should use MPI_DOUBLE instead. The same applies to the MPI calls in the other parts of your program.

MinGW gfortran LAPACK dgsev


Tag : development , By : Jimmy
Date : March 29 2020, 07:55 AM
wish helps you You have to use -L option of gfortran linker. Using this you will point the compiler to look for libraries in this path.
For example:
gfortran test.f -L/path/to/libs -llapack -lblas
LLIBS  = -L/path/to/libs -llapack -lblas
XLIBS  = -L/usr/X11R6/lib64 -lX11 -lpthread 
GLIBS  = -L/usr/X11R6/lib64 -lGLU -lGL -lX11 -lXext -lpthread
OBJS   = test.o
gfortran $(OBJS) $(LLIBS) $(XLIBS) $(GLIBS)

How do I build/compile Fortran with MinGW gfortran via CMake?


Tag : cmake , By : Ravenal
Date : March 29 2020, 07:55 AM
it helps some times Here is a quick shell session showing how I was able to build your Fortran program using MSYS2, cmake, make, and gfortran. You should try running the same commands that I did and see if they give different outputs then investigate the reason.
The MSYSTEM variable is especially important; it is determined by what shortcut you click on when starting MSYS2.
$ echo $MSYSTEM
MINGW64

$ which cmake
/mingw64/bin/cmake

$ which gfortran
/mingw64/bin/gfortran

$ which make
/usr/bin/make

$ ls
CMakeLists.txt  test.f90

$ cat CMakeLists.txt
project(cmake_test Fortran)
add_executable(testf test.f90)

$ cat test.f90
      program test
      write(*,*)"hello world"
      endprogram test

$ mkdir build && cd build

$ cmake -G"MSYS Makefiles" ..
-- The Fortran compiler identification is GNU 6.2.0
-- Check for working Fortran compiler: D:/msys64/mingw64/bin/gfortran.exe
-- Check for working Fortran compiler: D:/msys64/mingw64/bin/gfortran.exe  -- works
-- Detecting Fortran compiler ABI info
-- Detecting Fortran compiler ABI info - done
-- Checking whether D:/msys64/mingw64/bin/gfortran.exe supports Fortran 90
-- Checking whether D:/msys64/mingw64/bin/gfortran.exe supports Fortran 90 -- yes
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Users/david/Documents/scraps/test_fortran/build

$ make
Scanning dependencies of target testf
[ 50%] Building Fortran object CMakeFiles/testf.dir/test.f90.obj
[100%] Linking Fortran executable testf.exe
[100%] Built target testf

$ ./testf.exe
 hello world

DLL not recognized on Windows while compiling with MinGW gfortran


Tag : development , By : Rob
Date : March 29 2020, 07:55 AM
Does that help As pointed out by @jacob in the question comments, the dll version was 64-bit, whereas the compiler (MinGW) defaulted to a 32-bit version.

How can I ctreate a simple makefile for minGW + gfortran


Tag : makefile , By : Tonci Grgin
Date : March 29 2020, 07:55 AM
Related Posts Related QUESTIONS :
  • Problems with an exponential taylor series
  • Reading real*8 variable with value 0 with real*4 results a large number in fortran without warning
  • Why 5/10 division is resulting 0.00000E+00 in Fortran?
  • cannot set a breakpoint in gdb
  • Solving quadratic equation but getting weird errors
  • Basic RMA issue with MPI_Win_create, Null pointer in parameter NULL base pointer is invalid when size is nonzero
  • Different program result depending on how program is linked
  • f2py raises 'Assertion error' while interfacing Fortran77 file with exclamation mark comments
  • Procedure for multiplication of function procedures
  • Inverse mapping in Fortran
  • MPI shared memory communication with slided access
  • MPI_FILE_WRITE_ORDERED overwrites previous written data
  • End statement for Fortran elements
  • How to support multiple versions of the 'same' derived type in Fortran?
  • Is there a short, portable way to specify "kind" in Fortran?
  • OpenAcc Intel Fortran Compiler
  • Passing an allocatable character to a subroutine with unlimited polymorphic dummy argument in Fortran
  • gdb if condition syntax error
  • Is there a performance advantage to defining numbers as parameters in FORTRAN
  • passing allocatable character through two levels of procedure calls fails
  • Pre-processing !DEC$ directives in gfortran
  • Ambiguous interface when using optional arguments in Gfortran
  • passing values to interactive fortran program using echo command
  • In MPI how to get communicator when using several executables?
  • How to determine file size in Fortran 77
  • Interoperability: Fortran to C++
  • How does the Alternate Return feature of Fortran compare to coroutines and generators?
  • index function returning many values
  • How does the comma in line 2 translate to Fortran
  • How to get rid of a specific gfortran warning?
  • How to break to new line in Fortran when printing?
  • How to get mpif90 compiler for OpenSUSE Leap 15.0?
  • Is RETURN statement before END SUBROUTINE in Fortran codes considered a good practice?
  • Wrong result for the Inverse Matrix
  • How to read the real and complex numbers in a unified way in Fortran?
  • Ignoring the intrinsic gamma function with gfortran
  • Can't input value in f(x) in this Fortran code?
  • Fortran can't read from file
  • Comparing elements of a Fortran matrix to the average of the entire matrix and remembering the index of the number close
  • Using MPI_PUT in fortran and different ranks have different displacements using c_loc
  • Is there a Gfortran flag similar to intel ifort's -ipo-c, that would generate single optimized object from all compiled
  • What does o'377' mean in Fortran 77?
  • How can I specify in fortran compiler that declared variables shoud not be potentially treated as implicit function decl
  • What does this syntax mean in fortran?
  • shadow
    Privacy Policy - Terms - Contact Us © scrbit.com