diff --git a/test-suite/libv2-demo/CMakeLists.txt b/test-suite/libv2-demo/CMakeLists.txt index dfdc9654..0d417820 100644 --- a/test-suite/libv2-demo/CMakeLists.txt +++ b/test-suite/libv2-demo/CMakeLists.txt @@ -3,7 +3,7 @@ set_property(DIRECTORY APPEND ) set(test_names - lib-gas-opt-pllel + lib-gas-opt libc-gas-mix-serial libc-gas-mix-serial-clash ) diff --git a/test-suite/libv2-demo/lib-gas-opt-pllel/CMakeLists.txt b/test-suite/libv2-demo/lib-gas-opt/CMakeLists.txt similarity index 60% rename from test-suite/libv2-demo/lib-gas-opt-pllel/CMakeLists.txt rename to test-suite/libv2-demo/lib-gas-opt/CMakeLists.txt index c29fffba..37ab722a 100644 --- a/test-suite/libv2-demo/lib-gas-opt-pllel/CMakeLists.txt +++ b/test-suite/libv2-demo/lib-gas-opt/CMakeLists.txt @@ -3,5 +3,8 @@ project(demo_Wannier90 LANGUAGES Fortran) find_package(Wannier90 REQUIRED) -add_executable(demo demo.f90) +add_executable(demo demo.F90) +if (Wannier90_MPI) + target_compile_definitions(demo PRIVATE Wannier90_MPI) +endif () target_link_libraries(demo PRIVATE Wannier90::wannier90) diff --git a/test-suite/libv2-demo/lib-gas-opt-pllel/demo.f90 b/test-suite/libv2-demo/lib-gas-opt/demo.F90 similarity index 96% rename from test-suite/libv2-demo/lib-gas-opt-pllel/demo.f90 rename to test-suite/libv2-demo/lib-gas-opt/demo.F90 index 7743fa5f..0b80d152 100644 --- a/test-suite/libv2-demo/lib-gas-opt-pllel/demo.f90 +++ b/test-suite/libv2-demo/lib-gas-opt/demo.F90 @@ -1,5 +1,7 @@ program ok +#ifdef Wannier90_MPI use mpi_f08 +#endif use w90_library implicit none @@ -18,6 +20,11 @@ program ok real(8) :: uccart(3, 3) ! cartesian unit cell type(lib_common_type), target :: w90main +#ifndef Wannier90_MPI + ! MPI dummy + integer :: mpi_comm_world = 0 +#endif + ! collect data nb = 12 nw = 8 @@ -58,10 +65,12 @@ program ok enddo enddo +#ifdef Wannier90_MPI ! setup MPI call mpi_init(ierr) call mpi_comm_size(mpi_comm_world, mpisize, ierr) call mpi_comm_rank(mpi_comm_world, mpirank, ierr) +#endif ! crude k distribution allocate (distk(nk)) @@ -125,5 +134,7 @@ program ok write (stdout, '(4f20.10)') (w90main%wannier_data%centres(ic, ib), ic=1, 3), w90main%wannier_data%spreads(ib) enddo endif +#ifdef Wannier90_MPI call mpi_finalize() +#endif end program diff --git a/test-suite/libv2-demo/lib-gas-opt-pllel/gaas.amn b/test-suite/libv2-demo/lib-gas-opt/gaas.amn similarity index 100% rename from test-suite/libv2-demo/lib-gas-opt-pllel/gaas.amn rename to test-suite/libv2-demo/lib-gas-opt/gaas.amn diff --git a/test-suite/libv2-demo/lib-gas-opt-pllel/gaas.eig b/test-suite/libv2-demo/lib-gas-opt/gaas.eig similarity index 100% rename from test-suite/libv2-demo/lib-gas-opt-pllel/gaas.eig rename to test-suite/libv2-demo/lib-gas-opt/gaas.eig diff --git a/test-suite/libv2-demo/lib-gas-opt-pllel/gaas.mmn b/test-suite/libv2-demo/lib-gas-opt/gaas.mmn similarity index 100% rename from test-suite/libv2-demo/lib-gas-opt-pllel/gaas.mmn rename to test-suite/libv2-demo/lib-gas-opt/gaas.mmn diff --git a/test-suite/libv2-demo/lib-gas-opt-pllel/makefile b/test-suite/libv2-demo/lib-gas-opt/makefile similarity index 75% rename from test-suite/libv2-demo/lib-gas-opt-pllel/makefile rename to test-suite/libv2-demo/lib-gas-opt/makefile index 25571f21..16ef2e4e 100644 --- a/test-suite/libv2-demo/lib-gas-opt-pllel/makefile +++ b/test-suite/libv2-demo/lib-gas-opt/makefile @@ -5,5 +5,5 @@ XLIBS=$(ROOT)/libwan2.a a.out: demo.o $(MPIF90) demo.o $(LIBS) $(XLIBS) demo.o: demo.f90 - $(MPIF90) $(FCOPTS) $(XINCS) -c $< + $(MPIF90) $(FCOPTS) -DWannier90_MPI $(XINCS) -c $<