Skip to content

Commit 5fc9c23

Browse files
authored
Merge pull request #680 from wannier-developers/fix-lib-name
remove "_mpi" suffix from library name
2 parents 121c5f6 + d07fb28 commit 5fc9c23

4 files changed

Lines changed: 8 additions & 11 deletions

File tree

CMakeLists.txt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ cmake_minimum_required(VERSION 3.25...3.29)
66

77
list(APPEND CMAKE_MESSAGE_CONTEXT Wannier90)
88
project(Wannier90
9-
VERSION 4.0.0
9+
VERSION 4.0.3
1010
DESCRIPTION "Compute maximally-localised Wannier functions."
1111
HOMEPAGE_URL https://www.wannier90.org
1212
LANGUAGES Fortran C
@@ -31,10 +31,8 @@ option(WANNIER90_SHARED_LIBS "Wannier90: Build library as a shared library" ${PR
3131
option(WANNIER90_INSTALL "Wannier90: Install files" ${PROJECT_IS_TOP_LEVEL})
3232
option(WANNIER90_TEST "Wannier90: Build test-suite" ${PROJECT_IS_TOP_LEVEL})
3333

34+
# the library name is the same for MPI and serial builds
3435
set(WANNIER90_LIBRARY_NAME wannier90)
35-
if (WANNIER90_MPI)
36-
set(WANNIER90_LIBRARY_NAME wannier90_mpi)
37-
endif ()
3836

3937
#[=============================================================================[
4038
# Project configuration #

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ clean:
108108

109109
# Note: .x.dSYM are directories (hence the -r option to rm) and are only created on macOS (when compiling with certain flags, e.g. debug), so they are not always present
110110
veryclean: clean
111-
cd $(ROOTDIR) && rm -rf wannier90.x postw90.x w90chk2chk.x w90spn2spn.x libwannier90.{a,so.4} libwannier90_mpi.{a,so.4} *.{gcda,gcno} *.x.dSYM
111+
cd $(ROOTDIR) && rm -rf wannier90.x postw90.x w90chk2chk.x w90spn2spn.x libwannier90.{a,so.4} libwannier90.{a,so.4} *.{gcda,gcno} *.x.dSYM
112112
cd $(ROOTDIR)/test-suite && ./clean_tests -i
113113

114114
thedoc:

Makefile.header

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,13 @@ COMPILER = $(TEMP2)
4343
## everything with -fPIC usually, on 64bit systems
4444
SHAREDLIBFLAGS ?=-shared -Wl,-soname,libwannier90.so.4 -fPIC
4545

46-
## Define the filename
46+
## Define the filename: the file name is the same in MPI and serial
4747
ifdef USEMPI
48-
LIBSUFFIX=_mpi
4948
LIBDESCRIPTION = Compute maximally-localised Wannier functions (MPI version)
5049
else
51-
LIBSUFFIX=
5250
LIBDESCRIPTION = Compute maximally-localised Wannier functions
5351
endif
5452

55-
DYNLIBBASE = wannier90$(LIBSUFFIX)
53+
DYNLIBBASE = wannier90
5654
STATICLIBRARY = lib$(DYNLIBBASE).a
5755
DYNLIBRARY = lib$(DYNLIBBASE).so.4

test-suite/library-mode-test/demo.F90

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ program ok
4747
integer :: i, ib, ic, ik, nkl
4848
integer :: ika, ikb, ikc, nkabc(3)
4949
integer :: mpisize, mpirank
50-
integer :: nb, nk, nn, nw
50+
integer :: nb, nk, nn, nw, nkloc
5151
real(8), allocatable :: eval(:, :), kpt(:, :)
5252
real(8) :: uccart(3, 3) ! cartesian unit cell
5353
type(lib_common_type) :: w90main
@@ -104,6 +104,7 @@ program ok
104104
do i = 1, nk
105105
distk(i) = (i - 1)/nkl ! contiguous blocks with potentially fewer processes on last rank
106106
end do
107+
nkloc = count(distk(:) == mpirank)
107108

108109
! wannier interface starts
109110
! stdout/err
@@ -137,7 +138,7 @@ program ok
137138
call w90_get_nn(w90main, nn, stdout, stderr, ierr)
138139
allocate (nnkp(nk, nn))
139140
call w90_get_nnkp(w90main, nnkp, stdout, stderr, ierr)
140-
allocate (m_matrix(nb, nb, nn, nk))
141+
allocate (m_matrix(nb, nb, nn, nkloc))
141142
allocate (u_matrix_opt(nb, nw, nk))
142143
call w90_set_m_local(w90main, m_matrix) ! m_matrix_local_orig
143144
call w90_set_u_opt(w90main, u_matrix_opt)

0 commit comments

Comments
 (0)