-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathezmpi_ssend.f90
98 lines (57 loc) · 2.3 KB
/
ezmpi_ssend.f90
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
module ezmpi_ssend_m
use mpi_f08, only: mpi_ssend, mpi_real, mpi_logical, mpi_comm_world, &
mpi_integer
implicit none
interface ezmpi_ssend
module procedure ezmpi_ssend_0d_real, ezmpi_ssend_1d_real, &
ezmpi_ssend_2d_real, ezmpi_ssend_0d_logical, ezmpi_ssend_0d_integer, &
ezmpi_ssend_2d_integer
end interface ezmpi_ssend
private
public ezmpi_ssend
contains
subroutine ezmpi_ssend_0d_real(buf, dest, tag)
real, intent(in):: buf
integer, intent(in):: dest, tag
!-------------------
call mpi_ssend(buf, 1, mpi_real, dest, tag, mpi_comm_world)
end subroutine ezmpi_ssend_0d_real
!****************************************************
subroutine ezmpi_ssend_1d_real(buf, dest, tag)
real, intent(in):: buf(:)
integer, intent(in):: dest, tag
!-------------------
if (size(buf) /= 0) call mpi_ssend(buf(1), size(buf), mpi_real, dest, tag, &
mpi_comm_world)
end subroutine ezmpi_ssend_1d_real
!****************************************************
subroutine ezmpi_ssend_2d_real(buf, dest, tag)
real, intent(in):: buf(:, :)
integer, intent(in):: dest, tag
!-------------------
if (size(buf) /= 0) call mpi_ssend(buf(1, 1), size(buf), mpi_real, dest, &
tag, mpi_comm_world)
end subroutine ezmpi_ssend_2d_real
!****************************************************
subroutine ezmpi_ssend_0d_logical(buf, dest, tag)
logical, intent(in):: buf
integer, intent(in):: dest, tag
!-------------------
call mpi_ssend(buf, 1, mpi_logical, dest, tag, mpi_comm_world)
end subroutine ezmpi_ssend_0d_logical
!****************************************************
subroutine ezmpi_ssend_0d_integer(buf, dest, tag)
integer, intent(in):: buf
integer, intent(in):: dest, tag
!-------------------
call mpi_ssend(buf, 1, mpi_integer, dest, tag, mpi_comm_world)
end subroutine ezmpi_ssend_0d_integer
!****************************************************
subroutine ezmpi_ssend_2d_integer(buf, dest, tag)
integer, intent(in):: buf(:, :)
integer, intent(in):: dest, tag
!-------------------
if (size(buf) /= 0) call mpi_ssend(buf(1, 1), size(buf), mpi_integer, &
dest, tag, mpi_comm_world)
end subroutine ezmpi_ssend_2d_integer
end module ezmpi_ssend_m