-
Notifications
You must be signed in to change notification settings - Fork 4
/
dmumps_load.F
5744 lines (5744 loc) · 214 KB
/
dmumps_load.F
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
C
C This file is part of MUMPS 5.1.1, released
C on Mon Mar 20 14:34:33 UTC 2017
C
C
C Copyright 1991-2017 CERFACS, CNRS, ENS Lyon, INP Toulouse, Inria,
C University of Bordeaux.
C
C This version of MUMPS is provided to you free of charge. It is
C released under the CeCILL-C license:
C http://www.cecill.info/licences/Licence_CeCILL-C_V1-en.html
C
MODULE DMUMPS_LOAD
implicit none
PUBLIC :: DMUMPS_LOAD_SET_INICOST, DMUMPS_LOAD_INIT,
& DMUMPS_LOAD_SET_SLAVES, DMUMPS_LOAD_UPDATE,
& DMUMPS_LOAD_END, DMUMPS_LOAD_PROCESS_MESSAGE,
& DMUMPS_LOAD_LESS, DMUMPS_LOAD_LESS_CAND,
& DMUMPS_LOAD_SET_SLAVES_CAND, DMUMPS_LOAD_MASTER_2_ALL,
& DMUMPS_LOAD_RECV_MSGS, DMUMPS_LOAD_MEM_UPDATE,
& DMUMPS_LOAD_SET_PARTITION,
& DMUMPS_SPLIT_PREP_PARTITION, DMUMPS_SPLIT_POST_PARTITION,
& DMUMPS_SPLIT_PROPAGATE_PARTI, DMUMPS_LOAD_POOL_UPD_NEW_POOL,
& DMUMPS_LOAD_SBTR_UPD_NEW_POOL, DMUMPS_LOAD_POOL_CHECK_MEM,
& DMUMPS_LOAD_SET_SBTR_MEM,
& DMUMPS_REMOVE_NODE, DMUMPS_UPPER_PREDICT
& ,DMUMPS_LOAD_SEND_MD_INFO,
& DMUMPS_LOAD_CLEAN_MEMINFO_POOL, DMUMPS_LOAD_COMP_MAXMEM_POOL,
& DMUMPS_LOAD_CHK_MEMCST_POOL, DMUMPS_CHECK_SBTR_COST,
& DMUMPS_FIND_BEST_NODE_FOR_MEM,
& DMUMPS_LOAD_INIT_SBTR_STRUCT
DOUBLE PRECISION, DIMENSION(:),
& ALLOCATABLE, SAVE, PRIVATE :: LOAD_FLOPS
INTEGER, DIMENSION(:), ALLOCATABLE, SAVE, PRIVATE :: BUF_LOAD_RECV
INTEGER, SAVE, PRIVATE :: LBUF_LOAD_RECV, LBUF_LOAD_RECV_BYTES
INTEGER, SAVE, PRIVATE :: K50, K69, K35
INTEGER(8), SAVE, PRIVATE :: MAX_SURF_MASTER
LOGICAL, SAVE, PRIVATE :: BDC_MEM, BDC_POOL, BDC_SBTR,
& BDC_POOL_MNG,
& BDC_M2_MEM,BDC_M2_FLOPS,BDC_MD,REMOVE_NODE_FLAG,
& REMOVE_NODE_FLAG_MEM
DOUBLE PRECISION, SAVE, PRIVATE :: REMOVE_NODE_COST,
& REMOVE_NODE_COST_MEM
INTEGER, SAVE, PRIVATE :: SBTR_WHICH_M
DOUBLE PRECISION, DIMENSION(:),
& ALLOCATABLE, TARGET, SAVE, PRIVATE :: WLOAD
#if defined(OLD_LOAD_MECHANISM)
#if defined(CHECK_COHERENCE)
INTEGER, SAVE, PRIVATE :: NB_LEVEL2
LOGICAL, PRIVATE :: AMI_CHOSEN,IS_DISPLAYED
#endif
#endif
#if ! defined(OLD_LOAD_MECHANISM)
DOUBLE PRECISION, SAVE, PRIVATE :: DELTA_LOAD, DELTA_MEM
#else
DOUBLE PRECISION, SAVE, PRIVATE :: LAST_LOAD_SENT,
& DM_LAST_MEM_SENT
#endif
LOGICAL, SAVE, PRIVATE :: IS_MUMPS_LOAD_ENABLED
PUBLIC:: MUMPS_LOAD_ENABLE, MUMPS_LOAD_DISABLE
INTEGER(8), SAVE, PRIVATE :: CHECK_MEM
INTEGER, DIMENSION(:), ALLOCATABLE, SAVE, TARGET, PRIVATE ::
& IDWLOAD
DOUBLE PRECISION, SAVE, PRIVATE :: COST_SUBTREE
DOUBLE PRECISION, SAVE, PRIVATE :: ALPHA
DOUBLE PRECISION, SAVE, PRIVATE :: BETA
INTEGER, SAVE, PRIVATE :: MYID, NPROCS, COMM_LD
DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE, SAVE,
& PRIVATE :: POOL_MEM
DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE, PRIVATE,
& SAVE :: SBTR_MEM
DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE,
& PRIVATE, SAVE :: SBTR_CUR
INTEGER, DIMENSION(:), ALLOCATABLE,
& PRIVATE, SAVE :: NB_SON
DOUBLE PRECISION,
& PRIVATE, SAVE :: SBTR_CUR_LOCAL
DOUBLE PRECISION,
& PRIVATE, SAVE :: PEAK_SBTR_CUR_LOCAL
DOUBLE PRECISION,
& PRIVATE, SAVE :: MAX_PEAK_STK
DOUBLE PRECISION, SAVE,
& PRIVATE :: POOL_LAST_COST_SENT
DOUBLE PRECISION, SAVE,
& PRIVATE :: MIN_DIFF
INTEGER, SAVE :: POS_ID,POS_MEM
INTEGER, DIMENSION(:), ALLOCATABLE, SAVE :: CB_COST_ID
INTEGER(8), DIMENSION(:), ALLOCATABLE, SAVE
& :: CB_COST_MEM
PUBLIC :: CB_COST_ID, CB_COST_MEM,POS_MEM,POS_ID
DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE :: LU_USAGE
INTEGER(8), DIMENSION(:), ALLOCATABLE, SAVE,
& PRIVATE::MD_MEM, TAB_MAXS
DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE, SAVE ::MEM_SUBTREE
INTEGER :: NB_SUBTREES,NIV1_FLAG
INTEGER, PRIVATE :: INDICE_SBTR,INDICE_SBTR_ARRAY
INTEGER :: POOL_NIV2_SIZE
INTEGER,SAVE :: INSIDE_SUBTREE
PUBLIC :: NB_SUBTREES,MEM_SUBTREE,INSIDE_SUBTREE,NIV1_FLAG
DOUBLE PRECISION, SAVE, PRIVATE :: DM_SUMLU,
& DM_THRES_MEM
DOUBLE PRECISION, DIMENSION(:),
& ALLOCATABLE, SAVE , PRIVATE:: DM_MEM
INTEGER, SAVE, PRIVATE :: POOL_SIZE,ID_MAX_M2
DOUBLE PRECISION, SAVE, PRIVATE :: MAX_M2,TMP_M2
INTEGER, DIMENSION(:),ALLOCATABLE,SAVE, PRIVATE:: POOL_NIV2
DOUBLE PRECISION, DIMENSION(:),ALLOCATABLE,SAVE,
& PRIVATE :: POOL_NIV2_COST, NIV2
DOUBLE PRECISION, SAVE, PRIVATE :: CHK_LD
INTEGER, DIMENSION(:),POINTER, SAVE, PRIVATE ::
& PROCNODE_LOAD, STEP_TO_NIV2_LOAD
INTEGER, DIMENSION(:),POINTER, SAVE, PRIVATE :: KEEP_LOAD
INTEGER, SAVE, PRIVATE :: N_LOAD
INTEGER(8), DIMENSION(:), POINTER, SAVE, PRIVATE:: KEEP8_LOAD
INTEGER, DIMENSION(:),POINTER, SAVE ::
& FILS_LOAD, STEP_LOAD,
& FRERE_LOAD, ND_LOAD,
& NE_LOAD,DAD_LOAD
INTEGER, DIMENSION(:,:),POINTER, SAVE, PRIVATE :: CAND_LOAD
INTEGER, DIMENSION(:),POINTER, SAVE,
& PRIVATE :: MY_FIRST_LEAF,MY_NB_LEAF, MY_ROOT_SBTR
INTEGER, DIMENSION(:),ALLOCATABLE,SAVE,
& PRIVATE ::SBTR_FIRST_POS_IN_POOL
DOUBLE PRECISION, DIMENSION(:),ALLOCATABLE,SAVE,
& PRIVATE ::SBTR_PEAK_ARRAY,
& SBTR_CUR_ARRAY
DOUBLE PRECISION,DIMENSION(:),POINTER, SAVE :: COST_TRAV
INTEGER, DIMENSION(:),POINTER, SAVE :: DEPTH_FIRST_LOAD,
& DEPTH_FIRST_SEQ_LOAD,SBTR_ID_LOAD
PUBLIC :: DEPTH_FIRST_LOAD,COST_TRAV, FILS_LOAD,STEP_LOAD,
& FRERE_LOAD, ND_LOAD,NE_LOAD,DAD_LOAD,
& DEPTH_FIRST_SEQ_LOAD,SBTR_ID_LOAD
INTEGER, SAVE :: ROOT_CURRENT_SUBTREE,CURRENT_BEST,
& SECOND_CURRENT_BEST
PUBLIC :: ROOT_CURRENT_SUBTREE,CURRENT_BEST,
& SECOND_CURRENT_BEST
CONTAINS
SUBROUTINE MUMPS_LOAD_ENABLE()
IMPLICIT NONE
IS_MUMPS_LOAD_ENABLED = .TRUE.
RETURN
END SUBROUTINE MUMPS_LOAD_ENABLE
SUBROUTINE MUMPS_LOAD_DISABLE()
IMPLICIT NONE
IS_MUMPS_LOAD_ENABLED = .FALSE.
RETURN
END SUBROUTINE MUMPS_LOAD_DISABLE
SUBROUTINE DMUMPS_LOAD_SET_INICOST( COST_SUBTREE_ARG, K64, K66,
& K375, MAXS )
IMPLICIT NONE
DOUBLE PRECISION COST_SUBTREE_ARG
INTEGER, INTENT(IN) :: K64, K66, K375
INTEGER(8)::MAXS
DOUBLE PRECISION :: T64, T66
LOGICAL :: AVOID_LOAD_MESSAGES
T64 = max ( dble(K64), dble(1) )
T64 = min ( T64, dble(1000) )
T66 = max (dble(K66), dble(100))
MIN_DIFF = ( T64 / dble(1000) )*
& T66 * dble(1000000)
DM_THRES_MEM = dble(MAXS/300_8)
COST_SUBTREE = COST_SUBTREE_ARG
AVOID_LOAD_MESSAGES = .FALSE.
IF (AVOID_LOAD_MESSAGES) THEN
MIN_DIFF = MIN_DIFF * 1000.D0
DM_THRES_MEM = DM_THRES_MEM * 1000_8
ENDIF
RETURN
END SUBROUTINE DMUMPS_LOAD_SET_INICOST
SUBROUTINE DMUMPS_SPLIT_PREP_PARTITION (
& INODE, STEP, N, SLAVEF,
& PROCNODE_STEPS, KEEP, DAD, FILS,
& CAND, ICNTL, COPY_CAND,
& NBSPLIT, NUMORG_SPLIT, SLAVES_LIST,
& SIZE_SLAVES_LIST
& )
IMPLICIT NONE
INTEGER, intent(in) :: INODE, N, SIZE_SLAVES_LIST, SLAVEF,
& KEEP(500)
INTEGER, intent(in) :: STEP(N), DAD (KEEP(28)), ICNTL(40),
& PROCNODE_STEPS(KEEP(28)), CAND(SLAVEF+1),
& FILS(N)
INTEGER, intent(out) :: NBSPLIT, NUMORG_SPLIT
INTEGER, intent(inout) :: SLAVES_LIST(SIZE_SLAVES_LIST),
& COPY_CAND(SLAVEF+1)
INTEGER :: IN, LP, II
INTEGER MUMPS_TYPESPLIT
EXTERNAL MUMPS_TYPESPLIT
LP = ICNTL(1)
IN = INODE
NBSPLIT = 0
NUMORG_SPLIT = 0
DO WHILE
& (
& ( MUMPS_TYPESPLIT
& (PROCNODE_STEPS(STEP(DAD(STEP(IN)))),SLAVEF)
& .EQ.5
& )
& .OR.
& ( MUMPS_TYPESPLIT
& (PROCNODE_STEPS(STEP(DAD(STEP(IN)))),SLAVEF)
& .EQ.6
& )
& )
NBSPLIT = NBSPLIT + 1
IN = DAD(STEP(IN))
II = IN
DO WHILE (II.GT.0)
NUMORG_SPLIT = NUMORG_SPLIT + 1
II = FILS(II)
ENDDO
END DO
SLAVES_LIST(1:NBSPLIT) = CAND(1:NBSPLIT)
COPY_CAND(1:SIZE_SLAVES_LIST-NBSPLIT) =
& CAND(1+NBSPLIT:SIZE_SLAVES_LIST)
COPY_CAND(SIZE_SLAVES_LIST-NBSPLIT+1:SLAVEF) = -1
COPY_CAND(SLAVEF+1) = SIZE_SLAVES_LIST-NBSPLIT
RETURN
END SUBROUTINE DMUMPS_SPLIT_PREP_PARTITION
SUBROUTINE DMUMPS_SPLIT_POST_PARTITION (
& INODE, STEP, N, SLAVEF, NBSPLIT, NCB,
& PROCNODE_STEPS, KEEP, DAD, FILS, ICNTL,
& TAB_POS, NSLAVES_NODE
& )
IMPLICIT NONE
INTEGER, intent(in) :: INODE, N, SLAVEF, NCB,
& KEEP(500), NBSPLIT
INTEGER, intent(in) :: STEP(N), DAD (KEEP(28)), ICNTL(40),
& PROCNODE_STEPS(KEEP(28)),
& FILS(N)
INTEGER, intent(inout) :: TAB_POS ( SLAVEF+2 ), NSLAVES_NODE
INTEGER :: IN, LP, II, NUMORG, NBSPLIT_LOC, I
INTEGER MUMPS_TYPESPLIT
EXTERNAL MUMPS_TYPESPLIT
DO I= NSLAVES_NODE+1, 1, -1
TAB_POS(I+NBSPLIT) = TAB_POS(I)
END DO
LP = ICNTL(1)
IN = INODE
NBSPLIT_LOC = 0
NUMORG = 0
TAB_POS(1) = 1
DO WHILE
& (
& ( MUMPS_TYPESPLIT
& (PROCNODE_STEPS(STEP(DAD(STEP(IN)))),SLAVEF)
& .EQ.5
& )
& .OR.
& ( MUMPS_TYPESPLIT
& (PROCNODE_STEPS(STEP(DAD(STEP(IN)))),SLAVEF)
& .EQ.6
& )
& )
NBSPLIT_LOC = NBSPLIT_LOC + 1
IN = DAD(STEP(IN))
II = IN
DO WHILE (II.GT.0)
NUMORG = NUMORG + 1
II = FILS(II)
ENDDO
TAB_POS(NBSPLIT_LOC+1) = NUMORG + 1
END DO
DO I = NBSPLIT+2, NBSPLIT+NSLAVES_NODE+1
TAB_POS(I) = TAB_POS(I) + NUMORG
ENDDO
NSLAVES_NODE = NSLAVES_NODE + NBSPLIT
TAB_POS (NSLAVES_NODE+2:SLAVEF+1) = -9999
TAB_POS ( SLAVEF+2 ) = NSLAVES_NODE
RETURN
END SUBROUTINE DMUMPS_SPLIT_POST_PARTITION
SUBROUTINE DMUMPS_SPLIT_PROPAGATE_PARTI (
& INODE, TYPESPLIT, IFSON,
& CAND, SIZE_CAND,
& SON_SLAVE_LIST, NSLSON,
& STEP, N, SLAVEF,
& PROCNODE_STEPS, KEEP, DAD, FILS, ICNTL,
& ISTEP_TO_INIV2, INIV2,
& TAB_POS_IN_PERE, NSLAVES_NODE,
& SLAVES_LIST, SIZE_SLAVES_LIST
& )
IMPLICIT NONE
INTEGER, intent(in) :: INODE, TYPESPLIT, IFSON, N, SLAVEF,
& KEEP(500),
& NSLSON, SIZE_SLAVES_LIST, SIZE_CAND
INTEGER, intent(in) :: STEP(N), DAD (KEEP(28)), ICNTL(40),
& PROCNODE_STEPS(KEEP(28)),
& FILS(N), INIV2,
& SON_SLAVE_LIST (NSLSON),
& ISTEP_TO_INIV2(KEEP(71)),
& CAND(SIZE_CAND)
INTEGER, intent(out) :: NSLAVES_NODE
INTEGER, intent(inout) ::
& TAB_POS_IN_PERE(SLAVEF+2,max(1,KEEP(56)))
INTEGER, intent(out) :: SLAVES_LIST (SIZE_SLAVES_LIST)
INTEGER :: IN, LP, I, NSLAVES_SONS,
& INIV2_FILS, ISHIFT
LP = ICNTL(1)
IN = INODE
INIV2_FILS = ISTEP_TO_INIV2( STEP( IFSON ))
NSLAVES_SONS = TAB_POS_IN_PERE (SLAVEF+2, INIV2_FILS)
TAB_POS_IN_PERE (1,INIV2) = 1
ISHIFT = TAB_POS_IN_PERE (2, INIV2_FILS) -1
DO I = 2, NSLAVES_SONS
TAB_POS_IN_PERE (I,INIV2) =
& TAB_POS_IN_PERE (I+1,INIV2_FILS) - ISHIFT
SLAVES_LIST(I-1) = SON_SLAVE_LIST (I)
END DO
TAB_POS_IN_PERE(NSLAVES_SONS+1:SLAVEF+1,INIV2) = -9999
NSLAVES_NODE = NSLAVES_SONS - 1
TAB_POS_IN_PERE (SLAVEF+2, INIV2) = NSLAVES_NODE
RETURN
END SUBROUTINE DMUMPS_SPLIT_PROPAGATE_PARTI
SUBROUTINE DMUMPS_LOAD_SET_PARTITION(
& NCBSON_MAX, SLAVEF,
& KEEP,KEEP8,ICNTL,
& CAND_OF_NODE,
& MEM_DISTRIB, NCB, NFRONT, NSLAVES_NODE,
& TAB_POS, SLAVES_LIST, SIZE_SLAVES_LIST,INODE)
IMPLICIT NONE
INTEGER, intent(in) :: KEEP(500),SIZE_SLAVES_LIST
INTEGER(8) KEEP8(150)
INTEGER, intent(in) :: ICNTL(40)
INTEGER, intent(in) :: SLAVEF, NFRONT
INTEGER, intent (inout) ::NCB
INTEGER, intent(in) :: CAND_OF_NODE(SLAVEF+1)
INTEGER, intent(in) :: MEM_DISTRIB(0:SLAVEF-1),INODE
INTEGER, intent(in) :: NCBSON_MAX
INTEGER, intent(out):: SLAVES_LIST(SIZE_SLAVES_LIST)
INTEGER, intent(out):: TAB_POS(SLAVEF+2)
INTEGER, intent(out):: NSLAVES_NODE
INTEGER i
INTEGER LP,MP
LP=ICNTL(4)
MP=ICNTL(2)
IF ( KEEP(48) == 0 .OR. KEEP(48) .EQ. 3 ) THEN
CALL DMUMPS_LOAD_PARTI_REGULAR(
& SLAVEF,
& KEEP,KEEP8,
& CAND_OF_NODE,
& MEM_DISTRIB, NCB, NFRONT, NSLAVES_NODE,
& TAB_POS, SLAVES_LIST, SIZE_SLAVES_LIST)
ELSE IF ( KEEP(48) == 4 ) THEN
CALL DMUMPS_SET_PARTI_ACTV_MEM(
& SLAVEF,
& KEEP,KEEP8,
& CAND_OF_NODE,
& MEM_DISTRIB, NCB, NFRONT, NSLAVES_NODE,
& TAB_POS, SLAVES_LIST, SIZE_SLAVES_LIST,MYID)
DO i=1,NSLAVES_NODE
IF(TAB_POS(i+1)-TAB_POS(i).LE.0)THEN
WRITE(*,*)'probleme de partition dans
&DMUMPS_LOAD_SET_PARTI_ACTV_MEM'
CALL MUMPS_ABORT()
ENDIF
ENDDO
ELSE IF ( KEEP(48) == 5 ) THEN
CALL DMUMPS_SET_PARTI_FLOP_IRR(
& NCBSON_MAX,
& SLAVEF,
& KEEP,KEEP8,
& CAND_OF_NODE,
& MEM_DISTRIB, NCB, NFRONT, NSLAVES_NODE,
& TAB_POS, SLAVES_LIST, SIZE_SLAVES_LIST,MYID,INODE,
& MP,LP)
DO i=1,NSLAVES_NODE
IF(TAB_POS(i+1)-TAB_POS(i).LE.0)THEN
WRITE(*,*)'problem with partition in
&DMUMPS_SET_PARTI_FLOP_IRR'
CALL MUMPS_ABORT()
ENDIF
ENDDO
GOTO 457
ELSE
WRITE(*,*) "Strategy 6 not implemented"
CALL MUMPS_ABORT()
ENDIF
457 CONTINUE
RETURN
END SUBROUTINE DMUMPS_LOAD_SET_PARTITION
SUBROUTINE DMUMPS_LOAD_PARTI_REGULAR(
& SLAVEF,
& KEEP,KEEP8,
& CAND_OF_NODE,
& MEM_DISTRIB, NCB, NFRONT, NSLAVES_NODE,
& TAB_POS, SLAVES_LIST, SIZE_SLAVES_LIST)
IMPLICIT NONE
INTEGER, intent(in) :: KEEP(500),SIZE_SLAVES_LIST
INTEGER(8) KEEP8(150)
INTEGER, intent(in) :: SLAVEF, NFRONT, NCB
INTEGER, intent(in) :: CAND_OF_NODE(SLAVEF+1)
INTEGER, intent(in) :: MEM_DISTRIB(0:SLAVEF-1)
INTEGER, intent(out):: SLAVES_LIST(SIZE_SLAVES_LIST)
INTEGER, intent(out):: TAB_POS(SLAVEF+2)
INTEGER, intent(out):: NSLAVES_NODE
INTEGER ITEMP, NMB_OF_CAND, NSLAVES_LESS
DOUBLE PRECISION MSG_SIZE
LOGICAL FORCE_CAND
INTEGER MUMPS_REG_GET_NSLAVES
EXTERNAL MUMPS_REG_GET_NSLAVES
IF ( KEEP(48) == 0 .AND. KEEP(50) .NE. 0) THEN
write(*,*) "Internal error 2 in DMUMPS_LOAD_PARTI_REGULAR."
CALL MUMPS_ABORT()
END IF
IF ( KEEP(48) == 3 .AND. KEEP(50) .EQ. 0) THEN
write(*,*) "Internal error 3 in DMUMPS_LOAD_PARTI_REGULAR."
CALL MUMPS_ABORT()
END IF
MSG_SIZE = dble( NFRONT - NCB ) * dble(NCB)
IF ( KEEP(24) == 0 .OR. KEEP(24) == 1 ) THEN
FORCE_CAND = .FALSE.
ELSE
FORCE_CAND = (mod(KEEP(24),2).eq.0)
END IF
IF (FORCE_CAND) THEN
ITEMP=DMUMPS_LOAD_LESS_CAND
& (MEM_DISTRIB,
& CAND_OF_NODE,
&
& KEEP(69), SLAVEF, MSG_SIZE,
& NMB_OF_CAND )
ELSE
ITEMP=DMUMPS_LOAD_LESS(KEEP(69),MEM_DISTRIB,MSG_SIZE)
NMB_OF_CAND = SLAVEF - 1
END IF
NSLAVES_LESS = max(ITEMP,1)
NSLAVES_NODE = MUMPS_REG_GET_NSLAVES(KEEP8(21), KEEP(48),
& KEEP(50),SLAVEF,
& NCB, NFRONT, NSLAVES_LESS, NMB_OF_CAND,
& KEEP(375))
CALL MUMPS_BLOC2_SETPARTITION(
& KEEP,KEEP8, SLAVEF,
& TAB_POS,
& NSLAVES_NODE, NFRONT, NCB
& )
IF (FORCE_CAND) THEN
CALL DMUMPS_LOAD_SET_SLAVES_CAND(MEM_DISTRIB(0),
& CAND_OF_NODE, SLAVEF, NSLAVES_NODE,
& SLAVES_LIST)
ELSE
CALL DMUMPS_LOAD_SET_SLAVES(MEM_DISTRIB(0),
& MSG_SIZE, SLAVES_LIST, NSLAVES_NODE)
ENDIF
RETURN
END SUBROUTINE DMUMPS_LOAD_PARTI_REGULAR
SUBROUTINE DMUMPS_LOAD_INIT( id, MEMORY_MD_ARG, MAXS )
USE DMUMPS_BUF
USE DMUMPS_STRUC_DEF
#if ! defined(OLD_LOAD_MECHANISM)
USE MUMPS_FUTURE_NIV2
#endif
IMPLICIT NONE
TYPE(DMUMPS_STRUC), TARGET :: id
INTEGER(8), intent(in) :: MEMORY_MD_ARG
INTEGER(8), intent(in) :: MAXS
INTEGER K34_LOC,K35_LOC
INTEGER allocok, IERR, i, BUF_LOAD_SIZE
DOUBLE PRECISION :: MAX_SBTR
DOUBLE PRECISION ZERO
DOUBLE PRECISION MEMORY_SENT
PARAMETER( ZERO=0.0d0 )
DOUBLE PRECISION SIZE_REAL(2)
INTEGER WHAT
INTEGER(8) MEMORY_MD, LA
CALL MUMPS_LOAD_ENABLE()
STEP_TO_NIV2_LOAD=>id%ISTEP_TO_INIV2
CAND_LOAD=>id%CANDIDATES
ND_LOAD=>id%ND_STEPS
KEEP_LOAD=>id%KEEP
KEEP8_LOAD=>id%KEEP8
FILS_LOAD=>id%FILS
FRERE_LOAD=>id%FRERE_STEPS
DAD_LOAD=>id%DAD_STEPS
PROCNODE_LOAD=>id%PROCNODE_STEPS
STEP_LOAD=>id%STEP
NE_LOAD=>id%NE_STEPS
N_LOAD=id%N
ROOT_CURRENT_SUBTREE=-9999
MEMORY_MD=MEMORY_MD_ARG
LA=MAXS
MAX_SURF_MASTER=id%MAX_SURF_MASTER+
& (int(id%KEEP(12),8)*int(id%MAX_SURF_MASTER,8)/int(100,8))
COMM_LD = id%COMM_LOAD
MAX_PEAK_STK = 0.0D0
K69 = id%KEEP(69)
IF ( id%KEEP(47) .le. 0 .OR. id%KEEP(47) .gt. 4 ) THEN
write(*,*) "Internal error 1 in DMUMPS_LOAD_INIT"
CALL MUMPS_ABORT()
END IF
CHK_LD=dble(0)
BDC_MEM = ( id%KEEP(47) >= 2 )
BDC_POOL = ( id%KEEP(47) >= 3 )
BDC_SBTR = ( id%KEEP(47) >= 4 )
BDC_M2_MEM = ( ( id%KEEP(80) == 2 .OR. id%KEEP(80) == 3 )
& .AND. id%KEEP(47) == 4 )
BDC_M2_FLOPS = ( id%KEEP(80) == 1
& .AND. id%KEEP(47) .GE. 1 )
BDC_MD = (id%KEEP(86)==1)
SBTR_WHICH_M = id%KEEP(90)
REMOVE_NODE_FLAG=.FALSE.
REMOVE_NODE_FLAG_MEM=.FALSE.
REMOVE_NODE_COST_MEM=dble(0)
REMOVE_NODE_COST=dble(0)
IF (id%KEEP(80) .LT. 0 .OR. id%KEEP(80)>3) THEN
WRITE(*,*) "Unimplemented KEEP(80) Strategy"
CALL MUMPS_ABORT()
ENDIF
IF ((id%KEEP(80) == 2 .OR. id%KEEP(80)==3).AND. id%KEEP(47).NE.4)
& THEN
WRITE(*,*) "Internal error 3 in DMUMPS_LOAD_INIT"
CALL MUMPS_ABORT()
END IF
IF (id%KEEP(81) == 1 .AND. id%KEEP(47) < 2) THEN
WRITE(*,*) "Internal error 2 in DMUMPS_LOAD_INIT"
CALL MUMPS_ABORT()
ENDIF
BDC_POOL_MNG = ((id%KEEP(81) == 1).AND.(id%KEEP(47) >= 2))
IF(id%KEEP(76).EQ.4)THEN
DEPTH_FIRST_LOAD=>id%DEPTH_FIRST
ENDIF
IF(id%KEEP(76).EQ.5)THEN
COST_TRAV=>id%COST_TRAV
ENDIF
IF(id%KEEP(76).EQ.6)THEN
DEPTH_FIRST_LOAD=>id%DEPTH_FIRST
DEPTH_FIRST_SEQ_LOAD=>id%DEPTH_FIRST_SEQ
SBTR_ID_LOAD=>id%SBTR_ID
ENDIF
IF (BDC_M2_MEM.OR.BDC_M2_FLOPS) THEN
POOL_NIV2_SIZE=max(1,min(id%NBSA+id%KEEP(262),id%NA(1)))
ALLOCATE(NIV2(id%NSLAVES), NB_SON(id%KEEP(28)),
& POOL_NIV2(POOL_NIV2_SIZE),
& POOL_NIV2_COST(POOL_NIV2_SIZE),
& stat=allocok)
DO i = 1, id%KEEP(28)
NB_SON(i)=id%NE_STEPS(i)
ENDDO
NIV2=dble(0)
IF (allocok > 0) THEN
WRITE(*,*) 'PB allocation in DMUMPS_LOAD_INIT'
id%INFO(1) = -13
id%INFO(2) = id%NSLAVES + id%KEEP(28) + 200
RETURN
ENDIF
ENDIF
K50 = id%KEEP(50)
CALL MPI_COMM_RANK( COMM_LD, MYID, IERR )
NPROCS = id%NSLAVES
DM_SUMLU=ZERO
POOL_SIZE=0
IF(BDC_MD)THEN
IF ( allocated(MD_MEM) ) DEALLOCATE(MD_MEM)
ALLOCATE( MD_MEM( 0: NPROCS - 1 ), stat=allocok )
IF ( allocok .gt. 0 ) THEN
WRITE(*,*) 'PB allocation in DMUMPS_LOAD_INIT'
id%INFO(1) = -13
id%INFO(2) = NPROCS
RETURN
END IF
IF ( allocated(TAB_MAXS) ) DEALLOCATE(TAB_MAXS)
ALLOCATE( TAB_MAXS( 0: NPROCS - 1 ), stat=allocok )
IF ( allocok .gt. 0 ) THEN
WRITE(*,*) 'PB allocation in DMUMPS_LOAD_INIT'
id%INFO(1) = -13
id%INFO(2) = NPROCS
RETURN
END IF
TAB_MAXS=0_8
IF ( allocated(LU_USAGE) ) DEALLOCATE(LU_USAGE)
ALLOCATE( LU_USAGE( 0: NPROCS - 1 ), stat=allocok )
IF ( allocok .gt. 0 ) THEN
WRITE(*,*) 'PB allocation in DMUMPS_LOAD_INIT'
id%INFO(1) = -13
id%INFO(2) = NPROCS
RETURN
END IF
LU_USAGE=dble(0)
MD_MEM=int(0,8)
ENDIF
IF((id%KEEP(81).EQ.2).OR.(id%KEEP(81).EQ.3))THEN
ALLOCATE(CB_COST_MEM(2*2000*id%NSLAVES),
& stat=allocok)
IF (allocok > 0) THEN
WRITE(*,*) 'PB allocation in DMUMPS_LOAD_INIT'
id%INFO(1) = -13
id%INFO(2) = id%NSLAVES
RETURN
ENDIF
CB_COST_MEM=int(0,8)
ALLOCATE(CB_COST_ID(2000*3),
& stat=allocok)
IF (allocok > 0) THEN
WRITE(*,*) 'PB allocation in DMUMPS_LOAD_INIT'
id%INFO(1) = -13
id%INFO(2) = id%NSLAVES
RETURN
ENDIF
CB_COST_ID=0
POS_MEM=1
POS_ID=1
ENDIF
#if ! defined(OLD_LOAD_MECHANISM)
ALLOCATE(FUTURE_NIV2(NPROCS), stat=allocok)
IF (allocok > 0 ) THEN
WRITE(*,*) 'PB allocation in DMUMPS_LOAD_INIT'
id%INFO(1) = -13
id%INFO(2) = NPROCS
RETURN
ENDIF
DO i = 1, NPROCS
FUTURE_NIV2(i) = id%FUTURE_NIV2(i)
IF(BDC_MD)THEN
IF(FUTURE_NIV2(i).EQ.0)THEN
MD_MEM(i-1)=999999999_8
ENDIF
ENDIF
ENDDO
DELTA_MEM=ZERO
DELTA_LOAD=ZERO
#endif
CHECK_MEM=0_8
#if defined(OLD_LOAD_MECHANISM)
#if defined(CHECK_COHERENCE)
NB_LEVEL2=0
AMI_CHOSEN=.FALSE.
IS_DISPLAYED=.FALSE.
#endif
#endif
IF(BDC_SBTR.OR.BDC_POOL_MNG)THEN
NB_SUBTREES=id%NBSA_LOCAL
IF (allocated(MEM_SUBTREE)) DEALLOCATE(MEM_SUBTREE)
ALLOCATE(MEM_SUBTREE(id%NBSA_LOCAL),stat=allocok)
DO i=1,id%NBSA_LOCAL
MEM_SUBTREE(i)=id%MEM_SUBTREE(i)
ENDDO
MY_FIRST_LEAF=>id%MY_FIRST_LEAF
MY_NB_LEAF=>id%MY_NB_LEAF
MY_ROOT_SBTR=>id%MY_ROOT_SBTR
IF (allocated(SBTR_FIRST_POS_IN_POOL))
& DEALLOCATE(SBTR_FIRST_POS_IN_POOL)
ALLOCATE(SBTR_FIRST_POS_IN_POOL(id%NBSA_LOCAL),stat=allocok)
INSIDE_SUBTREE=0
PEAK_SBTR_CUR_LOCAL = dble(0)
SBTR_CUR_LOCAL = dble(0)
IF (allocated(SBTR_PEAK_ARRAY)) DEALLOCATE(SBTR_PEAK_ARRAY)
ALLOCATE(SBTR_PEAK_ARRAY(id%NBSA_LOCAL),stat=allocok)
SBTR_PEAK_ARRAY=dble(0)
IF (allocated(SBTR_CUR_ARRAY)) DEALLOCATE(SBTR_CUR_ARRAY)
ALLOCATE(SBTR_CUR_ARRAY(id%NBSA_LOCAL),stat=allocok)
SBTR_CUR_ARRAY=dble(0)
INDICE_SBTR_ARRAY=1
NIV1_FLAG=0
INDICE_SBTR=1
ENDIF
IF ( allocated(LOAD_FLOPS) ) DEALLOCATE( LOAD_FLOPS )
ALLOCATE( LOAD_FLOPS( 0: NPROCS - 1 ), stat=allocok )
IF ( allocok .gt. 0 ) THEN
WRITE(*,*) 'PB allocation in DMUMPS_LOAD_INIT'
id%INFO(1) = -13
id%INFO(2) = NPROCS
RETURN
END IF
IF ( allocated(WLOAD) ) DEALLOCATE( WLOAD )
ALLOCATE( WLOAD( NPROCS ), stat=allocok )
IF ( allocok .gt. 0 ) THEN
WRITE(*,*) 'PB allocation in DMUMPS_LOAD_INIT'
id%INFO(1) = -13
id%INFO(2) = NPROCS
RETURN
END IF
IF ( allocated(IDWLOAD) ) DEALLOCATE( IDWLOAD )
ALLOCATE( IDWLOAD( NPROCS ), stat=allocok )
IF ( allocok .gt. 0 ) THEN
WRITE(*,*) 'PB allocation in DMUMPS_LOAD_INIT'
id%INFO(1) = -13
id%INFO(2) = NPROCS
RETURN
END IF
IF ( BDC_MEM ) THEN
IF ( allocated(DM_MEM) ) DEALLOCATE( DM_MEM )
ALLOCATE( DM_MEM( 0:NPROCS-1 ), stat=allocok )
IF ( allocok .gt. 0 ) THEN
WRITE(*,*) 'PB allocation in DMUMPS_LOAD_INIT'
id%INFO(1) = -13
id%INFO(2) = NPROCS
RETURN
END IF
END IF
IF ( BDC_POOL ) THEN
IF ( allocated(POOL_MEM) ) DEALLOCATE(POOL_MEM)
ALLOCATE( POOL_MEM(0: NPROCS -1), stat=allocok)
IF ( allocok .gt. 0 ) THEN
WRITE(*,*) 'PB allocation in DMUMPS_LOAD_INIT'
id%INFO(1) = -13
id%INFO(2) = NPROCS
RETURN
END IF
POOL_MEM = dble(0)
POOL_LAST_COST_SENT = dble(0)
END IF
IF ( BDC_SBTR ) THEN
IF ( allocated(SBTR_MEM) ) DEALLOCATE(SBTR_MEM)
ALLOCATE( SBTR_MEM(0: NPROCS -1), stat=allocok)
IF ( allocok .gt. 0 ) THEN
WRITE(*,*) 'PB allocation in DMUMPS_LOAD_INIT'
id%INFO(1) = -13
id%INFO(2) = NPROCS
RETURN
END IF
IF ( allocated(SBTR_CUR) ) DEALLOCATE(SBTR_CUR)
ALLOCATE( SBTR_CUR(0: NPROCS -1), stat=allocok)
IF ( allocok .gt. 0 ) THEN
WRITE(*,*) 'PB allocation in DMUMPS_LOAD_INIT'
id%INFO(1) = -13
id%INFO(2) = NPROCS
RETURN
END IF
SBTR_CUR = dble(0)
SBTR_MEM = dble(0)
END IF
K34_LOC=id%KEEP(34)
CALL MUMPS_SIZE_C(SIZE_REAL(1),SIZE_REAL(2),K35_LOC)
K35 = K35_LOC
BUF_LOAD_SIZE = K34_LOC * 2 * ( NPROCS - 1 ) +
& NPROCS * ( K35_LOC + K34_LOC )
IF (BDC_MEM) THEN
BUF_LOAD_SIZE = BUF_LOAD_SIZE + NPROCS * K35_LOC
END IF
IF (BDC_SBTR)THEN
BUF_LOAD_SIZE = BUF_LOAD_SIZE + NPROCS * K35_LOC
ENDIF
LBUF_LOAD_RECV = (BUF_LOAD_SIZE+K34_LOC)/K34_LOC
LBUF_LOAD_RECV_BYTES = LBUF_LOAD_RECV * K34_LOC
IF ( allocated(BUF_LOAD_RECV) ) DEALLOCATE(BUF_LOAD_RECV)
ALLOCATE( BUF_LOAD_RECV( LBUF_LOAD_RECV), stat=allocok)
IF ( allocok > 0 ) THEN
WRITE(*,*) 'PB allocation in DMUMPS_LOAD_INIT'
id%INFO(1) = -13
id%INFO(2) = LBUF_LOAD_RECV
RETURN
ENDIF
BUF_LOAD_SIZE = BUF_LOAD_SIZE * 20
CALL DMUMPS_BUF_ALLOC_LOAD_BUFFER( BUF_LOAD_SIZE, IERR )
IF ( IERR .LT. 0 ) THEN
id%INFO(1) = -13
id%INFO(2) = BUF_LOAD_SIZE
RETURN
END IF
DO i = 0, NPROCS - 1
LOAD_FLOPS( i ) = ZERO
END DO
#if defined(OLD_LOAD_MECHANISM)
LOAD_FLOPS( MYID ) = COST_SUBTREE
LAST_LOAD_SENT = ZERO
#endif
IF ( BDC_MEM ) THEN
DO i = 0, NPROCS - 1
DM_MEM( i )=ZERO
END DO
#if defined(OLD_LOAD_MECHANISM)
DM_LAST_MEM_SENT=ZERO
#endif
ENDIF
CALL DMUMPS_INIT_ALPHA_BETA(id%KEEP(69))
IF(BDC_MD)THEN
MAX_SBTR=0.0D0
IF(BDC_SBTR)THEN
DO i=1,id%NBSA_LOCAL
MAX_SBTR=max(id%MEM_SUBTREE(i),MAX_SBTR)
ENDDO
ENDIF
MD_MEM(MYID)=MEMORY_MD
WHAT=8
CALL DMUMPS_BUF_BROADCAST( WHAT,
& COMM_LD, NPROCS,
#if ! defined(OLD_LOAD_MECHANISM)
& FUTURE_NIV2,
#endif
& dble(MEMORY_MD),dble(0) ,MYID, id%KEEP, IERR )
WHAT=9
MEMORY_SENT = dble(LA-MAX_SURF_MASTER)-MAX_SBTR
& - max( dble(LA) * dble(3) / dble(100),
& dble(2) *
& dble(max(id%KEEP(5),id%KEEP(6))) * dble(id%KEEP(127)))
IF (id%KEEP(12) > 25) THEN
MEMORY_SENT = MEMORY_SENT -
& dble(id%KEEP(12))*0.2d0*dble(LA)/100.0d0
ENDIF
TAB_MAXS(MYID)=int(MEMORY_SENT,8)
CALL DMUMPS_BUF_BROADCAST( WHAT,
& COMM_LD, NPROCS,
#if ! defined(OLD_LOAD_MECHANISM)
& FUTURE_NIV2,
#endif
& MEMORY_SENT,
& dble(0),MYID, id%KEEP, IERR )
ENDIF
RETURN
END SUBROUTINE DMUMPS_LOAD_INIT
SUBROUTINE DMUMPS_LOAD_UPDATE( CHECK_FLOPS,PROCESS_BANDE,
& INC_LOAD, KEEP,KEEP8 )
USE DMUMPS_BUF
#if ! defined(OLD_LOAD_MECHANISM)
USE MUMPS_FUTURE_NIV2
#endif
IMPLICIT NONE
DOUBLE PRECISION INC_LOAD
INTEGER KEEP(500)
INTEGER(8) KEEP8(150)
LOGICAL PROCESS_BANDE
INTEGER CHECK_FLOPS
INTEGER IERR
DOUBLE PRECISION ZERO, SEND_MEM, SEND_LOAD,SBTR_TMP
PARAMETER( ZERO=0.0d0 )
INTRINSIC max, abs
IF (.NOT. IS_MUMPS_LOAD_ENABLED) RETURN
IF (INC_LOAD == 0.0D0) THEN
IF(REMOVE_NODE_FLAG)THEN
REMOVE_NODE_FLAG=.FALSE.
ENDIF
RETURN
ENDIF
IF((CHECK_FLOPS.NE.0).AND.
& (CHECK_FLOPS.NE.1).AND.(CHECK_FLOPS.NE.2))THEN
WRITE(*,*)MYID,': Bad value for CHECK_FLOPS'
CALL MUMPS_ABORT()
ENDIF
IF(CHECK_FLOPS.EQ.1)THEN
CHK_LD=CHK_LD+INC_LOAD
ELSE
IF(CHECK_FLOPS.EQ.2)THEN
RETURN
ENDIF
ENDIF
#if ! defined(OLD_LOAD_MECHANISM)
IF ( PROCESS_BANDE ) THEN
RETURN
ENDIF
#endif
LOAD_FLOPS( MYID ) = max( LOAD_FLOPS( MYID ) + INC_LOAD, ZERO)
IF(BDC_M2_FLOPS.AND.REMOVE_NODE_FLAG)THEN
IF(INC_LOAD.NE.REMOVE_NODE_COST)THEN
IF(INC_LOAD.GT.REMOVE_NODE_COST)THEN
#if ! defined(OLD_LOAD_MECHANISM)
DELTA_LOAD = DELTA_LOAD +
& (INC_LOAD-REMOVE_NODE_COST)
GOTO 888
#else
GOTO 888
#endif
ELSE
#if ! defined(OLD_LOAD_MECHANISM)
DELTA_LOAD = DELTA_LOAD -
& (REMOVE_NODE_COST-INC_LOAD)
GOTO 888
#else
GOTO 888
#endif
ENDIF
ENDIF
GOTO 333
ENDIF
#if ! defined(OLD_LOAD_MECHANISM)
DELTA_LOAD = DELTA_LOAD + INC_LOAD
888 CONTINUE
IF ( DELTA_LOAD > MIN_DIFF .OR. DELTA_LOAD < -MIN_DIFF) THEN
SEND_LOAD = DELTA_LOAD
IF (BDC_MEM) THEN
SEND_MEM = DELTA_MEM
ELSE
SEND_MEM = ZERO
END IF
#else
888 CONTINUE
IF ( abs( LOAD_FLOPS ( MYID ) -
& LAST_LOAD_SENT ).GT.MIN_DIFF)THEN
IERR = 0
SEND_LOAD = LOAD_FLOPS( MYID )
IF ( BDC_MEM ) THEN
SEND_MEM = DM_MEM(MYID)
ELSE
SEND_MEM = ZERO
END IF
#endif
IF(BDC_SBTR)THEN
SBTR_TMP=SBTR_CUR(MYID)
ELSE
SBTR_TMP=dble(0)
ENDIF
111 CONTINUE
CALL DMUMPS_BUF_SEND_UPDATE_LOAD( BDC_SBTR,BDC_MEM,
& BDC_MD,COMM_LD, NPROCS,
& SEND_LOAD,
& SEND_MEM,SBTR_TMP,
& DM_SUMLU,
#if ! defined(OLD_LOAD_MECHANISM)
& FUTURE_NIV2,
#endif
& MYID, KEEP, IERR )
IF ( IERR == -1 )THEN
CALL DMUMPS_LOAD_RECV_MSGS(COMM_LD)
GOTO 111
ELSE IF ( IERR .NE.0 ) THEN
WRITE(*,*) "Internal Error in DMUMPS_LOAD_UPDATE",IERR
CALL MUMPS_ABORT()
ENDIF
IF ( IERR .EQ. 0 ) THEN
#if ! defined(OLD_LOAD_MECHANISM)
DELTA_LOAD = ZERO
IF (BDC_MEM) DELTA_MEM = ZERO
#else
LAST_LOAD_SENT = LOAD_FLOPS( MYID )
IF ( BDC_MEM ) DM_LAST_MEM_SENT = DM_MEM( MYID )
#endif
END IF
ENDIF
333 CONTINUE
IF(REMOVE_NODE_FLAG)THEN
REMOVE_NODE_FLAG=.FALSE.
ENDIF
RETURN
END SUBROUTINE DMUMPS_LOAD_UPDATE
SUBROUTINE DMUMPS_LOAD_MEM_UPDATE( SSARBR,
& PROCESS_BANDE_ARG, MEM_VALUE, NEW_LU, INC_MEM_ARG,
& KEEP,KEEP8,LRLUS)
USE DMUMPS_BUF
#if ! defined(OLD_LOAD_MECHANISM)
USE MUMPS_FUTURE_NIV2
#endif
IMPLICIT NONE
INTEGER(8), INTENT(IN) :: MEM_VALUE, INC_MEM_ARG, NEW_LU,LRLUS
LOGICAL, INTENT(IN) :: PROCESS_BANDE_ARG, SSARBR
INTEGER IERR, KEEP(500)
INTEGER(8) KEEP8(150)
DOUBLE PRECISION ZERO, SEND_MEM, SBTR_TMP
PARAMETER( ZERO=0.0d0 )
INTRINSIC max, abs
INTEGER(8) :: INC_MEM
LOGICAL PROCESS_BANDE
#if defined(OLD_LOAD_MECHANISM)
DOUBLE PRECISION TMP_MEM
#endif
IF (.NOT. IS_MUMPS_LOAD_ENABLED) RETURN
PROCESS_BANDE=PROCESS_BANDE_ARG
INC_MEM = INC_MEM_ARG
#if ! defined(OLD_LOAD_MECHANISM)
IF ( PROCESS_BANDE .AND. NEW_LU .NE. 0_8) THEN
WRITE(*,*) " Internal Error in DMUMPS_LOAD_MEM_UPDATE."
WRITE(*,*) " NEW_LU must be zero if called from PROCESS_BANDE"
CALL MUMPS_ABORT()
ENDIF
#endif
#if defined(OLD_LOAD_MECHANISM)
#if defined(CHECK_COHERENCE)
IF(PROCESS_BANDE)THEN
PROCESS_BANDE=.FALSE.
NB_LEVEL2=NB_LEVEL2-1
IF(NB_LEVEL2.LT.0)THEN
WRITE(*,*)MYID,': problem with NB_LEVEL2'
ELSEIF(NB_LEVEL2.EQ.0)THEN
IF(IS_DISPLAYED)THEN
IS_DISPLAYED=.FALSE.
ENDIF
AMI_CHOSEN=.FALSE.
ENDIF
ENDIF
IF((KEEP(73).EQ.0).AND.(NB_LEVEL2.NE.0)
& .AND.(.NOT.IS_DISPLAYED))THEN
IS_DISPLAYED=.TRUE.
ENDIF
#endif
#endif
DM_SUMLU = DM_SUMLU + dble(NEW_LU)
IF(KEEP_LOAD(201).EQ.0)THEN
CHECK_MEM = CHECK_MEM + INC_MEM
ELSE
CHECK_MEM = CHECK_MEM + INC_MEM - NEW_LU
ENDIF
IF ( MEM_VALUE .NE. CHECK_MEM ) THEN
WRITE(*,*)MYID,
& ':Problem with increments in DMUMPS_LOAD_MEM_UPDATE',
& CHECK_MEM, MEM_VALUE, INC_MEM,NEW_LU
CALL MUMPS_ABORT()
ENDIF
#if ! defined(OLD_LOAD_MECHANISM)
IF (PROCESS_BANDE) THEN
RETURN
ENDIF
#endif
IF(BDC_POOL_MNG) THEN
IF(SBTR_WHICH_M.EQ.0)THEN
IF (SSARBR) SBTR_CUR_LOCAL = SBTR_CUR_LOCAL+
& dble(INC_MEM-NEW_LU)
ELSE
IF (SSARBR) SBTR_CUR_LOCAL = SBTR_CUR_LOCAL+
& dble(INC_MEM)
ENDIF
ENDIF
IF ( .NOT. BDC_MEM ) THEN
RETURN