45 INTEGER context, err, i, iam, j, k, lwork, maxnodes,
46 $ nmatsizes, nout, npconfigs, nprocs
47 DOUBLE PRECISION thresh
50 INTEGER maxsetsize, nin, dblsiz, totmem, memsiz
51 parameter( maxsetsize = 50, nin = 11, dblsiz = 8,
52 $ totmem = 2000000, memsiz = totmem / dblsiz )
55 INTEGER iseed( 4 ), mm( maxsetsize ),
56 $ nbs( maxsetsize ), nn( maxsetsize ),
57 $ npcols( maxsetsize ), nprows( maxsetsize ),
59 DOUBLE PRECISION work( )
70 CALL blacs_pinfo( iam, nprocs )
75 OPEN( unit = nin
'SVD.dat', status =
'OLD' )
76 READ( nin, fmt = * )summary
77 READ( nin, fmt = * )nout
78 READ( nin, fmt = * )maxnodes
81 IF( nprocs.LT.1 )
THEN
82 CALL blacs_setup( iam, maxnodes )
86 CALL blacs_get( -1, 0, context )
101 WRITE( nout, fmt = 9992 )
102 WRITE( nout, fmt = 9991 )
103 WRITE( nout, fmt = 9990 )
104 WRITE( nout, fmt = 9989 )
105 WRITE( nout, fmt = 9988 )
106 WRITE( nout, fmt = 9987 )
107 WRITE( nout, fmt = 9986 )
108 WRITE( nout, fmt = 9985 )
109 WRITE( nout, fmt = 9984 )
110 WRITE( nout, fmt = 9983 )
111 WRITE( nout, fmt = 9982 )
112 WRITE( nout, fmt = 9981 )
113 WRITE( nout, fmt = 9980 )
114 WRITE( nout, fmt = 9979 )
115 WRITE( nout, fmt = 9978 )
116 WRITE( nout, fmt = 9977 )
117 WRITE( nout, fmt = 9976 )
118 WRITE( nout, fmt = 9975 )
119 WRITE( nout, fmt = 9974 )
120 WRITE( nout, fmt = 9973 )
121 WRITE( nout, fmt = 9972 )
122 WRITE( nout, fmt = 9971 )
123 WRITE( nout, fmt = 9970 )
124 WRITE( nout, fmt = 9969 )
125 WRITE( nout, fmt = 9968 )
126 WRITE( nout, fmt = 9967 )
127 WRITE( nout, fmt = 9966 )
128 WRITE( nout, fmt = 9965 )
136 READ( nin, fmt = * )summary
137 READ( nin, fmt = * )summary
138 READ( nin, fmt = * )thresh
139 WRITE( nout, fmt = 9965 )summary
140 CALL dgebs2d( context,
'All',
' ', 1, 1, thresh, 1 )
142 CALL dgebr2d( context,
'All',
' ', 1, 1, thresh, 1, 0, 0 )
144 IF( thresh.EQ.-1 )
THEN
149 READ( nin, fmt = * )nmatsizes
150 CALL igebs2d( context,
'All',
' ', 1, 1, nmatsizes, 1 )
152 CALL igebr2d( context,
'All',
' ', 1, 1, nmatsizes, 1, 0, 0 )
155 IF( nmatsizes.LT.1 .OR. nmatsizes.GT.maxsetsize )
THEN
157 WRITE( nout, fmt = 9999 )
'Matrix size', nmatsizes, 1,
167 READ( nin, fmt = * )( mm( i ), i = 1, nmatsizes )
168 CALL igebs2d( context,
'All',
' ', 1, nmatsizes, mm, 1 )
170 CALL igebr2d( context,
'All',
' ', 1, nmatsizes, mm, 1, 0, 0 )
174 READ( nin, fmt = * )( nn( i ), i = 1, nmatsizes )
175 CALL igebs2d( context,
'All',
' ', 1, nmatsizes, nn, 1 )
177 CALL igebr2d( context,
'All',
' ', 1, nmatsizes, nn, 1, 0, 0 )
183 READ( nin, fmt = * )npconfigs
184 CALL igebs2d( context,
'All',
' ', 1, 1, npconfigs, 1 )
186 CALL igebr2d( context,
'All',
' ', 1, 1, npconfigs, 1, 0, 0 )
189 IF( npconfigs.LT.1 .OR. npconfigs.GT.maxsetsize )
THEN
191 WRITE( nout, fmt = 9999 )
'# proc configs', npconfigs, 1,
201 READ( nin, fmt = * )( nprows( i ), i = 1, npconfigs )
203 CALL igebs2d( context,
'All',
' ', 1, npconfigs, nprows, 1 )
205 CALL igebr2d( context,
'All',
' ', 1, npconfigs, nprows, 1, 0,
209 DO 20 i = 1, npconfigs
210 IF( nprows( i ).LE.0 )
215 WRITE( nout, fmt = 9997 )
' NPROW'
223 READ( nin, fmt = * )( npcols( i ), i = 1, npconfigs )
224 CALL igebs2d( context,
'All',
' ', 1, npconfigs, npcols, 1 )
226 CALL igebr2d( context,
'All',
' ', 1, npconfigs, npcols, 1, 0,
232 DO 30 i = 1, npconfigs
233 IF( npcols( i ).LE.0 )
238 WRITE( nout, fmt = 9997 )
' NPCOL'
246 READ( nin, fmt = * )( nbs( i ), i = 1, npconfigs )
247 CALL igebs2d( context,
'All',
' ', 1, npconfigs, nbs, 1 )
249 CALL igebr2d( context,
'All',
' ', 1, npconfigs
252 DO 40 i = 1, npconfigs
258 WRITE( nout, fmt = 9997 )
' NB'
263 DO 70 j = 1, nmatsizes
264 DO 60 i = 1, npconfigs
269 CALL pdsvdtst( mm( j ), nn( j ), nprows( i ), npcols( i ),
270 $ nbs( i ), iseed, thresh, work, result, lwork,
291 9999
FORMAT( a20,
' is:', i5,
' must be between:', i5,
' and', i5 )
293 9997
FORMAT( a20,
' must be positive' )
295 9995
FORMAT(
'M = ', i5,
' N = ', i5,
' NPOW = ', i5,
'NPCOL = ', i5,
298 9994
FORMAT(
'Test #', i5,
'for this configuration has failed' )
299 9993
FORMAT(
'All test passed for this configuration' )
301 9991
FORMAT(
'Running tests of the parallel singular value ',
302 $
'decomposition routine: PDGESVD' )
303 9990
FORMAT(
'The following scaled residual checks will be',
305 9989
FORMAT(
' || A - U*diag(S)*VT ||/( ||A||*max(M,N)*ulp )' )
306 9988
FORMAT(
' || I - UT*U ||/( M*ulp )' )
307 9987
FORMAT(
' || I - VT*V ||/( N*ulp )' )
309 9985
FORMAT(
'An explanation of the input/output parameters',
311 9984
FORMAT(
'RESULT : passed; or an indication of which',
312 $
' jobtype test failed' )
313 9983
FORMAT(
'M : The number of rows of the matrix A.' )
314 9982
FORMAT(
'N : The number of columns of the matrix A.' )
315 9981
FORMAT(
'P : The number of process rows.' )
316 9980
FORMAT(
'Q : The number of process columns.' )
317 9979
FORMAT(
'NB : The size of the square blocks the',
318 $ ' matrix a is
split into.
' )
319 9978 FORMAT( 'thresh :
If a residual
value is less than
',
320 $ ' thresh, result is flagged as passed.
' )
321 9977 FORMAT( 'mtype : matrix
type (see
pdsvdtst.f).
' )
322 9976 FORMAT( 'chk : || a - u*diag(s)*vt ||/( ||a||
',
323 $ '*
max(m,n)*ulp )
' )
324 9975 FORMAT( 'mtm : maximum of two values:
',/,
325 $ ' || i - ut*u ||/( m*ulp ) and
',
326 $ ' || i - vt*v ||/( n*ulp )
' )
327 9974 FORMAT( 'delta : maximum of three values:
',/,
328 $ ' || u - uc ||/( m*ulp*thresh ),
' )
329 9973 FORMAT( ' || vt - vtc ||/( n*ulp*thresh ), and
' )
330 9972 FORMAT( ' || s - sc || / ( size*ulp*|s|*thresh ),
' )
331 9971 FORMAT( ' where uc, vtc, sc are singular vectors
',
333 9970 FORMAT( ' for jobtype.NE.1 (see
pdsvdcmp.f)
' )
334 9969 FORMAT( 'het : p
if heterogeneity was detected by
pdgesvd' )
335 9968 FORMAT( ' t
if detected by
the pdsvstst, n
if',
338 9966 FORMAT( 'result wall cpu m n q
',
339 $ ' nb mtype chk mtm delta het
' )
if(complex_arithmetic) id
end diagonal values have been computed in the(sparse) matrix id.SOL
subroutine blacs_gridinit(cntxt, c, nprow, npcol)
subroutine dgebs2d(contxt, scope, top, m, n, a, lda)
subroutine dgebr2d(contxt, scope, top, m, n, a, lda)
subroutine blacs_gridexit(cntxt)
for(i8=*sizetab-1;i8 >=0;i8--)
subroutine pdgesvd(jobu, jobvt, m, n, a, ia, ja, desca, s, u, iu, ju, descu, vt, ivt, jvt, descvt, work, lwork, info)
subroutine pdsvdcmp(m, n, jobtype, s, sc, u, uc, iu, ju, descu, vt, vtc, ivt, jvt, descvt, thresh, result, delta, work, lwork)
subroutine pdsvdtst(m, n, nprow, npcol, nb, iseed, thresh, work, result, lwork, nout)
void split(mapping_t *, PORD_INT, PORD_INT, PORD_INT, PORD_INT *, PORD_INT *, FLOAT *, PORD_INT)