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 ),
62 EXTERNAL blacs_exit, blacs_get, blacs_gridexit,
63 $ blacs_gridinit, blacs_pinfo, blacs_setup,
64 $ sgebr2d, sgebs2d, igebr2d, igebs2d,
pssvdtst
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 )
87 CALL blacs_gridinit( context,
'R', 1, nprocs )
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 sgebs2d( context,
'All',
' ', 1, 1, thresh, 1 )
142 CALL sgebr2d( 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, 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' )