39 . IXS,IXC,IXT,IXP,IXR,IXTG,IXS10,
40 . ADDCNEL,CNEL,TAG_NODE,TAG_ELEM )
57 USE spmd_comm_world_mod,
ONLY : spmd_comm_world
58#include "implicit_f.inc"
74 INTEGER,
DIMENSION(2,NSPMD+1),
INTENT(in) :: IAD_ELEM
75 TYPE(nodal_arrays_),
INTENT(INOUT) :: NODES
76 TYPE(shooting_node_type),
INTENT(inout) :: SHOOT_STRUCT
77 TYPE(intbuf_struct_),
DIMENSION(NINTER),
INTENT(inout) :: INTBUF_TAB
78 INTEGER,
DIMENSION(NINTER),
INTENT(inout) :: NEWFRONT
79 INTEGER,
DIMENSION(NIXS,NUMELS),
TARGET,
INTENT(in) :: IXS
80 INTEGER,
DIMENSION(NIXC,NUMELC),
TARGET,
INTENT(in) :: IXC
81 INTEGER,
DIMENSION(NIXT,NUMELT),
TARGET,
INTENT(in) :: IXT
82 INTEGER,
DIMENSION(NIXP,NUMELP),
TARGET,
INTENT(in) :: IXP
83 INTEGER,
DIMENSION(NIXR,NUMELR),
TARGET,
INTENT(in) :: IXR
84 INTEGER,
DIMENSION(NIXTG,NUMELTG),
TARGET,
INTENT(in) :: IXTG
85 INTEGER,
DIMENSION(6,NUMELS10),
INTENT(in) :: IXS10
86 INTEGER,
DIMENSION(0:NUMNOD+1),
INTENT(in) :: ADDCNEL
87 INTEGER,
DIMENSION(NPARI,NINTER),
INTENT(in) :: IPARI
88 my_real,
DIMENSION(NPROPG,NUMGEO),
INTENT(in) :: geo
89 INTEGER,
DIMENSION(0:LCNEL),
INTENT(in) :: CNEL
90 INTEGER,
DIMENSION(NUMNOD),
INTENT(inout) :: TAG_NODE
91 INTEGER,
DIMENSION(NUMELS+NUMELQ+NUMELC+NUMELT+NUMELP+NUMELR+NUMELTG),
INTENT(inout) :: TAG_ELEM
97 INTEGER :: MSGTYP,MSGOFF1,MSGOFF2
98 INTEGER :: PROC_ID,SIZE_BUFFER_R
99 INTEGER :: RECV_NB,RECV_SURF_NB
100 INTEGER,
DIMENSION(2,NSPMD) :: SURF_PER_PROC,REMOTE_SURF_PER_PROC,REMOTE_SURF_PER_PROC_2
101 INTEGER,
DIMENSION(NSPMD) :: INDEX_PROC,INDEX_BUFFER_R,INDEX_R_PROC,INDEX_R_PROC_2,INDEX_BUFFER_R_2
102 INTEGER,
DIMENSION(NSPMD) :: REQUEST_SIZE_R,REQUEST_SIZE_S
103 INTEGER,
DIMENSION(NSPMD) :: REQUEST_SURF_R,REQUEST_SURF_S
105 INTEGER,
DIMENSION(MPI_STATUS_SIZE) :: STATUS_MPI
106 INTEGER,
DIMENSION(MPI_STATUS_SIZE,NSPMD) :: ARRAY_STATUSES
107 INTEGER :: IERROR,FRONTIER_ELM,NB_SURFACE,ADDRESS,NB_EDGE
109 INTEGER,
DIMENSION(:),
ALLOCATABLE :: BUFFER_R
110 TYPE(
array_type),
DIMENSION(NSPMD) :: BUFFER_S
117 surf_per_proc(1:2,1:nspmd) = 0
118 remote_surf_per_proc(1:2,1:nspmd) = 0
122 DO i=1,shoot_struct%SAVE_PROC_NB,5
123 proc_id = shoot_struct%SAVE_PROC(i)
124 surf_per_proc(1,proc_id) = surf_per_proc(1,proc_id) + 1
128 DO i=1,shoot_struct%SAVE_PROC_NB_EDGE,3
129 proc_id = shoot_struct%SAVE_PROC_EDGE(i)
130 surf_per_proc(2,proc_id) = surf_per_proc(2,proc_id) + 1
134 index_proc(1:nspmd) = 0
136 buffer_s(i)%SIZE_INT_ARRAY_1D = 4*surf_per_proc(1,i) +
137 . 2 * surf_per_proc(2,i)
143 DO i=1,shoot_struct%SAVE_PROC_NB,5
144 proc_id = shoot_struct%SAVE_PROC(i)
146 index_proc(proc_id) = index_proc(proc_id) + 1
147 buffer_s(proc_id)%INT_ARRAY_1D( index_proc(proc_id) ) = shoot_struct%SAVE_PROC(i+j)
152 DO i=1,shoot_struct%SAVE_PROC_NB_EDGE,3
153 proc_id = shoot_struct%SAVE_PROC_EDGE(i)
155 index_proc(proc_id) = index_proc(proc_id) + 1
156 buffer_s(proc_id)%INT_ARRAY_1D( index_proc(proc_id) ) = shoot_struct%SAVE_PROC_EDGE(i+j)
165 frontier_elm = iad_elem(1,i+1)-iad_elem(1,i)
166 IF(frontier_elm>0)
THEN
167 recv_nb = recv_nb + 1
168 index_r_proc(recv_nb) = i
170 CALL mpi_irecv( remote_surf_per_proc(1,recv_nb),2,mpi_integer,it_spmd(i),msgtyp,
171 . spmd_comm_world,request_size_r(recv_nb),ierror )
179 frontier_elm = iad_elem(1,i+1)-iad_elem(1,i)
180 IF(frontier_elm>0)
THEN
182 CALL mpi_isend( surf_per_proc(1,i),2,mpi_integer,it_spmd(i),msgtyp,
183 . spmd_comm_world,request_size_s(i),ierror )
190 IF(recv_nb>0)
CALL mpi_waitall(recv_nb,request_size_r,array_statuses,ierror)
193 index_buffer_r(1:nspmd) = 0
194 index_buffer_r(1) = 1
196 IF(i>1) index_buffer_r(i) = index_buffer_r(i-1) + 4*remote_surf_per_proc(1,i-1) +
197 . 2 * remote_surf_per_proc(2,i-1)
198 size_buffer_r = size_buffer_r + 4*remote_surf_per_proc(1,i) + 2*remote_surf_per_proc(2,i)
200 ALLOCATE( buffer_r( size_buffer_r ) )
206 index_buffer_r_2(1:nspmd) = 0
207 remote_surf_per_proc_2(1:2,1:nspmd) = 0
208 index_r_proc_2(1:nspmd) = 0
210 IF(remote_surf_per_proc(1,i)+remote_surf_per_proc(2,i)>0)
THEN
211 proc_id = index_r_proc(i)
213 recv_surf_nb = recv_surf_nb + 1
214 index_r_proc_2(recv_surf_nb) = index_r_proc(i)
215 index_buffer_r_2(recv_surf_nb) = index_buffer_r(i)
216 remote_surf_per_proc_2(1:2,recv_surf_nb) = remote_surf_per_proc(1:2,i)
217 CALL mpi_irecv( buffer_r(index_buffer_r(i)),4*remote_surf_per_proc(1,i)+2*remote_surf_per_proc
218 . mpi_integer,it_spmd(proc_id),msgtyp,
219 . spmd_comm_world,request_surf_r(recv_surf_nb),ierror )
228 IF(surf_per_proc(1,i)+surf_per_proc(2,i)>0)
THEN
230 CALL mpi_isend( buffer_s(i)%INT_ARRAY_1D,index_proc(i),mpi_integer,it_spmd(i),msgtyp,
231 . spmd_comm_world,request_surf_s(i),ierror )
238 CALL mpi_waitany(recv_surf_nb,request_surf_r,k,status_mpi,ierror)
239 proc_id = index_r_proc_2(k)
240 nb_surface = remote_surf_per_proc_2(1,k)
241 address = index_buffer_r_2(k)
245 . ixs,ixc,ixt,ixp,ixr,ixtg,ixs10,
246 . addcnel,cnel,tag_node,tag_elem )
247 nb_edge = remote_surf_per_proc_2(2,k)
248 address = index_buffer_r_2(k)+4*nb_surface
250 . newfront,ipari,geo,
251 . ixs,ixc,ixt,ixp,ixr,ixtg,ixs10,
252 . addcnel,cnel,tag_node,tag_elem )
258 frontier_elm = iad_elem(1,i+1)-iad_elem(1,i)
259 IF(frontier_elm>0)
THEN
260 CALL mpi_wait(request_size_s(i),status_mpi,ierror)
265 IF(surf_per_proc(1,i)+surf_per_proc(2,i)>0)
THEN
266 CALL mpi_wait(request_surf_s(i),status_mpi,ierror)