Changeset 1847
- Timestamp:
- Aug 23, 2013, 2:15:54 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ5/trunk/libf/dyn3dmem/mod_hallo.F90
r1823 r1847 3 3 implicit none 4 4 logical,save :: use_mpi_alloc 5 integer, parameter :: MaxRequest=2006 5 integer, parameter :: MaxProc=512 7 integer, parameter :: MaxBufferSize=1024*1024*100 6 integer, parameter :: DefaultMaxBufferSize=1024*1024*100 7 integer, SAVE :: MaxBufferSize=0 8 8 integer, parameter :: ListSize=1000 9 9 … … 28 28 type request_SR 29 29 integer :: NbRequest=0 30 integer :: NbRequestMax=0 30 31 integer :: BufferSize 31 32 integer :: Pos 32 33 integer :: Index 33 type(Hallo), dimension(MaxRequest) :: Hallo34 type(Hallo), POINTER :: Hallo(:) 34 35 integer :: MSG_Request 35 36 end type request_SR … … 64 65 subroutine Init_mod_hallo 65 66 USE dimensions_mod 67 USE IOIPSL 66 68 implicit none 67 69 integer :: jj_nb_gather(0:mpi_size-1) … … 70 72 Buffer_Pos(Index_Pos)=1 71 73 MaxBufferSize_Used=0 72 74 !$OMP MASTER 75 MaxBufferSize=DefaultMaxBufferSize 76 CALL getin("mpi_buffer_size",MaxBufferSize) 77 !$OMP END MASTER 78 !$OMP BARRIER 79 73 80 IF (use_mpi_alloc .AND. using_mpi) THEN 74 81 CALL create_global_mpi_buffer … … 84 91 !$OMP END MASTER 85 92 !$OMP BARRIER 93 86 94 end subroutine init_mod_hallo 87 95 … … 178 186 179 187 180 subroutine Init_Hallo(Field,Stride,NbLevel,offset,size,NewHallo)188 subroutine New_Hallo(Field,Stride,NbLevel,offset,size,Ptr_request) 181 189 integer :: Stride 182 190 integer :: NbLevel … … 184 192 integer :: offset 185 193 real, dimension(Stride,NbLevel),target :: Field 186 type(Hallo) :: NewHallo 187 194 type(request_SR),pointer :: Ptr_request 195 type(Hallo),POINTER :: NewHallos(:),HalloSwitch(:), NewHallo 196 197 Ptr_Request%NbRequest=Ptr_Request%NbRequest+1 198 IF(Ptr_Request%NbRequestMax==0) THEN 199 Ptr_Request%NbRequestMax=10 200 ALLOCATE(Ptr_Request%Hallo(Ptr_Request%NbRequestMax)) 201 ELSE IF ( Ptr_Request%NbRequest > Ptr_Request%NbRequestMax) THEN 202 Ptr_Request%NbRequestMax=INT(Ptr_Request%NbRequestMax*1.2) 203 ALLOCATE(NewHallos(Ptr_Request%NbRequestMax)) 204 NewHallos(1:Ptr_Request%NbRequest-1)=Ptr_Request%hallo(1:Ptr_Request%NbRequest-1) 205 HalloSwitch=>Ptr_Request%hallo 206 Ptr_Request%hallo=>NewHallos 207 DEALLOCATE(HalloSwitch) 208 ENDIF 209 210 NewHallo=>Ptr_Request%hallo(Ptr_Request%NbRequest) 211 188 212 NewHallo%Field=>Field 189 213 NewHallo%Stride=Stride … … 192 216 NewHallo%offset=offset 193 217 194 195 end subroutine Init_Hallo 218 end subroutine New_Hallo 196 219 197 220 subroutine Register_SendField(Field,ij,ll,offset,size,target,a_request) … … 206 229 207 230 Ptr_Request=>a_request%RequestSend(target) 208 Ptr_Request%NbRequest=Ptr_Request%NbRequest+1 209 if (Ptr_Request%NbRequest>=MaxRequest) then 210 print *,'STOP :: La taille de MaxRequest dans mod_hallo.F90 est trop petite !!!!' 211 stop 212 endif 213 call Init_Hallo(Field,ij,ll,offset,size,Ptr_request%Hallo(Ptr_Request%NbRequest)) 231 232 call New_Hallo(Field,ij,ll,offset,size,Ptr_request) 214 233 215 234 end subroutine Register_SendField … … 226 245 227 246 Ptr_Request=>a_request%RequestRecv(target) 228 Ptr_Request%NbRequest=Ptr_Request%NbRequest+1229 230 if (Ptr_Request%NbRequest>=MaxRequest) then231 print *,'STOP :: La taille de MaxRequest dans mod_hallo.F90 est trop petite !!!!'232 stop233 endif234 247 235 call Init_Hallo(Field,ij,ll,offset,size,Ptr_request%Hallo(Ptr_Request%NbRequest))248 call New_Hallo(Field,ij,ll,offset,size,Ptr_request) 236 249 237 250
Note: See TracChangeset
for help on using the changeset viewer.