File indexing completed on 2024-08-29 05:10:34 UTC
view on githubraw file Latest commit 5237154b on 2024-08-28 14:56:27 UTC
b043311a0b Jean*0001 #include "CPP_EEOPTIONS.h"
0002
924557e60a Chri*0003
0004
5237154b93 Jean*0005
0006
0007
0008
03c23d8c97 Jean*0009
b043311a0b Jean*0010
4c563c2ee9 Chri*0011
0012
0013
0014
03c23d8c97 Jean*0015 SUBROUTINE GLOBAL_SUM_R4(
78c96bee2f Alis*0016 U sumPhi,
924557e60a Chri*0017 I myThid )
03c23d8c97 Jean*0018
4c563c2ee9 Chri*0019
0020
03c23d8c97 Jean*0021
0022
4c563c2ee9 Chri*0023
03c23d8c97 Jean*0024
0025
0026
0027
0028
0029
0030
4c563c2ee9 Chri*0031
924557e60a Chri*0032
4c563c2ee9 Chri*0033
03c23d8c97 Jean*0034 IMPLICIT NONE
0035
924557e60a Chri*0036
0037 #include "SIZE.h"
0038 #include "EEPARAMS.h"
0039 #include "EESUPPORT.h"
aea29c8517 Alis*0040 #include "GLOBAL_SUM.h"
924557e60a Chri*0041
4c563c2ee9 Chri*0042
924557e60a Chri*0043
b043311a0b Jean*0044
0045
924557e60a Chri*0046 Real*4 sumPhi
0047 INTEGER myThid
0048
4c563c2ee9 Chri*0049
924557e60a Chri*0050
b043311a0b Jean*0051
0052
5237154b93 Jean*0053 INTEGER i
924557e60a Chri*0054 Real*4 tmp
ca1d7a672f Jean*0055 #ifdef ALLOW_USE_MPI
924557e60a Chri*0056 INTEGER mpiRC
0057 #endif /* ALLOW_USE_MPI */
4c563c2ee9 Chri*0058
924557e60a Chri*0059
78c96bee2f Alis*0060
b043311a0b Jean*0061 phiGSR4(1,myThid) = sumPhi
78c96bee2f Alis*0062
46dc4f419b Chri*0063
aea29c8517 Alis*0064 CALL BAR2( myThid )
924557e60a Chri*0065
0066
0067 _BEGIN_MASTER( myThid )
0068 tmp = 0.
5237154b93 Jean*0069 DO i=1,nThreads
0070 tmp = tmp + phiGSR4(1,i)
924557e60a Chri*0071 ENDDO
0072 sumPhi = tmp
ca1d7a672f Jean*0073 #ifdef ALLOW_USE_MPI
924557e60a Chri*0074 IF ( usingMPI ) THEN
0075 CALL MPI_Allreduce(tmp,sumPhi,1,MPI_REAL,MPI_SUM,
ed584e7d0c Jean*0076 & MPI_COMM_MODEL,mpiRC)
924557e60a Chri*0077 ENDIF
ca1d7a672f Jean*0078 #endif /* ALLOW_USE_MPI */
78c96bee2f Alis*0079
b043311a0b Jean*0080 phiGSR4(1,0) = sumPhi
78c96bee2f Alis*0081
924557e60a Chri*0082 _END_MASTER( myThid )
0083
aea29c8517 Alis*0084 CALL BAR2( myThid )
78c96bee2f Alis*0085
0086
40c782d0d0 Jean*0087 sumPhi = phiGSR4(1,0)
78c96bee2f Alis*0088
924557e60a Chri*0089 RETURN
0090 END
03c23d8c97 Jean*0091
b043311a0b Jean*0092
4c563c2ee9 Chri*0093
0094
0095
0096
03c23d8c97 Jean*0097 SUBROUTINE GLOBAL_SUM_R8(
78c96bee2f Alis*0098 U sumPhi,
924557e60a Chri*0099 I myThid )
b043311a0b Jean*0100
4c563c2ee9 Chri*0101
0102
03c23d8c97 Jean*0103
0104
4c563c2ee9 Chri*0105
03c23d8c97 Jean*0106
0107
0108
0109
0110
0111
0112
4c563c2ee9 Chri*0113
924557e60a Chri*0114
4c563c2ee9 Chri*0115
b043311a0b Jean*0116 IMPLICIT NONE
0117
924557e60a Chri*0118
0119 #include "SIZE.h"
0120 #include "EEPARAMS.h"
0121 #include "EESUPPORT.h"
aea29c8517 Alis*0122 #include "GLOBAL_SUM.h"
924557e60a Chri*0123
4c563c2ee9 Chri*0124
924557e60a Chri*0125
b043311a0b Jean*0126
0127
924557e60a Chri*0128 Real*8 sumPhi
0129 INTEGER myThid
0130
4c563c2ee9 Chri*0131
924557e60a Chri*0132
b043311a0b Jean*0133
0134
5237154b93 Jean*0135 INTEGER i
924557e60a Chri*0136 Real*8 tmp
ca1d7a672f Jean*0137 #ifdef ALLOW_USE_MPI
924557e60a Chri*0138 INTEGER mpiRC
0139 #endif /* ALLOW_USE_MPI */
4c563c2ee9 Chri*0140
924557e60a Chri*0141
78c96bee2f Alis*0142
b043311a0b Jean*0143 phiGSR8(1,myThid) = sumPhi
78c96bee2f Alis*0144
46dc4f419b Chri*0145
b043311a0b Jean*0146
aea29c8517 Alis*0147
0148 CALL BAR2( myThid )
0149
0150
b043311a0b Jean*0151
924557e60a Chri*0152
0153
0154 _BEGIN_MASTER( myThid )
0155 tmp = 0. _d 0
5237154b93 Jean*0156 DO i=1,nThreads
0157 tmp = tmp + phiGSR8(1,i)
924557e60a Chri*0158 ENDDO
0159 sumPhi = tmp
ca1d7a672f Jean*0160 #ifdef ALLOW_USE_MPI
924557e60a Chri*0161 IF ( usingMPI ) THEN
0162 CALL MPI_Allreduce(tmp,sumPhi,1,MPI_DOUBLE_PRECISION,MPI_SUM,
ed584e7d0c Jean*0163 & MPI_COMM_MODEL,mpiRC)
924557e60a Chri*0164 ENDIF
ca1d7a672f Jean*0165 #endif /* ALLOW_USE_MPI */
924557e60a Chri*0166
b043311a0b Jean*0167 phiGSR8(1,0) = sumPhi
924557e60a Chri*0168 _END_MASTER( myThid )
0169
46dc4f419b Chri*0170
b043311a0b Jean*0171
aea29c8517 Alis*0172
0173
0174
0175 CALL BAR2( myThid )
b043311a0b Jean*0176
78c96bee2f Alis*0177
0178
b043311a0b Jean*0179 sumPhi = phiGSR8(1,0)
78c96bee2f Alis*0180
924557e60a Chri*0181 RETURN
0182 END
4c563c2ee9 Chri*0183
b043311a0b Jean*0184
4c563c2ee9 Chri*0185
0186
0187
03c23d8c97 Jean*0188 SUBROUTINE GLOBAL_SUM_INT(
3877be74e8 Patr*0189 U sumPhi,
0190 I myThid )
b043311a0b Jean*0191
4c563c2ee9 Chri*0192
0193
03c23d8c97 Jean*0194
0195
4c563c2ee9 Chri*0196
03c23d8c97 Jean*0197
0198
0199
0200
0201
0202
0203
4c563c2ee9 Chri*0204
3877be74e8 Patr*0205
4c563c2ee9 Chri*0206
b043311a0b Jean*0207 IMPLICIT NONE
0208
3877be74e8 Patr*0209
0210 #include "SIZE.h"
0211 #include "EEPARAMS.h"
0212 #include "EESUPPORT.h"
aea29c8517 Alis*0213 #include "GLOBAL_SUM.h"
3877be74e8 Patr*0214
4c563c2ee9 Chri*0215
3877be74e8 Patr*0216
b043311a0b Jean*0217
0218
3877be74e8 Patr*0219 INTEGER sumPhi
0220 INTEGER myThid
0221
4c563c2ee9 Chri*0222
3877be74e8 Patr*0223
b043311a0b Jean*0224
0225
5237154b93 Jean*0226 INTEGER i
3877be74e8 Patr*0227 INTEGER tmp
ca1d7a672f Jean*0228 #ifdef ALLOW_USE_MPI
3877be74e8 Patr*0229 INTEGER mpiRC
0230 #endif /* ALLOW_USE_MPI */
4c563c2ee9 Chri*0231
3877be74e8 Patr*0232
0233
aea29c8517 Alis*0234 phiGSI(1,myThid) = sumPhi
3877be74e8 Patr*0235
0236
0237 _BARRIER
0238
0239
0240 _BEGIN_MASTER( myThid )
03c23d8c97 Jean*0241 tmp = 0
5237154b93 Jean*0242 DO i=1,nThreads
0243 tmp = tmp + phiGSI(1,i)
3877be74e8 Patr*0244 ENDDO
0245 sumPhi = tmp
ca1d7a672f Jean*0246 #ifdef ALLOW_USE_MPI
3877be74e8 Patr*0247 IF ( usingMPI ) THEN
0248 CALL MPI_Allreduce(tmp,sumPhi,1,MPI_INTEGER,MPI_SUM,
ed584e7d0c Jean*0249 & MPI_COMM_MODEL,mpiRC)
3877be74e8 Patr*0250 ENDIF
ca1d7a672f Jean*0251 #endif /* ALLOW_USE_MPI */
3877be74e8 Patr*0252
b043311a0b Jean*0253 phiGSI(1,0) = sumPhi
3877be74e8 Patr*0254 _END_MASTER( myThid )
0255
0256
0257 _BARRIER
0258
0259
b043311a0b Jean*0260 sumPhi = phiGSI(1,0)
3877be74e8 Patr*0261
0262 RETURN
0263 END