simple MPI test for testing the autocmake
- code reviewer's comments included
This commit is contained in:
17
test/fc_mpi/cmake/autocmake.cfg
Normal file
17
test/fc_mpi/cmake/autocmake.cfg
Normal file
@ -0,0 +1,17 @@
|
||||
[project]
|
||||
name: example
|
||||
|
||||
[fc]
|
||||
source: ../../../modules/fc.cmake
|
||||
|
||||
[mpi]
|
||||
source: ../../../modules/mpi.cmake
|
||||
|
||||
[int64]
|
||||
source: ../../../modules/int64.cmake
|
||||
|
||||
[default_build_paths]
|
||||
source: ../../../modules/default_build_paths.cmake
|
||||
|
||||
[src]
|
||||
source: ../../../modules/src.cmake
|
6
test/fc_mpi/src/CMakeLists.txt
Normal file
6
test/fc_mpi/src/CMakeLists.txt
Normal file
@ -0,0 +1,6 @@
|
||||
if (MPI_FOUND)
|
||||
add_executable(example example.f90)
|
||||
else()
|
||||
message(FATAL "MPI not found!")
|
||||
endif()
|
||||
|
16
test/fc_mpi/src/example.f90
Normal file
16
test/fc_mpi/src/example.f90
Normal file
@ -0,0 +1,16 @@
|
||||
program example
|
||||
use mpi
|
||||
implicit none
|
||||
integer :: ierr, rank, size
|
||||
logical :: test_ok
|
||||
call MPI_INIT(ierr)
|
||||
call MPI_COMM_RANK(MPI_COMM_WORLD, rank, ierr)
|
||||
call MPI_COMM_SIZE(MPI_COMM_WORLD, size, ierr)
|
||||
call MPI_FINALIZE(ierr)
|
||||
test_ok=(size==2.and.(rank==0.or.rank==1))
|
||||
if (test_ok) then
|
||||
if (rank == 0) print *,'Test OK!'
|
||||
else
|
||||
stop "test fc_mpi failed!"
|
||||
endif
|
||||
end program
|
Reference in New Issue
Block a user