The TELEMAC-MASCARET system  trunk
interface_parallel.f
Go to the documentation of this file.
1 ! *************************
2  MODULE interface_parallel
3 ! *************************
4 !
5 !
6 !***********************************************************************
7 ! PARALLEL VERSION 7.0 31/07/2012
8 !***********************************************************************
9 !
10 !brief INTERFACES OF PARALLEL LIBRARY PUBLIC SUBROUTINES
11 !+
12 !
13 !history J-M HERVOUET (LNHE)
14 !+ 31/07/2012
15 !+ V6P2
16 !+ Original version.
17 !
18 !history J-M HERVOUET (LNHE)
19 !+ 09/05/2014
20 !+ V7P0
21 !+ Adding MPI communications by integers.
22 !
23 !history R.NHEILI (Univerte de Perpignan, DALI)
24 !+ 24/02/2016
25 !+ V7P3
26 !+ Adding compensation in the sum from the processors
27 !
28 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
29 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
30 !
31 #if defined BOGUS
32  ! So scan detect overloaded funtion
33  CALL p_imax
34  CALL p_dmax
35  CALL p_imin
36  CALL p_dmin
37  CALL p_isum
38  CALL p_dsum
39  CALL mpi_address1
40  CALL mpi_address2
41  CALL mpi_address3
42  CALL p_imax_array
43  CALL p_dmax_array
48  CALL p_dread
49  CALL p_iread
50  CALL p_ireadi8
51  CALL p_ireadi
52  CALL p_dwrit
53  CALL p_iwrit
54  CALL p_iwriti8
55  CALL p_iwriti
56 #endif
57 !
58  INTERFACE
59 !
60 !-----------------------------------------------------------------------
61 !
62 ! DEFINITION OF INTERFACES
63 !
64  SUBROUTINE p_init(CHAINE,NCAR,IPID,NCSIZE)
66  IMPLICIT NONE
67  INTEGER, INTENT(OUT) :: NCAR,IPID,NCSIZE
68  CHARACTER(LEN=PATH_LEN), INTENT(OUT) :: CHAINE
69  END SUBROUTINE
70 !
71  SUBROUTINE p_exit
72  IMPLICIT NONE
73  END SUBROUTINE
74 !
75  DOUBLE PRECISION FUNCTION p_dsumerr(PARTIAL)
76  IMPLICIT NONE
77  DOUBLE PRECISION, INTENT(IN) :: PARTIAL(2)
78  END FUNCTION
79 !
80  SUBROUTINE p_dmin_array(MYPART,N,VALUES)
81  IMPLICIT NONE
82  INTEGER, INTENT(IN) :: N
83  DOUBLE PRECISION, INTENT(IN) :: MYPART(n)
84  DOUBLE PRECISION, INTENT(IN) :: VALUES(n)
85  END SUBROUTINE
86 !
87  SUBROUTINE p_isum_array
88  &(send_buffer, recv_buffer, ncount, ierr)
89  IMPLICIT NONE
90  INTEGER, INTENT(IN) :: NCOUNT
91  INTEGER, INTENT(IN) :: SEND_BUFFER(ncount)
92  INTEGER, INTENT(OUT) :: RECV_BUFFER(ncount)
93  INTEGER, INTENT(OUT) :: IERR
94  END SUBROUTINE
95 !
96  SUBROUTINE p_mpi_alltoall
97  &(send_buffer,nsend,send_datyp,recv_buffer,nrecv,recv_datyp,
98  & ierr)
99  IMPLICIT NONE
100  INTEGER, INTENT(IN) :: SEND_BUFFER(*),NSEND,SEND_DATYP,NRECV
101  INTEGER, INTENT(IN) :: RECV_DATYP
102  INTEGER, INTENT(OUT) :: RECV_BUFFER(*),IERR
103  END SUBROUTINE
104 !
105  SUBROUTINE p_wait_paraco(IBUF,NB)
106  IMPLICIT NONE
107  INTEGER,INTENT(INOUT) :: IBUF(*)
108  INTEGER,INTENT(IN) :: NB
109  END SUBROUTINE
110 !
111  SUBROUTINE p_allgatherv_i
112  &(send_buffer, send_count, recv_buffer,
113  & recv_count, displs, ierr)
114  IMPLICIT NONE
115  INTEGER, INTENT(IN) :: SEND_BUFFER(*)
116  INTEGER, INTENT(IN) :: SEND_COUNT
117  INTEGER, INTENT(INOUT) :: RECV_BUFFER(*)
118  INTEGER, INTENT(IN) :: RECV_COUNT(*)
119  INTEGER, INTENT(IN) :: DISPLS(*)
120  INTEGER, INTENT(OUT) :: IERR
121  END SUBROUTINE
122 !
123  REAL*8 FUNCTION p_time()
124  IMPLICIT NONE
125  END FUNCTION
126 !
127  SUBROUTINE p_sync
128  IMPLICIT NONE
129  END SUBROUTINE
130 !
132  &(nblock,nelem,displ,elem_type,new_datatype,ierr)
134  IMPLICIT NONE
135  INTEGER, INTENT(IN) :: NBLOCK
136  INTEGER, INTENT(OUT) :: IERR
137  INTEGER, INTENT(OUT) :: NEW_DATATYPE
138  INTEGER, INTENT(IN) :: NELEM(nblock)
139  INTEGER, INTENT(IN) :: ELEM_TYPE(nblock)
140  INTEGER(KIND=MY_ADDRESS_KIND), INTENT(INOUT) :: DISPL(nblock)
141  END SUBROUTINE
142 !
143  SUBROUTINE p_mpi_type_commit(DATA_TYPE,IERR)
144  IMPLICIT NONE
145  INTEGER, INTENT(INOUT) :: DATA_TYPE
146  INTEGER, INTENT(OUT) :: IERR
147  END SUBROUTINE
148 !
149  SUBROUTINE p_mpi_type_free(DATA_TYPE,IERR)
150  IMPLICIT NONE
151  INTEGER, INTENT(INOUT) :: DATA_TYPE
152  INTEGER, INTENT(OUT) :: IERR
153  END SUBROUTINE
154 !
156  &(oil_charac)
157  IMPLICIT NONE
158  INTEGER, INTENT(INOUT) :: OIL_CHARAC
159  END SUBROUTINE
160 !
162  &(alg_char,nomb)
163  IMPLICIT NONE
164  INTEGER, INTENT(INOUT) :: ALG_CHAR
165  INTEGER, INTENT(IN) :: NOMB
166  END SUBROUTINE
167 !
168  SUBROUTINE org_charac_type1(NOMB,CHARACTERISTIC)
169  IMPLICIT NONE
170  INTEGER, INTENT(IN) :: NOMB
171  INTEGER, INTENT(INOUT) :: CHARACTERISTIC
172  END SUBROUTINE
173 !
175  &(datatype,lower_bound,extent,ierr)
177  IMPLICIT NONE
178  INTEGER(KIND=MY_ADDRESS_KIND), INTENT(INOUT)::
179  & lower_bound,extent
180  INTEGER, INTENT(IN) :: DATATYPE
181  INTEGER, INTENT(OUT) :: IERR
182  END SUBROUTINE
183  !
184  ! Unused functions
185  !
186  SUBROUTINE p_lsum(IARG1,LARG2)
187  IMPLICIT NONE
188  INTEGER, INTENT(IN) :: IARG1
189  LOGICAL, DIMENSION(IARG1), INTENT(INOUT) :: LARG2
190  END SUBROUTINE
191 !
192  SUBROUTINE p_mail(CHAINE,NCAR)
194  IMPLICIT NONE
195  INTEGER, INTENT(IN) :: NCAR
196  CHARACTER(LEN=PATH_LEN), INTENT(INOUT) :: CHAINE
197  END SUBROUTINE
198 !
199 !
200 !------------------------------------------------------------------------
201 !
202  END INTERFACE
203 
204  INTERFACE p_max
205  DOUBLE PRECISION FUNCTION p_dmax(MYPART)
206  IMPLICIT NONE
207  DOUBLE PRECISION, INTENT(IN) :: MYPART
208  END FUNCTION
209 !
210  INTEGER FUNCTION p_imax(MYPART)
211  IMPLICIT NONE
212  INTEGER, INTENT(IN) :: MYPART
213  END FUNCTION
214  END INTERFACE
215 
216 !
217  INTERFACE p_max_array
218  SUBROUTINE p_dmax_array(MYPART,N,VALUES)
219  IMPLICIT NONE
220  INTEGER, INTENT(IN) :: N
221  DOUBLE PRECISION, INTENT(IN) :: MYPART(n)
222  DOUBLE PRECISION, INTENT(IN) :: VALUES(n)
223  END SUBROUTINE
224 !
225  SUBROUTINE p_imax_array
226  & (send_buffer, recv_buffer, ncount, ierr)
227  IMPLICIT NONE
228  INTEGER, INTENT(IN) :: NCOUNT
229  INTEGER, INTENT(IN) :: SEND_BUFFER(ncount)
230  INTEGER, INTENT(OUT) :: RECV_BUFFER(ncount)
231  INTEGER, INTENT(OUT) :: IERR
232  END SUBROUTINE
233  END INTERFACE
234 
235  INTERFACE p_min
236  DOUBLE PRECISION FUNCTION p_dmin(MYPART)
237  IMPLICIT NONE
238  DOUBLE PRECISION, INTENT(IN) :: MYPART
239  END FUNCTION
240 !
241  INTEGER FUNCTION p_imin(MYPART)
242  IMPLICIT NONE
243  INTEGER, INTENT(IN) :: MYPART
244  END FUNCTION
245  END INTERFACE
246 
247  INTERFACE p_sum
248  DOUBLE PRECISION FUNCTION p_dsum(MYPART)
249  IMPLICIT NONE
250  DOUBLE PRECISION, INTENT(IN) :: MYPART
251  END FUNCTION
252 !
253  INTEGER FUNCTION p_isum(MYPART)
254  IMPLICIT NONE
255  INTEGER, INTENT(IN) :: MYPART
256  END FUNCTION
257  END INTERFACE
258 
259  INTERFACE p_mpi_address
260  SUBROUTINE p_mpi_address
261  & (location,address,ier)
263  IMPLICIT NONE
264  INTEGER, INTENT(IN) :: LOCATION
265  INTEGER, INTENT(OUT) :: IER
266  INTEGER(KIND=MY_ADDRESS_KIND), INTENT(OUT) :: ADDRESS
267  END SUBROUTINE
268 !
269  SUBROUTINE p_mpi_address2
270  & (location,address,ier)
272  IMPLICIT NONE
273  DOUBLE PRECISION, INTENT(IN) :: LOCATION
274  INTEGER, INTENT(OUT) :: IER
275  INTEGER (KIND=MY_ADDRESS_KIND), INTENT(OUT) :: ADDRESS
276  END SUBROUTINE
277 !
278  SUBROUTINE p_mpi_address3
279  & (location,address,ier)
281  IMPLICIT NONE
282  DOUBLE PRECISION, INTENT(IN) :: LOCATION(*)
283  INTEGER, INTENT(OUT) :: IER
284  INTEGER (KIND=MY_ADDRESS_KIND), INTENT(OUT) :: ADDRESS
285  END SUBROUTINE
286  END INTERFACE
287 
288  INTERFACE p_mpi_alltoallv
289  SUBROUTINE p_mpi_alltoallv_charac
290  & (send_buffer,nsend,send_displ,send_datyp,recv_buffer,nrecv,
291  & recv_displ,recv_datyp,ierr)
293  IMPLICIT NONE
294  INTEGER, INTENT(IN) :: NSEND(*),SEND_DISPL(*),
295  & send_datyp,nrecv(*)
296  INTEGER, INTENT(IN) :: RECV_DISPL(*),RECV_DATYP
297  INTEGER, INTENT(OUT) :: IERR
298  TYPE(charac_type), INTENT(IN) :: SEND_BUFFER(*)
299  TYPE(charac_type), INTENT(INOUT) :: RECV_BUFFER(*)
300  END SUBROUTINE
301 !
302  SUBROUTINE p_mpi_alltoallv_alg
303  & (send_buffer,nsend,send_displ,send_datyp,recv_buffer,nrecv,
304  & recv_displ,recv_datyp,ierr)
306  IMPLICIT NONE
307  INTEGER, INTENT(IN) :: NSEND(*),SEND_DISPL(*)
308  INTEGER, INTENT(IN) :: SEND_DATYP,NRECV(*)
309  INTEGER, INTENT(IN) :: RECV_DISPL(*),RECV_DATYP
310  INTEGER, INTENT(OUT) :: IERR
311  TYPE(alg_type), INTENT(IN) :: SEND_BUFFER(*)
312  TYPE(alg_type), INTENT(INOUT) :: RECV_BUFFER(*)
313  END SUBROUTINE
314 !
315  SUBROUTINE p_mpi_alltoallv_i
316  & (send_buffer,nsend,send_displ,send_datyp,recv_buffer,nrecv,
317  & recv_displ,recv_datyp,ierr)
318  IMPLICIT NONE
319  INTEGER, INTENT(IN) :: SEND_BUFFER(*),NSEND(*),SEND_DISPL(*)
320  INTEGER, INTENT(IN) :: SEND_DATYP,NRECV(*),RECV_DISPL(*)
321  INTEGER, INTENT(IN) :: RECV_DATYP
322  INTEGER, INTENT(OUT) :: RECV_BUFFER(*),IERR
323  END SUBROUTINE
324 
325  SUBROUTINE p_mpi_alltoallv_oil
326  & (send_buffer,nsend,send_displ,send_datyp,recv_buffer,nrecv,
327  & recv_displ,recv_datyp,ierr)
329  IMPLICIT NONE
330  INTEGER, INTENT(IN) :: NSEND(*),SEND_DISPL(*),SEND_DATYP,
331  & nrecv(*)
332  INTEGER, INTENT(IN) :: RECV_DISPL(*),RECV_DATYP
333  INTEGER, INTENT(OUT) :: IERR
334  TYPE(oil_type), INTENT(IN) :: SEND_BUFFER(*)
335  TYPE(oil_type), INTENT(INOUT) :: RECV_BUFFER(*)
336  END SUBROUTINE
337 !
338  END INTERFACE
339 
340  INTERFACE p_read
341  SUBROUTINE p_iread(BUFFER,N,BYTES,SOURCE,DATATYPE,IREQ)
342  IMPLICIT NONE
343  INTEGER, INTENT(IN) :: N,BYTES,SOURCE,DATATYPE
344  INTEGER, INTENT(INOUT) :: IREQ
345  DOUBLE PRECISION, INTENT(INOUT) :: BUFFER(*)
346  END SUBROUTINE
347 !
348  SUBROUTINE p_ireadi(BUFFER,NVAL,SOURCE,ITAG,IREQ)
349  IMPLICIT NONE
350  INTEGER, INTENT(IN) :: NVAL,SOURCE,ITAG
351  INTEGER, INTENT(INOUT) :: IREQ
352  INTEGER, INTENT(OUT) :: BUFFER(nval)
353  END SUBROUTINE
354 !
355  SUBROUTINE p_ireadi8(BUFFER,NVAL,SOURCE,ITAG,IREQ)
357  IMPLICIT NONE
358  INTEGER, INTENT(IN) :: NVAL,SOURCE,ITAG
359  INTEGER, INTENT(INOUT) :: IREQ
360  INTEGER(KIND=K8), INTENT(OUT) :: BUFFER(nval)
361  END SUBROUTINE
362 !
363  SUBROUTINE p_dread(BUFFER,N,BYTES,SOURCE,DATATYPE)
364  IMPLICIT NONE
365  INTEGER, INTENT(IN) :: N,BYTES,SOURCE,DATATYPE
366  DOUBLE PRECISION, INTENT(INOUT) :: BUFFER(*)
367  END SUBROUTINE
368  END INTERFACE
369 
370  INTERFACE p_write
371 
372  SUBROUTINE p_iwrit(BUFFER,N,BYTES,DEST,ITAG,IREQ)
373  IMPLICIT NONE
374  INTEGER, INTENT(IN) :: N,BYTES,DEST,ITAG
375  INTEGER, INTENT(INOUT) :: IREQ
376  DOUBLE PRECISION, INTENT(INOUT) :: BUFFER(*)
377  END SUBROUTINE
378 !
379  SUBROUTINE p_iwriti(BUFFER,NVAL,DEST,ITAG,IREQ)
380  IMPLICIT NONE
381  INTEGER, INTENT(IN) :: NVAL,DEST,ITAG
382  INTEGER, INTENT(INOUT) :: IREQ
383  INTEGER, INTENT(IN) :: BUFFER(nval)
384  END SUBROUTINE
385 !
386  SUBROUTINE p_iwriti8(BUFFER,NVAL,DEST,ITAG,IREQ)
388  IMPLICIT NONE
389  INTEGER, INTENT(IN) :: NVAL,DEST,ITAG
390  INTEGER, INTENT(INOUT) :: IREQ
391  INTEGER(KIND=K8), INTENT(IN) :: BUFFER(nval)
392  END SUBROUTINE
393 !
394  SUBROUTINE p_dwrit(BUFFER,N,BYTES,DEST,TYPE)
395  IMPLICIT NONE
396  INTEGER, INTENT(IN) :: N,BYTES,DEST,TYPE
397  DOUBLE PRECISION, INTENT(IN) :: BUFFER(*)
398  END SUBROUTINE
399 !
400  END INTERFACE
401 !
402 !=======================================================================
403 !
404  END MODULE interface_parallel
subroutine p_isum_array(SEND_BUFFER, RECV_BUFFER, NCOUNT, IERR)
Definition: p_isum_array.F:7
subroutine p_mpi_address2(LOCATION, ADDRESS, IER)
Definition: p_mpi_address2.F:7
subroutine p_mail(CHAINE, NCAR)
Definition: p_mail.F:7
subroutine p_exit
Definition: p_exit.F:4
double precision function p_dmax(MYPART)
Definition: p_dmax.F:7
subroutine p_mpi_alltoallv_alg(SEND_BUFFER, NSEND, SEND_DISPL, SEND_DATYP, RECV_BUFFER, NRECV, RECV_DISPL, RECV_DATYP, IERR)
subroutine p_init(CHAINE, NCAR, IPID, NCSIZE)
Definition: p_init.F:7
subroutine p_iwrit(BUFFER, N, BYTES, DEST, ITAG, IREQ)
Definition: p_iwrit.F:7
subroutine p_mpi_type_get_extent(DATATYPE, LOWER_BOUND, EXTENT, IERR)
integer function p_imax(MYPART)
Definition: p_imax.F:7
subroutine p_dmin_array(MYPART, N, VALUES)
Definition: p_dmin_array.F:7
subroutine p_dwrit(BUFFER, N, BYTES, DEST, DATATYPE)
Definition: p_dwrit.F:7
integer function p_isum(MYPART)
Definition: p_isum.F:7
subroutine p_mpi_alltoallv_i(SEND_BUFFER, NSEND, SEND_DISPL, SEND_DATYP, RECV_BUFFER, NRECV, RECV_DISPL, RECV_DATYP, IERR)
subroutine p_lsum(BUFFER_LENGTH, LBUFFER)
Definition: p_lsum.F:7
subroutine p_iwriti8(BUFFER, NVAL, DEST, ITAG, IREQ)
Definition: p_iwriti8.F:7
subroutine p_mpi_type_create_struct(NBLOCK, NELEM, DISPL, ELEM_TYPE, NEW_DATATYPE, IERR)
subroutine p_mpi_alltoallv_oil(SEND_BUFFER, NSEND, SEND_DISPL, SEND_DATYP, RECV_BUFFER, NRECV, RECV_DISPL, RECV_DATYP, IERR)
subroutine p_mpi_type_free(DATATYPE, IERR)
subroutine org_charac_type1(NOMB, CHARACTERISTIC)
subroutine p_ireadi8(BUFFER, NVAL, SOURCE, ITAG, IREQ)
Definition: p_ireadi8.F:7
subroutine p_dmax_array(MYPART, N, VALUES)
Definition: p_dmax_array.F:7
subroutine p_mpi_alltoall(SEND_BUFFER, NSEND, SEND_DATYP, RECV_BUFFER, NRECV, RECV_DATYP, IERR)
Definition: p_mpi_alltoall.F:8
subroutine p_iread(BUFFER, N, BYTES, SOURCE, ITAG, IREQ)
Definition: p_iread.F:6
double precision function p_dsum(MYPART)
Definition: p_dsum.F:7
subroutine p_ireadi(BUFFER, NVAL, SOURCE, ITAG, IREQ)
Definition: p_ireadi.F:7
double precision function p_dmin(MYPART)
Definition: p_dmin.F:7
subroutine p_mpi_type_commit(DATA_TYPE, IERR)
subroutine org_charac_type_oil(OIL_CHARAC)
subroutine p_wait_paraco(IBUF, NB)
Definition: p_wait_paraco.F:7
double precision function p_dsumerr(PARTIAL)
Definition: p_dsumerr.F:7
subroutine p_mpi_address3(LOCATION, ADDRESS, IER)
Definition: p_mpi_address3.F:7
real *8 function p_time()
Definition: p_time.F:7
subroutine org_charac_type_alg(ALG_CHAR, NOMB)
subroutine p_sync
Definition: p_sync.F:4
subroutine p_iwriti(BUFFER, NVAL, DEST, ITAG, IREQ)
Definition: p_iwriti.F:7
subroutine p_allgatherv_i(SEND_BUFFER, SEND_COUNT, RECV_BUFFER, RECV_COUNT, DISPLS, IERR)
Definition: p_allgatherv_i.F:8
subroutine p_mpi_alltoallv_charac(SEND_BUFFER, NSEND, SEND_DISPL, SEND_DATYP, RECV_BUFFER, NRECV, RECV_DISPL, RECV_DATYP, IERR)
integer function p_imin(MYPART)
Definition: p_imin.F:7
subroutine p_dread(BUFFER, N, BYTES, SOURCE, DATATYPE)
Definition: p_dread.F:7
subroutine p_imax_array(SEND_BUFFER, RECV_BUFFER, NCOUNT, IERR)
Definition: p_imax_array.F:7