diff --git a/test/fc_mpi/src/example.f90 b/test/fc_mpi/src/example.f90 index b73e21d..4b602e7 100644 --- a/test/fc_mpi/src/example.f90 +++ b/test/fc_mpi/src/example.f90 @@ -1,16 +1,23 @@ program example + use mpi + implicit none - integer :: ierr, rank, size + + integer :: ierr, rank, num_ranks 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_COMM_SIZE(MPI_COMM_WORLD, num_ranks, ierr) call MPI_FINALIZE(ierr) - test_ok=(size==2.and.(rank==0.or.rank==1)) + + test_ok = (num_ranks == 2. and. (rank == 0 .or. rank == 1)) + if (test_ok) then if (rank == 0) print *, 'PASSED' else stop "FAILED" endif + end program