3
4
5
6
7
8
9 CHARACTER*1 ADIST
10 INTEGER ICONTXT, LCMP, LCMQ, LDA, LDB, M, N, NB, NINT
11 DOUBLE PRECISION BETA
12
13
14 DOUBLE PRECISION A( LDA, * ), B( LDB, * )
15
16
17
18
19
20
21
22
23
24
25
26
27 DOUBLE PRECISION ONE
28 parameter( one = 1.0d+0 )
29
30
31 INTEGER JA, JB, K, KK, NJUMP
32
33
35
36
37 LOGICAL LSAME
38 INTEGER ICEIL
40
41
43
44
45
46 IF(
lsame( adist,
'R' ) )
THEN
47 njump = nb * lcmq
48 DO 20 k = 0, lcmq-1
49 ja = nint * mod( k*lcmp, lcmq ) + 1
50 jb = k * nb + 1
51
52 DO 10 kk = 1,
iceil( nint, nb )
53 IF( n.LT.jb ) GO TO 20
55 $ a(1, ja), lda, beta, b(1, jb), ldb )
56 ja = ja + nb
57 jb = jb + njump
58 10 CONTINUE
59 20 CONTINUE
60
61
62
63 ELSE
64 njump = nb * lcmp
65 DO 40 k = 0, lcmp-1
66 ja = 1
67 jb = k * nb + 1
68
69 DO 30 kk = 1,
iceil( nint, nb )
70 IF( m.LT.jb ) GO TO 40
72 $ a(ja, n*mod(k*lcmq,lcmp)+1), lda, beta,
73 $ b(jb, 1), ldb )
74 ja = ja + nb
75 jb = jb + njump
76 30 CONTINUE
77 40 CONTINUE
78 END IF
79
80 RETURN
81
82
83
integer function iceil(inum, idenom)
subroutine pbdmatadd(icontxt, mode, m, n, alpha, a, lda, beta, b, ldb)