1 SUBROUTINE pscsum1( N, ASUM, X, IX, JX, DESCX, INCX )
9 INTEGER IX, INCX, JX, N
142 INTEGER BLOCK_CYCLIC_2D, CSRC_, CTXT_, DLEN_, DTYPE_,
143 $ LLD_, MB_, M_, NB_, N_, RSRC_
144 parameter( block_cyclic_2d = 1, dlen_ = 9, dtype_ = 1,
145 $ ctxt_ = 2, m_ = 3, n_ = 4, mb_ = 5, nb_ = 6,
146 $ rsrc_ = 7, csrc_ = 8, lld_ = 9 )
148 parameter( zero = 0.0e+0 )
151 CHARACTER CCTOP, RCTOP
152 INTEGER ICOFF, ICTXT, IIX, IROFF, IXCOL, IXROW, JJX,
153 $ LDX, MYCOL, MYROW, NP, NPCOL, NPROW, NQ
156 EXTERNAL blacs_gridinfo,
infog2l, sgsum2d, pb_topget
161 EXTERNAL numroc, scsum1
168 ictxt = descx( ctxt_ )
169 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
178 CALL infog2l( ix, jx, descx, nprow, npcol, myrow, mycol, iix, jjx,
181 IF( incx.EQ.1 .AND. descx( m_ ).EQ.1 .AND. n.EQ.1 )
THEN
182 IF( myrow.EQ.ixrow .AND. mycol.EQ.ixcol )
THEN
183 asum = abs( x( iix+(jjx-1)*ldx ) )
188 IF( incx.EQ.descx( m_ ) )
THEN
192 IF( myrow.EQ.ixrow )
THEN
193 CALL pb_topget( ictxt,
'Combine',
'Rowwise', rctop )
194 icoff = mod( jx-1, descx( nb_ ) )
195 nq = numroc( n+icoff, descx( nb_ ), mycol, ixcol, npcol )
198 asum = scsum1( nq, x( iix+(jjx-1)*ldx ), ldx )
199 CALL sgsum2d( ictxt,
'Rowwise', rctop, 1, 1, asum, 1,
207 IF( mycol.EQ.ixcol )
THEN
208 CALL pb_topget( ictxt,
'Combine',
'Columnwise', cctop )
209 iroff = mod( ix-1, descx( mb_ ) )
210 np = numroc( n+iroff, descx( mb_ ), myrow, ixrow, nprow )
213 asum = scsum1( np, x( iix+(jjx-1)*ldx ), 1 )
214 CALL sgsum2d( ictxt,
'Columnwise', cctop, 1, 1, asum, 1,