Skip to content

Commit

Permalink
fix mpi include issue, see wannier-developers/wannier90#521
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefan Wolfsheimer committed Oct 21, 2024
1 parent 9586443 commit 091cfe5
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@ toolchainopts = {'usempi': True}
github_account = 'wannier-developers'
source_urls = [GITHUB_LOWER_SOURCE]
sources = [{'download_filename': 'v%(version)s.tar.gz', 'filename': SOURCELOWER_TAR_GZ}]
patches = ['Wannier90_3x_ignore_makeinc.patch']
patches = ['Wannier90_3x_ignore_makeinc.patch',
'Wannier90_3.1.0_fix_mpi_include.patch']
checksums = [
'40651a9832eb93dec20a8360dd535262c261c34e13c41b6755fa6915c936b254', # wannier90-3.1.0.tar.gz
'561c0d296e0e30b8bb303702cd6e41ded54c153d9b9e6cd9cab73858e5e2945e', # Wannier90_3x_ignore_makeinc.patch
'dd7217d8bf12ac4161fd0b6504f7c085ebcc69b23ab2ac4abcf9251f34b8bc30', # Wannier90_3.1.0_fix_mpi_include.patch
]

# The -fallow-argument-mismatch allows MPI communication calls to be
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@ toolchainopts = {'usempi': True}
github_account = 'wannier-developers'
source_urls = [GITHUB_LOWER_SOURCE]
sources = [{'download_filename': 'v%(version)s.tar.gz', 'filename': SOURCELOWER_TAR_GZ}]
patches = ['Wannier90_3x_ignore_makeinc.patch']
patches = ['Wannier90_3x_ignore_makeinc.patch',
'Wannier90_3.1.0_fix_mpi_include.patch']
checksums = [
'40651a9832eb93dec20a8360dd535262c261c34e13c41b6755fa6915c936b254', # wannier90-3.1.0.tar.gz
'561c0d296e0e30b8bb303702cd6e41ded54c153d9b9e6cd9cab73858e5e2945e', # Wannier90_3x_ignore_makeinc.patch
'dd7217d8bf12ac4161fd0b6504f7c085ebcc69b23ab2ac4abcf9251f34b8bc30', # Wannier90_3.1.0_fix_mpi_include.patch
]

buildopts = 'all F90=$F90 MPIF90=$MPIF90 FCOPTS="$FFLAGS -fallow-argument-mismatch" LDOPTS="$FFLAGS" '
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@ toolchainopts = {'usempi': True}
github_account = 'wannier-developers'
source_urls = [GITHUB_LOWER_SOURCE]
sources = [{'download_filename': 'v%(version)s.tar.gz', 'filename': SOURCELOWER_TAR_GZ}]
patches = ['Wannier90_3x_ignore_makeinc.patch']
patches = ['Wannier90_3x_ignore_makeinc.patch',
'Wannier90_3.1.0_fix_mpi_include.patch']
checksums = [
'40651a9832eb93dec20a8360dd535262c261c34e13c41b6755fa6915c936b254', # wannier90-3.1.0.tar.gz
'561c0d296e0e30b8bb303702cd6e41ded54c153d9b9e6cd9cab73858e5e2945e', # Wannier90_3x_ignore_makeinc.patch
'dd7217d8bf12ac4161fd0b6504f7c085ebcc69b23ab2ac4abcf9251f34b8bc30', # Wannier90_3.1.0_fix_mpi_include.patch
]

# The -fallow-argument-mismatch allows MPI communication calls to be
Expand All @@ -25,10 +27,11 @@ buildopts = 'all F90=$F90 MPIF90=$MPIF90 FCOPTS="$FFLAGS -fallow-argument-mismat
buildopts += 'LIBDIR="$LAPACK_LIB_DIR" LIBS="$LIBLAPACK" '
buildopts += 'COMMS=mpi'

files_to_copy = [(['wannier90.x', 'postw90.x'], 'bin'), (['libwannier.a'], 'lib')]
local_executables = ['wannier90.x', 'postw90.x', 'w90chk2chk.x', 'w90spn2spn.x']
files_to_copy = [(local_executables, 'bin'), (['libwannier.a'], 'lib')]

sanity_check_paths = {
'files': ['bin/wannier90.x', 'bin/postw90.x', 'lib/libwannier.a'],
'files': ['bin/%s' % x for x in local_executables] + ['lib/libwannier.a'],
'dirs': []
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,23 @@ toolchainopts = {'usempi': True}
github_account = 'wannier-developers'
source_urls = [GITHUB_LOWER_SOURCE]
sources = [{'download_filename': 'v%(version)s.tar.gz', 'filename': SOURCELOWER_TAR_GZ}]
patches = ['Wannier90_3x_ignore_makeinc.patch']
patches = ['Wannier90_3x_ignore_makeinc.patch',
'Wannier90_3.1.0_fix_mpi_include.patch']
checksums = [
'40651a9832eb93dec20a8360dd535262c261c34e13c41b6755fa6915c936b254', # wannier90-3.1.0.tar.gz
'561c0d296e0e30b8bb303702cd6e41ded54c153d9b9e6cd9cab73858e5e2945e', # Wannier90_3x_ignore_makeinc.patch
'dd7217d8bf12ac4161fd0b6504f7c085ebcc69b23ab2ac4abcf9251f34b8bc30', # Wannier90_3.1.0_fix_mpi_include.patch
]

buildopts = 'all F90=$F90 MPIF90=$MPIF90 FCOPTS="$FFLAGS" LDOPTS="$FFLAGS" '
buildopts += 'LIBDIR="$LAPACK_LIB_DIR" LIBS="$LIBLAPACK" '
buildopts += 'COMMS=mpi'

files_to_copy = [(['wannier90.x', 'postw90.x'], 'bin'), (['libwannier.a'], 'lib')]
local_executables = ['wannier90.x', 'postw90.x', 'w90chk2chk.x', 'w90spn2spn.x']
files_to_copy = [(local_executables, 'bin'), (['libwannier.a'], 'lib')]

sanity_check_paths = {
'files': ['bin/wannier90.x', 'bin/postw90.x', 'lib/libwannier.a'],
'files': ['bin/%s' % x for x in local_executables] + ['lib/libwannier.a'],
'dirs': []
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,23 @@ toolchainopts = {'usempi': True}
github_account = 'wannier-developers'
source_urls = [GITHUB_LOWER_SOURCE]
sources = [{'download_filename': 'v%(version)s.tar.gz', 'filename': SOURCELOWER_TAR_GZ}]
patches = ['Wannier90_3x_ignore_makeinc.patch']
patches = ['Wannier90_3x_ignore_makeinc.patch',
'Wannier90_3.1.0_fix_mpi_include.patch']
checksums = [
'40651a9832eb93dec20a8360dd535262c261c34e13c41b6755fa6915c936b254', # wannier90-3.1.0.tar.gz
'561c0d296e0e30b8bb303702cd6e41ded54c153d9b9e6cd9cab73858e5e2945e', # Wannier90_3x_ignore_makeinc.patch
'dd7217d8bf12ac4161fd0b6504f7c085ebcc69b23ab2ac4abcf9251f34b8bc30', # Wannier90_3.1.0_fix_mpi_include.patch
]

buildopts = 'all F90=$F90 MPIF90=$MPIF90 FCOPTS="$FFLAGS" LDOPTS="$FFLAGS" '
buildopts += 'LIBDIR="$LAPACK_LIB_DIR" LIBS="$LIBLAPACK" '
buildopts += 'COMMS=mpi'

files_to_copy = [(['wannier90.x', 'postw90.x'], 'bin'), (['libwannier.a'], 'lib')]
local_executables = ['wannier90.x', 'postw90.x', 'w90chk2chk.x', 'w90spn2spn.x']
files_to_copy = [(local_executables, 'bin'), (['libwannier.a'], 'lib')]

sanity_check_paths = {
'files': ['bin/wannier90.x', 'bin/postw90.x', 'lib/libwannier.a'],
'files': ['bin/%s' % x for x in local_executables] + ['lib/libwannier.a'],
'dirs': []
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
Use "use mpi" to load all required interfaces.
See https://github.com/wannier-developers/wannier90/issues/521
Author: Stefan Wolfsheimer (SURF)


diff -ruN wannier90-3.1.0.orig/src/comms.F90 wannier90-3.1.0/src/comms.F90
--- wannier90-3.1.0.orig/src/comms.F90 2020-03-05 19:41:10.000000000 +0100
+++ wannier90-3.1.0/src/comms.F90 2024-10-21 17:01:00.542755184 +0200
@@ -23,15 +23,13 @@

use w90_constants, only: dp
use w90_io, only: io_error
-
+#ifdef MPI
+ use mpi
+#endif
implicit none

private

-#ifdef MPI
- include 'mpif.h'
-#endif
-
logical, public, save :: on_root
!! Are we the root node
integer, public, save :: num_nodes

0 comments on commit 091cfe5

Please sign in to comment.