simple MPI test for testing the autocmake

- code reviewer's comments included
This commit is contained in:
Miro ILIAS
2015-08-07 08:01:26 +02:00
parent baa9fe5555
commit f8905fed65
5 changed files with 57 additions and 4 deletions

View 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

View File

@ -0,0 +1,6 @@
if (MPI_FOUND)
add_executable(example example.f90)
else()
message(FATAL "MPI not found!")
endif()

View 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