-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmpi_interface.f90
180 lines (159 loc) · 7.65 KB
/
mpi_interface.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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
module mpi_interface
use iso_c_binding
use mpi
interface
subroutine fort_who_failed(Fcomm, size, ranks) bind(C, name="fort_who_failed")
use iso_c_binding
integer(c_int), value :: Fcomm
integer(c_int), intent(out) :: size
type(c_ptr), value :: ranks
end subroutine fort_who_failed
subroutine fort_fault_number(Fcomm, size) bind(C, name="fort_fault_number")
use iso_c_binding
integer(c_int), value :: Fcomm
integer(c_int), intent(out) :: size
end subroutine fort_fault_number
subroutine raise_sigint_c() bind(C, name="raise_sigint")
use iso_c_binding
end subroutine raise_sigint_c
subroutine my_MPI_Init(Fcomm_w, Fcomm_s, ierr) bind(C, name="my_MPI_Init")
use iso_c_binding
integer(c_int), value :: Fcomm_w
integer(c_int), value :: Fcomm_s
integer(c_int) :: ierr
end subroutine my_MPI_Init
subroutine my_MPI_Comm_rank(Fcomm, rank, ierr) bind(C, name="my_MPI_Comm_rank")
use iso_c_binding
integer(c_int), value :: Fcomm
integer(c_int), intent(out) :: rank
integer(c_int), intent(out) :: ierr
end subroutine my_MPI_Comm_rank
subroutine my_MPI_Comm_size(Fcomm, size, ierr) bind(C, name="my_MPI_Comm_size")
use iso_c_binding
integer(c_int), value :: Fcomm
integer(c_int), intent(out) :: size
integer(c_int), intent(out) :: ierr
end subroutine my_MPI_Comm_size
subroutine my_MPI_Barrier(Fcomm, ierr) bind(C, name="my_MPI_Barrier")
use iso_c_binding
integer(c_int), value :: Fcomm
integer(c_int), intent(out) :: ierr
end subroutine my_MPI_Barrier
subroutine my_MPI_Abort(Fcomm, errorcode, ierr) bind(C, name="my_MPI_Abort")
use iso_c_binding
integer(c_int), value :: Fcomm
integer(c_int), value :: errorcode
integer(c_int), intent(out) :: ierr
end subroutine my_MPI_Abort
subroutine my_MPI_Waitall(count, array_of_requests, array_of_statuses, ierr) bind(C, name="my_MPI_Waitall")
use iso_c_binding
integer(c_int), value :: count
integer(c_int), dimension(*), intent(in) :: array_of_requests
integer(c_int), dimension(*), intent(in) :: array_of_statuses
integer(c_int), intent(out) :: ierr
end subroutine my_MPI_Waitall
subroutine my_MPI_Wait(request, status, ierr) bind(C, name="my_MPI_Wait")
use iso_c_binding
use mpi
integer(c_int), value :: request
integer(c_int), dimension(MPI_STATUS_SIZE) :: status
integer(c_int), intent(out) :: ierr
end subroutine my_MPI_Wait
subroutine my_MPI_Isend(buf, count, datatype, dest, tag, Fcomm, request, ierr) bind(C, name="my_MPI_Isend")
use iso_c_binding
type(c_ptr), value :: buf
integer(c_int), value :: count
integer(c_int), value :: datatype
integer(c_int), intent(in) :: dest
integer(c_int), intent(in) :: tag
integer(c_int), value :: Fcomm
integer(c_int), intent(out) :: request
integer(c_int), intent(out) :: ierr
end subroutine my_MPI_Isend
subroutine my_MPI_Send(buf, count, datatype, dest, tag, Fcomm, ierr) bind(C, name="my_MPI_Send")
use iso_c_binding
type(c_ptr), value :: buf
integer(c_int), value :: count
integer(c_int), value :: datatype
integer(c_int), intent(in) :: dest
integer(c_int), intent(in) :: tag
integer(c_int), value :: Fcomm
integer(c_int), intent(out) :: ierr
end subroutine my_MPI_Send
subroutine my_MPI_Irecv(buf, count, datatype, source, tag, Fcomm, request, ierr) bind(C, name="my_MPI_Irecv")
use iso_c_binding
type(c_ptr), value :: buf
integer(c_int), value :: count
integer(c_int), value :: datatype
integer(c_int), intent(in) :: source
integer(c_int), intent(in) :: tag
integer(c_int), value :: Fcomm
integer(c_int), intent(out) :: request
integer(c_int), intent(out) :: ierr
end subroutine my_MPI_Irecv
subroutine my_MPI_Recv(buf, count, datatype, source, tag, Fcomm, status, ierr) bind(C, name="my_MPI_Recv")
use iso_c_binding
use mpi
type(c_ptr), value :: buf
integer(c_int), value :: count
integer(c_int), value :: datatype
integer(c_int), intent(in) :: source
integer(c_int), intent(in) :: tag
integer(c_int), value :: Fcomm
integer(c_int), dimension(MPI_STATUS_SIZE) :: status
integer(c_int), intent(out) :: ierr
end subroutine my_MPI_Recv
subroutine my_MPI_Gather(sendbuf, sendcount, sendtype, recvbufer, recvcount, recvtype, &
root, Fcomm, ierr) bind(C, name="my_MPI_Gather")
use iso_c_binding
type(c_ptr), value :: sendbuf
integer(c_int), value :: sendcount
integer(c_int), value :: sendtype
type(c_ptr), value :: recvbufer
integer(c_int), value :: recvcount
integer(c_int), value :: recvtype
integer(c_int), value :: root
integer(c_int), value :: Fcomm
integer(c_int), intent(out) :: ierr
end subroutine my_MPI_Gather
subroutine my_MPI_Allgather(sendbuf, sendcount, sendtype, recvbufer, recvcount, recvtype, &
Fcomm, ierr) bind(C, name="my_MPI_Allgather")
use iso_c_binding
type(c_ptr), value :: sendbuf
integer(c_int), value :: sendcount
integer(c_int), value :: sendtype
type(c_ptr), value :: recvbufer
integer(c_int), value :: recvcount
integer(c_int), value :: recvtype
integer(c_int), value :: Fcomm
integer(c_int), intent(out) :: ierr
end subroutine my_MPI_Allgather
subroutine my_MPI_Reduce(sendbuf, recvbuf, count, datatype, op, root, comm, ierr) bind(c, name="my_MPI_Reduce")
use iso_c_binding
type(c_ptr), value :: sendbuf
type(c_ptr), value :: recvbuf
integer(C_INT), value :: count, root
integer(C_INT), value :: datatype, op, comm
integer(c_int), intent(out) :: ierr
end subroutine my_MPI_Reduce
subroutine my_MPI_Allreduce(sendbuf, recvbuf, count, datatype, op, comm, ierr) bind(c, name="my_MPI_Allreduce")
use iso_c_binding
type(c_ptr), value :: sendbuf
type(c_ptr), value :: recvbuf
integer(C_INT), value :: count
integer(C_INT), value :: datatype, op, comm
integer(c_int), intent(out) :: ierr
end subroutine my_MPI_Allreduce
subroutine my_MPI_Sendrecv(sendbuf, sendcount, sendtype, dest, sendtag, &
recvbuf, recvcount, recvtype, source, recvtag, &
comm, status, ierr) bind(c, name="my_MPI_Sendrecv")
use iso_c_binding
use mpi
integer(c_int), intent(in) :: sendcount, dest, sendtag, recvcount, source, recvtag
integer(c_int), intent(in) :: sendtype, recvtype, comm
integer(c_int), intent(out) :: ierr
integer(c_int), dimension(MPI_STATUS_SIZE) :: status
type(c_ptr), value :: sendbuf, recvbuf
end subroutine my_MPI_Sendrecv
end interface
end module mpi_interface