-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhelloworld.F90
More file actions
39 lines (27 loc) · 823 Bytes
/
helloworld.F90
File metadata and controls
39 lines (27 loc) · 823 Bytes
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
31
32
33
34
35
36
37
38
SUBROUTINE hello()
USE mpi
INTEGER sz, rank
INTEGER ierr
! call MPI_INIT(ierr)
call MPI_COMM_SIZE(MPI_COMM_WORLD, sz, ierr)
call MPI_COMM_RANK(MPI_COMM_WORLD, rank, ierr)
PRINT *, "Hello world from ", rank, " of ", sz, " processes"
! call MPI_FINALIZE(ierr)
END SUBROUTINE hello
SUBROUTINE rank_hello(rank)
USE mpi
INTEGER, INTENT(IN) :: rank
INTEGER :: sz
INTEGER :: ierr
call MPI_COMM_SIZE(MPI_COMM_WORLD, sz, ierr)
PRINT *, "Hello world from ", rank, " of ", sz, " processes"
END SUBROUTINE rank_hello
SUBROUTINE comm_hello(comm)
USE mpi
INTEGER, INTENT(IN) :: comm
INTEGER :: sz, rank
INTEGER :: ierr
call MPI_COMM_SIZE(comm, sz, ierr)
call MPI_COMM_RANK(comm, rank, ierr)
PRINT *, "Hello world from ", rank, " of ", sz, " processes"
END SUBROUTINE comm_hello