File indexing completed on 2018-03-02 18:44:05 UTC
view on githubraw file Latest commit add29e06 on 2018-01-31 20:35:05 UTC
0bed5b371d Patr*0001 #include "CPP_OPTIONS.h"
0002
0003 subroutine exch_allgather_2d_rl(
0004 I arr
0005 O , full
d85ace1852 Jean*0006 I , myThid
0bed5b371d Patr*0007 & )
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021 implicit none
0022
0023
0024
0025 #include "EEPARAMS.h"
0026 #include "SIZE.h"
0027 #include "EESUPPORT.h"
0028 #include "EXCH.h"
0029
0030
0031
0032 _RL arr ( 1-OLx:sNx+OLx, 1-OLy:sNy+OLy, nSx, nSy )
0033 _RL full( 1-OLx:sNx+OLx, 1-OLy:sNy+OLy, nSx, nSy, nPx, nPy )
d85ace1852 Jean*0034 integer myThid
0bed5b371d Patr*0035
0036
0037 #ifdef ALLOW_USE_MPI
0038 integer mpirc
0039 integer mpicrd(2)
0040 integer ipx, ipy
0041
0042 _RL recvbuf( 1-OLx:sNx+OLx, 1-OLy:sNy+OLy, nSx, nSy, nPx*nPy )
0043
0044 integer sendsize
0045 parameter( sendsize = sNx*sNy*nSx*nSy )
0046 integer recvsize
0047 parameter( recvsize = sNx*sNy*nSx*nSy )
0048
0049 integer iproc
0050 integer bi, bj
0051 integer i, j
0052 #endif
0053
0054
0055 _BARRIER
0056
0057
0058 _BEGIN_MASTER( myThid )
0059
0060 #ifdef ALLOW_USE_MPI
0061 IF ( usingMPI ) THEN
0062
0063 call MPI_Allgather( arr , sendsize, MPI_DOUBLE_PRECISION
0064 & , recvbuf, recvsize, MPI_DOUBLE_PRECISION
0065 & , MPI_COMM_MODEL, mpiRC
0066 & )
0067
0068
0069 do iproc = 1, numberOfProcs
0070
0071
0072 call MPI_Cart_coords(
0073 I MPI_COMM_MODEL, iproc-1, 2, mpicrd
0074 O , mpirc
0075 & )
0076
0077 ipx = 1 + mpicrd(1)
0078 ipy = 1 + mpicrd(2)
0079
0080 do bj = 1, nSy
0081 do bi = 1, nSx
0082 do j = 1, sNy
0083 do i = 1, sNx
0084 full(i,j,bi,bj,ipx,ipy) = recvbuf(i,j,bi,bj,iproc)
0085 enddo
0086 enddo
0087 enddo
0088 enddo
0089
0090 enddo
0091
7c7521a1da Jean*0092 ENDIF
0bed5b371d Patr*0093 #endif /* ALLOW_USE_MPI */
0094
0095
0096 _END_MASTER( myThid )
0097
0098 _BARRIER
0099
d85ace1852 Jean*0100 RETURN
0101 END