blob: b5666e899cae73bf41f842efd08f53e4298020ad (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
use, intrinsic :: iso_fortran_env, only: stderr=>error_unit
use mpi
implicit none
logical :: flag
integer :: ier
call MPI_Init(ier)
if (ier /= 0) then
write(stderr,*) 'Unable to initialize MPI', ier
stop 1
endif
call MPI_Initialized(flag, ier)
if (ier /= 0) then
write(stderr,*) 'Unable to check MPI initialization state: ', ier
stop 1
endif
call MPI_Finalize(ier)
if (ier /= 0) then
write(stderr,*) 'Unable to finalize MPI: ', ier
stop 1
endif
print *, "OK: Fortran MPI"
end program
|