source: LMDZ6/trunk/libf/misc/lmdz_mpi_wrappers.F90 @ 4744

Last change on this file since 4744 was 4600, checked in by yann meurdesoif, 16 months ago

Suppress CPP_MPI key usage in source code. MPI wrappers is used to supress missing symbol if the mpi library is not linked

YM

File size: 5.3 KB
Line 
1! mpi subroutine wrappers
2
3#ifndef CPP_MPI
4
5SUBROUTINE lmdz_mpi_wrapper_abort
6  STOP 'CPP_MPI key undefined, must not enter in MPI wrappers ==> aborting'
7END SUBROUTINE lmdz_mpi_wrapper_abort
8
9SUBROUTINE MPI_ABORT(COMM, ERRORCODE, IERROR)
10IMPLICIT NONE
11    INTEGER ::       COMM, ERRORCODE, IERROR
12    CALL lmdz_mpi_wrapper_abort
13END SUBROUTINE MPI_ABORT
14
15SUBROUTINE MPI_ALLGATHER(SENDBUF, SENDCOUNT, SENDTYPE, RECVBUF, RECVCOUNT, RECVTYPE, COMM, IERROR)
16USE ISO_C_BINDING
17IMPLICIT NONE
18    TYPE(C_PTR),VALUE  ::   SENDBUF , RECVBUF
19    INTEGER    SENDCOUNT, SENDTYPE, RECVCOUNT, RECVTYPE, COMM
20    INTEGER    IERROR
21    CALL lmdz_mpi_wrapper_abort
22END SUBROUTINE   MPI_ALLGATHER
23 
24SUBROUTINE MPI_COMM_SIZE(COMM, SIZE, IERROR)
25IMPLICIT NONE
26    INTEGER    COMM, SIZE, IERROR
27    CALL lmdz_mpi_wrapper_abort
28END SUBROUTINE MPI_COMM_SIZE
29
30SUBROUTINE MPI_COMM_RANK(COMM, RANK, IERROR)
31IMPLICIT NONE
32    INTEGER    COMM, RANK, IERROR
33    CALL lmdz_mpi_wrapper_abort
34END SUBROUTINE MPI_COMM_RANK
35
36SUBROUTINE MPI_BARRIER(COMM, IERROR)
37IMPLICIT NONE
38    INTEGER    COMM, IERROR
39    CALL lmdz_mpi_wrapper_abort
40END SUBROUTINE MPI_BARRIER   
41
42SUBROUTINE MPI_ISEND(BUF, COUNT, DATATYPE, DEST, TAG, COMM, REQUEST, IERROR)
43USE ISO_C_BINDING
44IMPLICIT NONE
45    TYPE(C_PTR),VALUE  ::    BUF
46    INTEGER    COUNT, DATATYPE, DEST, TAG, COMM, REQUEST, IERROR
47   
48    CALL lmdz_mpi_wrapper_abort
49END SUBROUTINE MPI_ISEND
50
51SUBROUTINE MPI_ISSEND(BUF, COUNT, DATATYPE, DEST, TAG, COMM, REQUEST, IERROR)
52USE ISO_C_BINDING
53IMPLICIT NONE
54    TYPE(C_PTR),VALUE  ::    BUF
55    INTEGER    COUNT, DATATYPE, DEST, TAG, COMM, REQUEST, IERROR
56    CALL lmdz_mpi_wrapper_abort
57END SUBROUTINE MPI_ISSEND
58
59SUBROUTINE MPI_IRECV(BUF, COUNT, DATATYPE, SOURCE, TAG, COMM, REQUEST, IERROR)
60USE ISO_C_BINDING
61IMPLICIT NONE
62    TYPE(C_PTR),VALUE  ::    BUF
63    INTEGER    COUNT, DATATYPE, SOURCE, TAG, COMM, REQUEST, IERROR
64    CALL lmdz_mpi_wrapper_abort
65END SUBROUTINE MPI_IRECV   
66
67SUBROUTINE MPI_WAITALL(COUNT, ARRAY_OF_REQUESTS, ARRAY_OF_STATUSES, IERROR)
68USE lmdz_mpi, ONLY : MPI_STATUS_SIZE
69IMPLICIT NONE
70    INTEGER    COUNT, ARRAY_OF_REQUESTS(*)
71    INTEGER    ARRAY_OF_STATUSES(MPI_STATUS_SIZE,*), IERROR
72    CALL lmdz_mpi_wrapper_abort
73END SUBROUTINE  MPI_WAITALL 
74
75SUBROUTINE MPI_GATHERV(SENDBUF, SENDCOUNT, SENDTYPE, RECVBUF, RECVCOUNTS, DISPLS, RECVTYPE, ROOT, COMM, IERROR)
76USE ISO_C_BINDING
77IMPLICIT NONE
78    TYPE(C_PTR),VALUE  ::    SENDBUF, RECVBUF
79    INTEGER    SENDCOUNT, SENDTYPE, RECVCOUNTS(*), DISPLS(*)
80    INTEGER    RECVTYPE, ROOT, COMM, IERROR
81    CALL lmdz_mpi_wrapper_abort
82END SUBROUTINE MPI_GATHERV
83   
84SUBROUTINE MPI_BCAST(BUFFER, COUNT, DATATYPE, ROOT, COMM, IERROR)
85USE ISO_C_BINDING
86IMPLICIT NONE
87    TYPE(C_PTR),VALUE  ::    BUFFER
88    INTEGER    COUNT, DATATYPE, ROOT, COMM, IERROR
89    CALL lmdz_mpi_wrapper_abort
90END SUBROUTINE MPI_BCAST
91
92SUBROUTINE MPI_ALLREDUCE(SENDBUF, RECVBUF, COUNT, DATATYPE, OP, COMM, IERROR)
93USE ISO_C_BINDING
94IMPLICIT NONE
95    TYPE(C_PTR),VALUE  ::    SENDBUF, RECVBUF
96    INTEGER    COUNT, DATATYPE, OP, COMM, IERROR
97    CALL lmdz_mpi_wrapper_abort
98END SUBROUTINE MPI_ALLREDUCE
99
100SUBROUTINE MPI_INIT_THREAD(REQUIRED, PROVIDED, IERROR)
101IMPLICIT NONE
102    INTEGER    REQUIRED, PROVIDED, IERROR
103    CALL lmdz_mpi_wrapper_abort
104END SUBROUTINE MPI_INIT_THREAD
105
106SUBROUTINE MPI_ALLOC_MEM(SIZE, INFO, BASEPTR, IERROR)
107USE lmdz_mpi, ONLY : MPI_ADDRESS_KIND
108IMPLICIT NONE
109    INTEGER INFO, IERROR
110    INTEGER(KIND=MPI_ADDRESS_KIND) SIZE, BASEPTR
111    CALL lmdz_mpi_wrapper_abort
112END SUBROUTINE MPI_ALLOC_MEM
113
114SUBROUTINE MPI_SCATTERV(SENDBUF, SENDCOUNTS, DISPLS, SENDTYPE, RECVBUF, RECVCOUNT, RECVTYPE, ROOT, COMM, IERROR)
115USE ISO_C_BINDING
116IMPLICIT NONE
117    TYPE(C_PTR),VALUE  ::    SENDBUF, RECVBUF
118    INTEGER    SENDCOUNTS(*), DISPLS(*), SENDTYPE
119    INTEGER    RECVCOUNT, RECVTYPE, ROOT, COMM, IERROR
120    CALL lmdz_mpi_wrapper_abort
121END SUBROUTINE MPI_SCATTERV
122
123SUBROUTINE MPI_REDUCE(SENDBUF, RECVBUF, COUNT, DATATYPE, OP, ROOT, COMM, IERROR)
124USE ISO_C_BINDING
125IMPLICIT NONE
126    TYPE(C_PTR),VALUE ::    SENDBUF, RECVBUF
127    INTEGER    COUNT, DATATYPE, OP, ROOT, COMM, IERROR
128    CALL lmdz_mpi_wrapper_abort
129END SUBROUTINE MPI_REDUCE
130
131SUBROUTINE MPI_RECV(BUF, COUNT, DATATYPE, SOURCE, TAG, COMM, STATUS, IERROR)
132USE ISO_C_BINDING
133USE lmdz_mpi, ONLY : MPI_STATUS_SIZE
134IMPLICIT NONE
135    TYPE(C_PTR),VALUE ::    BUF
136    INTEGER    COUNT, DATATYPE, SOURCE, TAG, COMM
137    INTEGER    STATUS(MPI_STATUS_SIZE), IERROR
138    CALL lmdz_mpi_wrapper_abort
139END SUBROUTINE MPI_RECV
140
141SUBROUTINE MPI_SEND(BUF, COUNT, DATATYPE, DEST, TAG, COMM, IERROR)
142USE ISO_C_BINDING
143IMPLICIT NONE
144    TYPE(C_PTR),VALUE  ::  BUF
145    INTEGER    COUNT, DATATYPE, DEST, TAG, COMM, IERROR
146    CALL lmdz_mpi_wrapper_abort
147END SUBROUTINE MPI_SEND
148
149SUBROUTINE MPI_COMM_SPLIT(COMM, COLOR, KEY, NEWCOMM, IERROR)
150IMPLICIT NONE
151    INTEGER    COMM, COLOR, KEY, NEWCOMM, IERROR
152    CALL lmdz_mpi_wrapper_abort
153END SUBROUTINE MPI_COMM_SPLIT
154
155
156SUBROUTINE MPI_GATHER(SENDBUF, SENDCOUNT, SENDTYPE, RECVBUF, RECVCOUNT, RECVTYPE, ROOT, COMM, IERROR)
157USE ISO_C_BINDING
158IMPLICIT NONE
159    TYPE(C_PTR),VALUE  ::  SENDBUF, RECVBUF
160    INTEGER    SENDCOUNT, SENDTYPE, RECVCOUNT, RECVTYPE, ROOT
161    INTEGER    COMM, IERROR
162    CALL lmdz_mpi_wrapper_abort
163END SUBROUTINE MPI_GATHER
164
165
166SUBROUTINE MPI_FINALIZE(IERROR)
167IMPLICIT NONE
168    INTEGER    IERROR
169    CALL lmdz_mpi_wrapper_abort
170END SUBROUTINE MPI_Finalize
171
172#endif
Note: See TracBrowser for help on using the repository browser.