34 IMPLICIT NONE
35 include 'mpif.h'
36 TYPE (CMUMPS_ROOT_STRUC) :: root
37 INTEGER KEEP(500), ICNTL( 60 )
38 INTEGER(8) KEEP8(150)
39 REAL DKEEP(230)
40 INTEGER COMM_LOAD, ASS_IRECV
41 INTEGER INODE, NELIM_ROOT
42 INTEGER LBUFR, LBUFR_BYTES
43 INTEGER BUFR( LBUFR )
44 INTEGER(8) :: LA, POSFAC, IPTRLU, LRLU, LRLUS
45 INTEGER IWPOS, IWPOSCB
46 INTEGER N, LIW
47 INTEGER IW( LIW )
48 COMPLEX A( LA )
49 INTEGER, intent(in) :: LRGROUPS(N)
50 INTEGER(8) :: PTRAST(KEEP(28))
51 INTEGER(8) :: PTRFAC(KEEP(28))
52 INTEGER(8) :: PAMASTER(KEEP(28))
53 INTEGER PTRIST(KEEP(28)), PTLUST_S(KEEP(28))
54 INTEGER (N), (KEEP(28))
55 INTEGER COMP
56 INTEGER NSTK_S( KEEP(28) ), PROCNODE_STEPS( KEEP(28) )
57 INTEGER PERM(N)
58 INTEGER IFLAG, IERROR, COMM
59 INTEGER LPOOL, LEAF
60 INTEGER IPOOL( LPOOL )
61 INTEGER NELT, LPTRAR
62 INTEGER FRTPTR( N+1 ), FRTELT( NELT )
63 INTEGER MYID, SLAVEF, NBFIN
64 DOUBLE PRECISION OPASSW, OPELIW
65 INTEGER ITLOC( N + KEEP(253) ), FILS( N ), DAD(KEEP(28))
66 COMPLEX :: RHS_MUMPS(KEEP(255))
67 INTEGER(8), INTENT(IN) :: PTRARW( LPTRAR ), PTRAIW( LPTRAR )
68 INTEGER ND( KEEP(28) ), FRERE( KEEP(28) )
69 INTEGER INTARR(KEEP8(27))
70 COMPLEX DBLARR(KEEP8(26))
71 INTEGER ISTEP_TO_INIV2(KEEP(71)),
72 & TAB_POS_IN_PERE(SLAVEF+2,max(1,KEEP(56)))
73 include 'mumps_tags.h'
74 include 'mumps_headers.h'
75 INTEGER I, LCONT, NCOL_TO_SEND, LDA
76 INTEGER(8) :: SHIFT_VAL_SON, POSELT
77 INTEGER FPERE, IOLDPS, NFRONT, NPIV, NASS, NSLAVES,
78 & H_INODE, NELIM, NBCOL, LIST_NELIM_ROW,
79 & LIST_NELIM_COL, NELIM_LOCAL, TYPE_SON,
80 & NROW, NCOL, NBROW, SHIFT_LIST_ROW_SON,
81 & SHIFT_LIST_COL_SON, LDAFS, IERR,
82 & ISON,
83 INTEGER :: STATUS(MPI_STATUS_SIZE)
84 LOGICAL BLOCKING, SET_IRECV, MESSAGE_RECEIVED
85 INTEGER , MSGTAG
86 LOGICAL TRANSPOSE_ASM
87 INTEGER MUMPS_PROCNODE, MUMPS_TYPENODE
89 fpere = keep(38)
92 & keep(199) ).EQ.myid) THEN
93 ioldps = ptlust_s(step(inode))
94 nfront = iw(ioldps+keep(ixsz))
95 npiv = iw(ioldps+1+keep(ixsz))
96 nass = iabs(iw(ioldps + 2+keep(ixsz)))
97 nslaves = iw(ioldps+5+keep(ixsz))
98 h_inode = 6 + nslaves + keep(ixsz)
99 nelim = nass - npiv
100 nbcol = nfront - npiv
101 list_nelim_row = ioldps + h_inode + npiv
102 list_nelim_col = list_nelim_row + nfront
103 IF (nelim.LE.0) THEN
104 write(6,*) ' ERROR 1 in CMUMPS_PROCESS_ROOT2SON ', nelim
105 write(6,*) myid,':Process root2son: INODE=',inode,
106 & 'Header=',iw(ptlust_s(step(inode)):ptlust_s(step(inode))
107 & +5+keep(ixsz))
109 ENDIF
110 nelim_local = nelim_root
111 DO i=1, nelim
112 root%RG2L_ROW(iw(list_nelim_row)) = nelim_local
113 root%RG2L_COL(iw(list_nelim_col)) = nelim_local
114 nelim_local = nelim_local + 1
115 list_nelim_row = list_nelim_row + 1
116 list_nelim_col = list_nelim_col + 1
117 ENDDO
118 nbrow = nfront - npiv
119 nrow = nelim
120 IF ( keep( 50 ) .eq. 0 ) THEN
121 ncol = nfront - npiv
122 ELSE
123 ncol = nelim
124 END IF
125 shift_list_row_son = h_inode + npiv
126 shift_list_col_son = h_inode + nfront + npiv
127 IF ( keep(50).eq.0 .OR. type_son .eq. 1 ) THEN
128 ldafs = nfront
129 ELSE
130 ldafs = nass
131 END IF
132 shift_val_son = int(npiv,8) * int(ldafs,8) + int(npiv,8)
134 & ass_irecv,
135 & n, inode, fpere,
136 & ptlust_s(1), ptrast(1),
137 & root, nrow, ncol, shift_list_row_son,
138 & shift_list_col_son , shift_val_son, ldafs,
139 & root_non_elim_cb, myid, comm,
140 & bufr, lbufr, lbufr_bytes, procnode_steps, posfac,
141 & iwpos, iwposcb, iptrlu, lrlu, lrlus, iw, liw, a, la,
142 & ptrist, ptlust_s(1), ptrfac(1), ptrast(1),
143 & step, pimaster, pamaster,
144 & nstk_s,
comp, iflag, ierror, perm,
145 & ipool, lpool, leaf, nbfin, slavef,
146 & opassw, opeliw, itloc, rhs_mumps,
147 & fils, dad, ptrarw, ptraiw,
148 & intarr,dblarr,icntl,keep,keep8,dkeep,.false.,nd,frere,
149 & lptrar, nelt, frtptr, frtelt,
150 & istep_to_iniv2, tab_pos_in_pere
151 & , lrgroups
152 & )
153 IF (iflag.LT.0 ) RETURN
154 IF (type_son.EQ.1) THEN
155 nrow = nfront - nass
156 ncol = nelim
157 shift_list_row_son = h_inode + nass
158 shift_list_col_son = h_inode + nfront + npiv
159 shift_val_son = int(nass,8) * int(nfront,8) + int(npiv,8)
160 IF ( keep( 50 ) .eq. 0 ) THEN
161 transpose_asm = .false.
162 ELSE
163 transpose_asm = .true.
164 END IF
166 & n, inode, fpere,
167 & ptlust_s, ptrast,
168 & root, nrow, ncol, shift_list_row_son,
169 & shift_list_col_son , shift_val_son, nfront,
170 & root_non_elim_cb, myid, comm,
171 &
172 & bufr, lbufr, lbufr_bytes, procnode_steps, posfac,
173 & iwpos, iwposcb, iptrlu, lrlu, lrlus, iw, liw, a, la,
174 & ptrist, ptlust_s, ptrfac,
175 & ptrast, step, pimaster, pamaster,
176 & nstk_s,
comp, iflag, ierror, perm,
177 & ipool, lpool, leaf, nbfin, slavef,
178 & opassw, opeliw, itloc, rhs_mumps,
179 & fils, dad, ptrarw, ptraiw,
180 & intarr,dblarr,icntl,keep,keep8,dkeep,
181 & transpose_asm,nd,frere,
182 & lptrar, nelt, frtptr, frtelt,
183 & istep_to_iniv2, tab_pos_in_pere, lrgroups )
184 IF (iflag.LT.0 ) RETURN
185 ENDIF
186 ioldps = ptlust_s(step(inode))
187 poselt = ptrast(step(inode))
188 iw(ioldps + 4+keep(ixsz)) = step(inode)
189 ptrfac(step(inode))=poselt
190 IF ( type_son .eq. 1 ) THEN
191 nbrow = nfront - npiv
192 ELSE
193 nbrow = nelim
194 END IF
195 IF ( type_son .eq. 1 .OR. keep(50).EQ.0) THEN
196 lda = nfront
197 ELSE
198 lda = npiv+nbrow
199 ENDIF
201 & npiv, nbrow, keep,
202 & int(lda,8)*int(nbrow+npiv,8), iw(ioldps+h_inode+nfront))
203 iw(ioldps + keep(ixsz)) = nbcol
204 iw(ioldps + 1 +keep(ixsz)) = nass - npiv
205 IF (type_son.EQ.2) THEN
206 iw(ioldps + 2 +keep(ixsz)) = nass
207 ELSE
208 iw(ioldps + 2 +keep(ixsz)) = nfront
209 ENDIF
210 iw(ioldps + 3 +keep(ixsz)) = npiv
212 & a, la, posfac, lrlu, lrlus,
213 & iwpos, ptrast,ptrfac,step, keep,keep8, .false.,inode,ierr
214 & , lrgroups, nass
215 & )
216 IF(ierr.LT.0)THEN
217 iflag=ierr
218 ierror=0
219 RETURN
220 ENDIF
221 ELSE
222 ison = inode
223 pdest_master_ison =
225 IF ( ptrist(step(ison)) .EQ. 0) THEN
227 & ass_irecv,
228 & bufr, lbufr, lbufr_bytes, procnode_steps, posfac,
229 & iwpos, iwposcb, iptrlu,
230 & lrlu, lrlus, n, iw, liw, a, la, ptrist,
231 & ptlust_s, ptrfac,
232 & ptrast, step, pimaster, pamaster, nstk_s,
comp,
233 & iflag, ierror, comm,
234 & perm, ipool, lpool, leaf, nbfin, myid, slavef,
235 &
236 & root, opassw, opeliw, itloc, rhs_mumps,
237 & fils, dad, ptrarw, ptraiw,
238 & intarr, dblarr,icntl,keep,keep8,dkeep,nd,frere,lptrar,
239 & nelt, frtptr, frtelt,
240 & istep_to_iniv2, tab_pos_in_pere, .true.
241 & , lrgroups
242 & )
243 IF ( iflag .LT. 0 ) RETURN
244 ENDIF
245 DO WHILE (
246 & ( iw( ptrist(step(ison)) + 1 +keep(ixsz)) .NE.
247 & iw( ptrist(step(ison)) + 3 +keep(ixsz)) ) .OR.
248 & ( keep(50) .NE. 0 .AND.
249 & iw( ptrist(step(ison)) + 6 +keep(ixsz)) .NE. 0 ) )
250 IF ( keep(50).eq.0) THEN
251 msgsou = pdest_master_ison
252 msgtag = bloc_facto
253 ELSE
254 IF ( iw( ptrist(step(ison)) + 1 +keep(ixsz)) .NE.
255 & iw( ptrist(step(ison)) + 3 +keep(ixsz)) ) THEN
256 msgsou = pdest_master_ison
257 msgtag = bloc_facto_sym
258 ELSE
259 msgsou = mpi_any_source
260 msgtag = bloc_facto_sym_slave
261 END IF
262 END IF
263 blocking = .true.
264 set_irecv = .false.
265 message_received = .false.
267 & blocking, set_irecv, message_received,
268 & msgsou, msgtag,
269 & status,
270 & bufr, lbufr, lbufr_bytes, procnode_steps, posfac,
271 & iwpos, iwposcb, iptrlu,
272 & lrlu, lrlus, n, iw, liw, a, la, ptrist,
273 & ptlust_s, ptrfac,
274 & ptrast, step, pimaster, pamaster, nstk_s,
comp,
275 & iflag, ierror, comm,
276 & perm, ipool, lpool, leaf, nbfin, myid, slavef,
277 &
278 & root, opassw, opeliw, itloc, rhs_mumps,
279 & fils, dad, ptrarw, ptraiw,
280 & intarr,dblarr,icntl,keep,keep8,dkeep,nd, frere, lptrar,
281 & nelt, frtptr, frtelt,
282 & istep_to_iniv2, tab_pos_in_pere, .true.
283 & , lrgroups
284 & )
285 IF ( iflag .LT. 0 ) RETURN
286 END DO
287 ioldps = ptrist(step(inode))
288 lcont = iw(ioldps+keep(ixsz))
289 nrow = iw(ioldps+2+keep(ixsz))
290 npiv = iw(ioldps+3+keep(ixsz))
291 nass = iw(ioldps+4+keep(ixsz))
292 nelim = nass-npiv
293 IF (nelim.LE.0) THEN
294 write(6,*) myid,': INODE,LCONT, NROW, NPIV, NASS, NELIM=',
295 & inode,lcont, nrow, npiv, nass, nelim
296 write(6,*) myid,': IOLDPS=',ioldps
297 write(6,*) myid,': ERROR 2 in CMUMPS_PROCESS_ROOT2SON '
299 ENDIF
300 nslaves= iw(ioldps+5+keep(ixsz))
301 h_inode = 6 + nslaves + keep(ixsz)
302 list_nelim_col = ioldps + h_inode + nrow + npiv
303 nelim_local = nelim_root
304 DO i = 1, nelim
305 root%RG2L_COL(iw(list_nelim_col)) = nelim_local
306 root%RG2L_ROW(iw(list_nelim_col)) = nelim_local
307 nelim_local = nelim_local + 1
308 list_nelim_col = list_nelim_col + 1
309 ENDDO
310 shift_list_row_son = 6 + iw(ioldps+5+keep(ixsz)) + keep(ixsz)
311 shift_list_col_son = shift_list_row_son + nrow + npiv
312 ncol_to_send = nelim
313 lda = -9999
314 shift_val_son = -9999_8
315 IF ( keep( 50 ) .eq. 0 ) THEN
316 transpose_asm = .false.
317 ELSE
318 transpose_asm = .true.
319 END IF
321 & n, inode, fpere,
322 & ptrist, ptrast,
323 & root, nrow, ncol_to_send, shift_list_row_son,
324 & shift_list_col_son , shift_val_son, lda,
325 & root_non_elim_cb, myid, comm,
326 &
327 & bufr, lbufr, lbufr_bytes, procnode_steps, posfac,
328 & iwpos, iwposcb, iptrlu, lrlu, lrlus, iw, liw, a, la,
329 & ptrist, ptlust_s, ptrfac,
330 & ptrast, step, pimaster, pamaster,
331 & nstk_s,
comp, iflag, ierror, perm,
332 & ipool, lpool, leaf, nbfin, slavef,
333 & opassw, opeliw, itloc, rhs_mumps,
334 & fils, dad, ptrarw, ptraiw,
335 & intarr,dblarr,icntl,keep,keep8,dkeep,transpose_asm,
336 & nd, frere, lptrar, nelt, frtptr, frtelt,
337 & istep_to_iniv2, tab_pos_in_pere, lrgroups)
338 IF (iflag.LT.0 ) RETURN
339 IF (keep(214).EQ.2) THEN
341 & ptrist, ptrast, ptlust_s, ptrfac, iw, liw, a, la,
342 & lrlu, lrlus, iwpos, iwposcb, posfac,
comp,
343 & iptrlu, opeliw, step, pimaster, pamaster,
344 & iflag, ierror, slavef, procnode_steps, dad, myid, comm,
345 & keep, keep8, dkeep,type_son
346 & )
347 ENDIF
348 IF (iflag.LT.0) THEN
350 ENDIF
351 ENDIF
352 RETURN
subroutine cmumps_bdc_error(myid, slavef, comm, keep)
subroutine cmumps_compact_factors(a, lda, npiv, nbrow, keep, sizea, iw)
recursive subroutine cmumps_treat_descband(inode, comm_load, ass_irecv, bufr, lbufr, lbufr_bytes, procnode_steps, posfac, iwpos, iwposcb, iptrlu, lrlu, lrlus, n, iw, liw, a, la, ptrist, ptlust, ptrfac, ptrast, step, pimaster, pamaster, nstk_s, comp, iflag, ierror, comm, perm, ipool, lpool, leaf, nbfin, myid, slavef root, opassw, opeliw, itloc, rhs_mumps, fils, dad, ptrarw, ptraiw, intarr, dblarr, icntl, keep, keep8, dkeep, nd, frere, lptrar, nelt, frtptr, frtelt istep_to_iniv2, tab_pos_in_pere, stack_right_authorized, lrgroups)
recursive subroutine cmumps_try_recvtreat(comm_load, ass_irecv, blocking, set_irecv, message_received, msgsou, msgtag, status, bufr, lbufr, lbufr_bytes, procnode_steps, posfac, iwpos, iwposcb, iptrlu, lrlu, lrlus, n, iw, liw, a, la, ptrist, ptlust, ptrfac, ptrast, step, pimaster, pamaster, nstk_s, comp, iflag, ierror, comm, perm, ipool, lpool, leaf, nbfin, myid, slavef root, opassw, opeliw, itloc, rhs_mumps, fils, dad, ptrarw, ptraiw, intarr, dblarr, icntl, keep, keep8, dkeep, nd, frere, lptrar, nelt, frtptr, frtelt istep_to_iniv2, tab_pos_in_pere, stack_right_authorized, lrgroups)
recursive subroutine cmumps_build_and_send_cb_root(comm_load, ass_irecv, n, ison, iroot, ptri, ptrr, root, nbrow, nbcol, shift_list_row_son, shift_list_col_son, shift_val_son_arg, lda_arg, tag, myid, comm, bufr, lbufr, lbufr_bytes, procnode_steps, posfac, iwpos, iwposcb, iptrlu, lrlu, lrlus, iw, liw, a, la, ptrist, ptlust_s, ptrfac, ptrast, step, pimaster, pamaster, nstk, comp, iflag, ierror, perm, ipool, lpool, leaf, nbfin, slavef, opassw, opeliw, itloc, rhs_mumps, fils, dad, ptrarw, ptraiw, intarr, dblarr, icntl, keep, keep8, dkeep, transpose_asm, nd, frere, lptrar, nelt, frtptr, frtelt, istep_to_iniv2, tab_pos_in_pere, lrgroups)