117 & IWPOSCB,PTRIST,PTRAST,STEP,PIMASTER,PAMASTER,
118 & LRLUS,XSIZE, COMP, ACC_TIME, MYID,
119 & SLAVEF, PROCNODE_STEPS, DAD)
122 INTEGER,
INTENT(in) :: N, LIW, XSIZE
123 INTEGER,
INTENT(in) :: KEEP(500)
124 INTEGER(8),
INTENT(in) :: LA
125 INTEGER(8),
INTENT(inout):: LRLU, IPTRLU, LRLUS
126 INTEGER,
INTENT(inout) :: IWPOSCB
128 INTEGER(8),
INTENT(inout) :: PTRAST(KEEP(28)), PAMASTER(KEEP(28))
129 INTEGER,
INTENT(inout) :: IW(LIW),PTRIST(KEEP(28)),
131 INTEGER,
INTENT(in) :: STEP(N), SLAVEF
132 INTEGER,
INTENT(in) :: (KEEP(28)), DAD(KEEP(28))
133 COMPLEX(kind=8),
INTENT(inout) :: A(LA)
134 INTEGER,
INTENT(inout) :: COMP
135 DOUBLE PRECISION,
INTENT(inout) :: ACC_TIME
136 INTEGER,
INTENT(in) ::
137 include
'mumps_headers.h'
138 INTEGER ICURRENT, NEXT, STATE_NEXT
139 INTEGER(8) :: RCURRENT
141 INTEGER(8) :: RSIZE2SHIFT
143 INTEGER(8) :: RBEGCONTIG
144 INTEGER(8) :: RBEG2SHIFT, REND2SHIFT
146 LOGICAL :: IS_PAMASTER, IS_PTRAST
147 INTEGER(8) :: FREE_IN_REC
148 INTEGER(8) :: RCURRENT_SIZE, DYN_SIZE
149 LOGICAL :: RECORD_CAN_BE_COMPRESSED
152 INTEGER,
EXTERNAL :: MUMPS_PROCNODE
153 LOGICAL,
EXTERNAL :: ZMUMPS_ISBAND
155 DOUBLE PRECISION MPI_WTIME
156 DOUBLE PRECISION TIME_STRT, TIME_COMP
157 time_strt = mpi_wtime()
160 icurrent = liw-xsize+1
163 rbegcontig = -999999_8
164 next = iw(icurrent+xxp)
165 IF (next.EQ.top_of_stack)
GOTO 120
167 state_next = iw(next+xxs)
171 & record_can_be_compressed,
172 & iw(next), xsize, keep(216))
173 IF ( .NOT. record_can_be_compressed )
THEN
175 & ixxp, icurrent, next, rcurrent, isize2shift)
178 IF (ibegcontig < 0)
THEN
179 ibegcontig=icurrent+iw(icurrent+xxi)-1
181 IF (rbegcontig < 0_8)
THEN
182 rbegcontig=rcurrent+rcurrent_size-1_8
184 inode=iw(icurrent+xxn)
185 IF ( dyn_size .EQ. 0_8 )
THEN
186 IF (rsize2shift .NE. 0_8)
THEN
188 & keep(28), keep(199),
189 & inode, iw(icurrent+xxs),
190 & iw(icurrent+xxd:icurrent+xxd+1), step,
191 & dad, procnode_steps, rcurrent, pamaster, ptrast,
192 & is_pamaster, is_ptrast )
195 & ptrast(step(inode))+rsize2shift
196 ELSE IF (is_pamaster)
THEN
197 pamaster(step(inode))=
198 & pamaster(step(inode))+rsize2shift
202 IF (isize2shift .NE. 0)
THEN
203 IF (ptrist(step(inode)).EQ.icurrent)
204 & ptrist(step(inode))=
205 & ptrist(step(inode))+isize2shift
206 IF (pimaster(step(inode)).EQ.icurrent)
207 & pimaster(step(inode))=
208 & pimaster(step(inode))+isize2shift
210 IF (next .NE. top_of_stack)
THEN
211 state_next=iw(next+xxs)
216 IF (ibegcontig.NE.0 .AND. isize2shift .NE. 0)
THEN
218 IF (ixxp .LE.ibegcontig)
THEN
219 ixxp=ixxp+isize2shift
224 IF (rbegcontig .GT.0_8 .AND. rsize2shift .NE. 0_8)
THEN
229 IF (next.EQ. top_of_stack)
GOTO 100
231 & record_can_be_compressed, iw(next), xsize, keep(216))
232 IF ( state_next .NE. s_free .AND.
233 & record_can_be_compressed )
THEN
234 IF (rbegcontig > 0_8)
GOTO 25
236 & (iw,liw,ixxp,icurrent,next, rcurrent,isize2shift)
237 IF (ibegcontig < 0 )
THEN
238 ibegcontig=icurrent+iw(icurrent+xxi)-1
245 IF (dyn_size .GT. 0_8)
THEN
246 ELSE IF (state_next .EQ. s_nolcbnocontig)
THEN
248 & iw(icurrent+xsize+2),
249 & iw(icurrent+xsize),
250 & iw(icurrent+xsize)+iw(icurrent+xsize+3), 0,
251 & iw(icurrent+xxs),rsize2shift)
252 iw(icurrent+xxs) = s_nolcleaned
253 ELSE IF (state_next .EQ. s_nolcbnocontig38)
THEN
255 & iw(icurrent+xsize+2),
256 & iw(icurrent+xsize),
257 & iw(icurrent+xsize)+iw(icurrent+xsize+3),
258 & iw(icurrent+xsize+4)-iw(icurrent+xsize+3),
259 & iw(icurrent+xxs),rsize2shift)
260 iw(icurrent+xxs) = s_nolcleaned38
261 ELSE IF (state_next.EQ.s_nolnocb)
THEN
262 iw(icurrent+xxs) = s_nolnocbcleaned
263 ELSE IF (state_next .EQ. s_nolcbcontig .OR.
264 & state_next .EQ. s_nolcbcontig38)
THEN
265 IF (state_next .EQ. s_nolcbcontig)
THEN
266 iw(icurrent+xxs) = s_nolcleaned
267 ELSE IF (state_next .EQ. s_nolcbcontig38)
THEN
268 iw(icurrent+xxs) = s_nolcleaned38
270 IF (rsize2shift .GT.0_8)
THEN
271 rbeg2shift = rcurrent + free_in_rec
273 rend2shift = rcurrent + rcurrent_size - 1_8
275 & rbeg2shift, rend2shift,
279 WRITE(*,*)
"Internal error 3 in ZMUMPS_COMPRE_NEW",
280 & state_next, dyn_size, free_in_rec
283 inode = iw(icurrent+xxn)
284 IF ( dyn_size .GT. 0_8 )
THEN
285 IF (ptrist(step(inode)).EQ.icurrent)
286 & ptrist(step(inode))=
287 & ptrist(step(inode))+isize2shift
288 IF (pimaster(step(inode)).EQ.icurrent)
289 & pimaster(step(inode))=
290 & pimaster(step(inode))+isize2shift
291 ELSE IF (state_next .EQ. s_nolcbcontig .OR.
292 & state_next .EQ. s_nolcbnocontig .OR.
293 & state_next .EQ. s_nolcbcontig38 .OR.
294 & state_next .EQ. s_nolcbnocontig38 .OR.
295 & state_next .EQ. s_nolnocb )
THEN
296 IF (isize2shift.NE.0)
THEN
297 ptrist(step(inode))=ptrist(step(inode))+isize2shift
299 ptrast(step(inode))=ptrast(step(inode))+rsize2shift+
302 WRITE(*,*)
"Internal error 4 in ZMUMPS_COMPRE_NEW",
307 rsize2shift=rsize2shift+free_in_rec
309 IF (next.EQ.top_of_stack)
THEN
312 state_next=iw(next+xxs)
316 IF (ibegcontig.GT.0)
THEN
320 IF (state_next == s_free)
THEN
322 CALL mumps_geti8( rcurrent_size, iw(icurrent + xxr) )
323 isize2shift = isize2shift + iw(icurrent+xxi)
324 rsize2shift = rsize2shift + rcurrent_size
325 rcurrent = rcurrent - rcurrent_size
326 next=iw(icurrent+xxp)
327 IF (next.EQ.top_of_stack)
THEN
328 WRITE(*,*)
"Internal error 1 in ZMUMPS_COMPRE_NEW"
331 state_next = iw(next+xxs)
336 iwposcb = iwposcb + isize2shift
337 lrlu = lrlu + rsize2shift
338 iptrlu = iptrlu + rsize2shift
340 time_comp = mpi_wtime() - time_strt
341 acc_time = acc_time + time_comp
428 & SIZEI_NEEDED, SIZER_NEEDED, SKIP_TOP_STACK,
432 & IWPOSCB,PTRIST,PTRAST,STEP,PIMASTER,PAMASTER,
433 & LRLUS,XSIZE, COMP, ACC_TIME, MYID,
434 & SLAVEF, PROCNODE_STEPS, DAD,
437#if ! defined(NODYNAMICCB)
441 INTEGER,
INTENT(in) :: SIZEI_NEEDED
442 INTEGER(8),
INTENT(in) :: SIZER_NEEDED
443 LOGICAL,
INTENT(in) :: SKIP_TOP_STACK
444 INTEGER,
INTENT(in) :: KEEP(500)
445 INTEGER(8),
INTENT(inout):: KEEP8(150)
446 INTEGER,
INTENT(in) :: N, LIW, XSIZE
447 INTEGER(8),
INTENT(in) :: LA
448 INTEGER(8),
INTENT(inout):: LRLU, IPTRLU, LRLUS
449 INTEGER,
INTENT(inout) :: IWPOSCB
450 INTEGER,
INTENT(inout) :: IWPOS
451 INTEGER(8),
INTENT(inout) :: PTRAST(KEEP(28)), PAMASTER(KEEP(28))
452 INTEGER,
INTENT(inout) :: IW(),PTRIST(KEEP(28)),
454 INTEGER,
INTENT(in) :: (N), SLAVEF
455 INTEGER,
INTENT(in) :: PROCNODE_STEPS(KEEP(28)), DAD(KEEP(28))
456 COMPLEX(kind=8),
INTENT(inout) :: A(LA)
457 INTEGER,
INTENT(inout) :: COMP
458 DOUBLE PRECISION,
INTENT(inout) :: ACC_TIME
459 INTEGER,
INTENT(iN) :: MYID
460 INTEGER,
INTENT(inout) :: IFLAG, IERROR
461 LOGICAL ZMUMPS_COMPRE_NEW_CALLED
462 zmumps_compre_new_called = .false.
463 IF (iwposcb-iwpos+1 .LT. sizei_needed)
THEN
466 & iwposcb,ptrist,ptrast,step,pimaster,pamaster,
467 & lrlus,xsize, comp, acc_time, myid,
468 & slavef, procnode_steps, dad)
469 IF ( lrlu .NE. lrlus )
THEN
470 WRITE(*,*)
'Internal error 1 in ZMUMPS_GET_SIZE_NEEDED ',
471 &
'PB compress... ZMUMPS_ALLOC_CB ',
472 &
'LRLU,LRLUS=',lrlu,lrlus
476 zmumps_compre_new_called = .true.
477 IF (iwposcb-iwpos+1 .LT. sizei_needed)
THEN
479 ierror = sizei_needed
483 IF ( .NOT.zmumps_compre_new_called.AND.
484 & (lrlu.LT.sizer_needed).AND.
485 & (lrlus.GE.sizer_needed).AND.
490 & iwposcb,ptrist,ptrast,step,pimaster,pamaster,
491 & lrlus,xsize, comp, acc_time, myid,
492 & slavef, procnode_steps, dad)
493 zmumps_compre_new_called = .true.
494 IF ( lrlu .NE. lrlus )
THEN
495 WRITE(*,*)
'Internal error 2 ',
496 &
'in ZMUMPS_GET_SIZE_NEEDED ',
497 &
'PB compress... ZMUMPS_ALLOC_CB ',
498 &
'LRLU,LRLUS=',lrlu,lrlus
503 IF (lrlus.LT.sizer_needed)
THEN
504#if ! defined(NODYNAMICCB)
505 IF (.NOT. zmumps_compre_new_called)
THEN
508 & iwposcb,ptrist,ptrast,step,pimaster,pamaster,
509 & lrlus,xsize, comp, acc_time, myid,
510 & slavef, procnode_steps, dad)
511 IF ( lrlu .NE. lrlus )
THEN
512 WRITE(*,*)
'Internal error 2 ',
513 &
'in ZMUMPS_GET_SIZE_NEEDED ',
514 &
'PB compress... ZMUMPS_ALLOC_CB ',
515 &
'LRLU,LRLUS=',lrlu,lrlus
521 & sizer_needed, skip_top_stack,
524 & iw, liw, iwposcb, iwpos,
526 & step, ptrast, pamaster,
527 & procnode_steps, dad, iflag, ierror)
528 IF (iflag.LT.0)
GOTO 500
529 IF (lrlu.LT.sizer_needed)
THEN
532 & iwposcb,ptrist,ptrast,step,pimaster,pamaster,
533 & lrlus,xsize, comp, acc_time, myid,
534 & slavef, procnode_steps, dad)
535 IF ( lrlu .NE. lrlus )
THEN
536 WRITE(*,*)
'Internal error 4 ',
537 &
'in ZMUMPS_GET_SIZE_NEEDED ',
538 &
'PB compress... ZMUMPS_ALLOC_CB ',
539 &
'LRLU,LRLUS=',lrlu,lrlus
subroutine zmumps_get_size_needed(sizei_needed, sizer_needed, skip_top_stack, keep, keep8, n, iw, liw, a, la, lrlu, iptrlu, iwpos, iwposcb, ptrist, ptrast, step, pimaster, pamaster, lrlus, xsize, comp, acc_time, myid, slavef, procnode_steps, dad, iflag, ierror)