45 INTEGER context, err, i, iam, j, k, lwork, maxnodes,
46 $ nmatsizes, nout, npconfigs, nprocs
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 ),
70 CALL blacs_pinfo( iam, nprocs )
75 OPEN( unit = nin, file =
'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 )
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 sgebs2d( context, 'all
', ' ', 1, 1, THRESH, 1 )
142 CALL SGEBR2D( CONTEXT, 'all
', ' ', 1, 1, THRESH, 1, 0, 0 )
144.EQ.
IF( THRESH-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.LT..OR..GT.
IF( NMATSIZES1 NMATSIZESMAXSETSIZE ) 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.LT..OR..GT.
IF( NPCONFIGS1 NPCONFIGSMAXSETSIZE ) 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.LE.
IF( NPCOLS( I )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, NBS, 1, 0, 0 )
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 PSSVDTST( MM( J ), NN( J ), NPROWS( I ), NPCOLS( I ),
270 $ NBS( I ), ISEED, THRESH, WORK, RESULT, LWORK,
284 CALL BLACS_GRIDEXIT( CONTEXT )
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: PSGESVD' )
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 pssvdtst.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( .NE.
' for JOBTYPE1 (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 P Q',
339 $
' NB MTYPE CHK MTM DELTA HET' )
subroutine sgebs2d(contxt, scope, top, m, n, a, lda)
subroutine blacs_gridinit(cntxt, c, nprow, npcol)
subroutine sgebr2d(contxt, scope, top, m, n, a, lda)
subroutine blacs_gridexit(cntxt)
subroutine pssvdtst(m, n, nprow, npcol, nb, iseed, thresh, work, result, lwork, nout)