Skip to content

Commit

Permalink
[Debug] Test Fortran library with non-mpi
Browse files Browse the repository at this point in the history
Signed-off-by: Cristian Le <cristian.le@mpsd.mpg.de>
  • Loading branch information
LecrisUT committed Feb 22, 2024
1 parent 9c8d2fc commit 7540c6f
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 3 deletions.
2 changes: 1 addition & 1 deletion test-suite/libv2-demo/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
program ok
#ifdef Wannier90_MPI
use mpi_f08

Check failure on line 3 in test-suite/libv2-demo/lib-gas-opt/demo.F90

View workflow job for this annotation

GitHub Actions / test / 🖥️ Fedora 🛠️ intel 🖧 openmpi

Error in opening the compiled module file. Check INCLUDE paths. [MPI_F08]

Check failure on line 3 in test-suite/libv2-demo/lib-gas-opt/demo.F90

View workflow job for this annotation

GitHub Actions / test / 🖥️ Fedora 🛠️ intel 🖧 mpich

Error in opening the compiled module file. Check INCLUDE paths. [MPI_F08]
#endif
use w90_library

implicit none
Expand All @@ -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
Expand Down Expand Up @@ -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)

Check failure on line 71 in test-suite/libv2-demo/lib-gas-opt/demo.F90

View workflow job for this annotation

GitHub Actions / test / 🖥️ Fedora 🛠️ intel 🖧 openmpi

This name does not have a type, and must have an explicit type. [MPI_COMM_WORLD]

Check failure on line 71 in test-suite/libv2-demo/lib-gas-opt/demo.F90

View workflow job for this annotation

GitHub Actions / test / 🖥️ Fedora 🛠️ intel 🖧 mpich

This name does not have a type, and must have an explicit type. [MPI_COMM_WORLD]
call mpi_comm_rank(mpi_comm_world, mpirank, ierr)
#endif

! crude k distribution
allocate (distk(nk))
Expand Down Expand Up @@ -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
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -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 $<

0 comments on commit 7540c6f

Please sign in to comment.