40 . IXS,IXC,IXT,IXP,IXR,IXTG,IXS10,
41 . ADDCNEL,CNEL,TAG_NODE,TAG_ELEM )
55 use element_mod ,
only : nixs,nixc,nixt,nixp,nixr,nixtg
59 USE spmd_comm_world_mod,
ONLY : spmd_comm_world
60#include "implicit_f.inc"
76 INTEGER,
DIMENSION(2,NSPMD+1),
INTENT(in) :: IAD_ELEM
77 TYPE(nodal_arrays_),
INTENT(INOUT) :: NODES
78 TYPE(shooting_node_type),
INTENT(inout) :: SHOOT_STRUCT
79 TYPE(intbuf_struct_),
DIMENSION(NINTER),
INTENT(inout) :: INTBUF_TAB
80 INTEGER,
DIMENSION(NINTER),
INTENT(inout) :: NEWFRONT
81 INTEGER,
DIMENSION(NIXS,NUMELS),
TARGET,
INTENT(in) :: IXS
82 INTEGER,
DIMENSION(NIXC,NUMELC),
TARGET,
INTENT(in) :: IXC
83 INTEGER,
DIMENSION(NIXT,NUMELT),
TARGET,
INTENT(in) :: IXT
84 INTEGER,
DIMENSION(NIXP,NUMELP),
TARGET,
INTENT(in) :: IXP
85 INTEGER,
DIMENSION(NIXR,NUMELR),
TARGET,
INTENT(in) :: IXR
86 INTEGER,
DIMENSION(NIXTG,NUMELTG),
TARGET,
INTENT(in) :: IXTG
87 INTEGER,
DIMENSION(6,NUMELS10),
INTENT(in) :: IXS10
88 INTEGER,
DIMENSION(0:NUMNOD+1),
INTENT(in) :: ADDCNEL
89 INTEGER,
DIMENSION(NPARI,NINTER),
INTENT(in) ::
90 my_real,
DIMENSION(NPROPG,NUMGEO),
INTENT(in) :: geo
91 INTEGER,
DIMENSION(0:LCNEL),
INTENT(in) :: CNEL
92 INTEGER,
DIMENSION(NUMNOD),
INTENT(inout) :: TAG_NODE
93 INTEGER,
DIMENSION(NUMELS+NUMELQ+NUMELC+NUMELT+NUMELP+NUMELR+NUMELTG)INTENT(inout) :: TAG_ELEM
99 INTEGER :: MSGTYP,MSGOFF1
100INTEGER :: PROC_ID,SIZE_BUFFER_R
101 INTEGER :: RECV_NB,RECV_SURF_NB
102 INTEGER,
DIMENSION(2,NSPMD)
103INTEGER,
DIMENSION(NSPMD) :: INDEX_PROC,INDEX_BUFFER_R,INDEX_R_PROC,INDEX_R_PROC_2,INDEX_BUFFER_R_2
104 INTEGER,
DIMENSION(NSPMD) :: REQUEST_SIZE_R,REQUEST_SIZE_S
105 INTEGER,
DIMENSION(NSPMD) :: REQUEST_SURF_R,REQUEST_SURF_S
107 INTEGER,
DIMENSION(MPI_STATUS_SIZE) :: STATUS_MPI
108 INTEGER,
DIMENSION(MPI_STATUS_SIZE,NSPMD) :: ARRAY_STATUSES
109 INTEGER :: IERROR,FRONTIER_ELM,NB_SURFACE,ADDRESS,NB_EDGE
111 INTEGER,
DIMENSION(:),
ALLOCATABLE :: BUFFER_R
112 TYPE(
array_type),
DIMENSION(NSPMD) :: BUFFER_S
119 surf_per_proc(1:2,1:nspmd) = 0
124 DO i=1,shoot_struct%SAVE_PROC_NB,5
125 proc_id = shoot_struct%SAVE_PROC(i)
126 surf_per_proc(1,proc_id) = surf_per_proc(1,proc_id) + 1
130 DO i=1,shoot_struct%SAVE_PROC_NB_EDGE,3
131 proc_id = shoot_struct%SAVE_PROC_EDGE(i)
132 surf_per_proc(2,proc_id) = surf_per_proc(2,proc_id) + 1
136 index_proc(1:nspmd) = 0
138 buffer_s(i)%SIZE_INT_ARRAY_1D = 4*surf_per_proc(1,i) +
139 . 2 * surf_per_proc(2,i)
145 DO i=1,shoot_struct%SAVE_PROC_NB,5
146 proc_id = shoot_struct%SAVE_PROC(i)
148 index_proc(proc_id) = index_proc(proc_id) + 1
149 buffer_s(proc_id)%INT_ARRAY_1D( index_proc(proc_id) ) = shoot_struct%SAVE_PROC(i+j)
154 DO i=1,shoot_struct%SAVE_PROC_NB_EDGE,3
155 proc_id = shoot_struct%SAVE_PROC_EDGE(i)
157 index_proc(proc_id) = index_proc(proc_id) + 1
158 buffer_s(proc_id)%INT_ARRAY_1D( index_proc(proc_id) ) = shoot_struct%SAVE_PROC_EDGE(i+j)
167 frontier_elm = iad_elem(1,i+1)-iad_elem(1,i)
168 IF(frontier_elm>0)
THEN
169 recv_nb = recv_nb + 1
170 index_r_proc(recv_nb) = i
172 CALL mpi_irecv( remote_surf_per_proc(1,recv_nb),2,mpi_integer,it_spmd(i),msgtyp,
173 . spmd_comm_world,request_size_r(recv_nb),ierror )
181 frontier_elm = iad_elem(1,i+1)-iad_elem(1,i)
182 IF(frontier_elm>0)
THEN
184 CALL mpi_isend( surf_per_proc(1,i),2,mpi_integer,it_spmd(i),msgtyp,
185 . spmd_comm_world,request_size_s(i),ierror )
192 IF(recv_nb>0)
CALL mpi_waitall(recv_nb,request_size_r,array_statuses,ierror)
195 index_buffer_r(1:nspmd) = 0
196 index_buffer_r(1) = 1
198 IF(i>1) index_buffer_r(i) = index_buffer_r(i-1) + 4*remote_surf_per_proc(1,i-1) +
199 . 2 * remote_surf_per_proc(2,i-1)
200 size_buffer_r = size_buffer_r + 4*remote_surf_per_proc(1,i) + 2*remote_surf_per_proc(2,i)
202 ALLOCATE( buffer_r( size_buffer_r ) )
208 index_buffer_r_2(1:nspmd) = 0
209 remote_surf_per_proc_2(1:2,1:nspmd) = 0
210 index_r_proc_2(1:nspmd) = 0
212 IF(remote_surf_per_proc(1,i)+remote_surf_per_proc(2,i)>0)
THEN
213 proc_id = index_r_proc(i)
215 recv_surf_nb = recv_surf_nb + 1
217 index_buffer_r_2(recv_surf_nb) = index_buffer_r
218 remote_surf_per_proc_2(1:2,recv_surf_nb) = remote_surf_per_proc(1:2,i)
219 CALL mpi_irecv( buffer_r(index_buffer_r(i)),4*remote_surf_per_proc(1,i)+2*remote_surf_per_proc(2,i),
220 . mpi_integer,it_spmd(proc_id),msgtyp,
221 . spmd_comm_world,request_surf_r(recv_surf_nb),ierror )
230 IF(surf_per_proc(1,i)+surf_per_proc(2,i)>0)
THEN
232 CALL mpi_isend( buffer_s(i)%INT_ARRAY_1D,index_proc(i),mpi_integer,it_spmd(i),msgtyp,
233 . spmd_comm_world,request_surf_s(i),ierror )
240 CALL mpi_waitany(recv_surf_nb,request_surf_r,k,status_mpi,ierror)
241 proc_id = index_r_proc_2(k)
242 nb_surface = remote_surf_per_proc_2(1,k)
243 address = index_buffer_r_2(k)
247 . ixs,ixc,ixt,ixp,ixr,ixtg,ixs10,
248 . addcnel,cnel,tag_node,tag_elem )
249 nb_edge = remote_surf_per_proc_2(2,k)
250 address = index_buffer_r_2(k)+4*nb_surface
252 . newfront,ipari,geo,
253 . ixs,ixc,ixt,ixp,ixr,ixtg,ixs10,
254 . addcnel,cnel,tag_node,tag_elem )
260 frontier_elm = iad_elem(1,i+1)-iad_elem(1,i)
261 IF(frontier_elm>0)
THEN
262 CALL mpi_wait(request_size_s(i),status_mpi,ierror)
267 IF(surf_per_proc(1,i)+surf_per_proc(2,i)>0)
THEN
268 CALL mpi_wait(request_surf_s(i),status_mpi,ierror)