1 SUBROUTINE pclsinfo( SUMMRY, NOUT, NMAT, MVAL, LDMVAL,
2 $ NVAL, LDNVAL, NNB, NBVAL, LDNBVAL, NNR,
3 $ NRVAL, LDNRVAL, NNBR, NBRVAL, LDNBRVAL,
4 $ NGRIDS, PVAL, LDPVAL, QVAL, LDQVAL, THRESH,
13 CHARACTER*( * ) SUMMRY
14 INTEGER IAM, LDMVAL, LDNBRVAL, LDNBVAL, LDNRVAL,
15 $ LDNVAL, LDPVAL, LDQVAL, NGRIDS, NMAT, NNB,
16 $ NNBR, NNR, NOUT, NPROCS
20 INTEGER MVAL( LDMVAL ), NBRVAL( LDNBRVAL ),
21 $ nbval( ldnbval ), nrval( ldnrval ),
22 $ nval( ldnval ), pval( ldpval ),
23 $ qval( ldqval ), work( * )
138 INTEGER BLOCK_CYCLIC_2D, CSRC_, CTXT_, DLEN_, DTYPE_,
139 $ LLD_, MB_, M_, NB_, N_, RSRC_
140 PARAMETER ( BLOCK_CYCLIC_2D = 1, dlen_ = 9, dtype_ = 1,
141 $ ctxt_ = 2, m_ = 3, n_ = 4, mb_ = 5, nb_ = 6,
142 $ rsrc_ = 7, csrc_ = 8, lld_ = 9 )
144 parameter( nin = 11 )
152 EXTERNAL blacs_abort, blacs_get, blacs_gridexit,
153 $ blacs_gridinit, blacs_setup,
icopy, igebr2d,
154 $ igebs2d, sgebr2d, sgebs2d
159 EXTERNAL LSAME, PSLAMCH
173 OPEN( nin, file=
'LS.dat', status=
'OLD' )
174 READ( nin, fmt = * ) summry
179 READ( nin, fmt = 9999 ) usrinfo
183 READ( nin, fmt = * ) summry
184 READ( nin, fmt = * ) nout
185 IF( nout.NE.0 .AND. nout.NE.6 )
186 $
OPEN( nout, file = summry, status =
'UNKNOWN' )
192 READ( nin, fmt = * ) nmat
193 IF( nmat.LT.1 .OR. nmat.GT.ldnval )
THEN
194 WRITE( nout, fmt = 9994 )
'N', ldnval
196 ELSE IF( nmat.GT.ldmval )
THEN
197 WRITE( nout, fmt = 9994 )
'M', ldmval
200 READ( nin, fmt = * ) ( mval( i ), i = 1, nmat )
201 READ( nin, fmt = * ) ( nval( i ), i = 1, nmat )
205 READ( nin, fmt = * ) nnb
206 IF( nnb.LT.1 .OR. nnb.GT.ldnbval )
THEN
207 WRITE( nout, fmt = 9994 )
'NB', ldnbval
210 READ( nin, fmt = * ) ( nbval( i ), i = 1, nnb )
214 READ( nin, fmt = * ) nnr
215 IF( nnr.LT.1 .OR. nnr.GT.ldnrval )
THEN
216 WRITE( nout, fmt = 9994 )
'NRHS', ldnrval
219 READ( nin, fmt = * ) ( nrval( i ), i = 1, nnr )
223 READ( nin, fmt = * ) nnbr
224 IF( nnbr.LT.1 .OR. nnbr.GT.ldnbrval )
THEN
225 WRITE( nout, fmt = 9994 )
'NBRHS', ldnbrval
228 READ( nin, fmt = * ) ( nbrval( i ), i = 1, nnbr )
232 READ( nin, fmt = * ) ngrids
233 IF( ngrids.LT.1 .OR. ngrids.GT.ldpval )
THEN
234 WRITE( nout, fmt = 9994 )
'Grids', ldpval
236 ELSE IF( ngrids.GT.ldqval )
THEN
237 WRITE( nout, fmt = 9994 )
'Grids', ldqval
243 READ( nin, fmt = * ) ( pval( i ), i = 1, ngrids )
244 READ( nin, fmt = * ) ( qval( i ), i = 1, ngrids )
248 READ( nin, fmt = * ) thresh
257 IF( nprocs.LT.1 )
THEN
260 nprocs =
max( nprocs, pval( i )*qval( i ) )
262 CALL blacs_setup( iam, nprocs )
268 CALL blacs_get( -1, 0, ictxt )
269 CALL blacs_gridinit( ictxt,
'Row-major', 1, nprocs )
273 eps = pslamch( ictxt,
'eps' )
277 CALL sgebs2d( ictxt,
'All',
' ', 1, 1, thresh, 1 )
284 CALL igebs2d( ictxt,
'All',
' ', 5, 1, work, 5 )
287 CALL icopy( nmat, mval, 1, work( i ), 1 )
289 CALL icopy( nmat, nval, 1, work( i ), 1 )
291 CALL icopy( nnb, nbval, 1, work( i ), 1 )
293 CALL icopy( nnr, nrval, 1, work( i ), 1 )
295 CALL icopy( nnbr, nbrval, 1, work( i ), 1 )
297 CALL icopy( ngrids, pval, 1, work( i ), 1 )
299 CALL icopy( ngrids, qval, 1, work( i ), 1 )
301 CALL igebs2d( ictxt,
'All',
' ', i, 1, work, i )
305 WRITE( nout, fmt = 9999 )
306 $
'SCALAPACK min ||Ax-b|| by QR factorizations.'
307 WRITE( nout, fmt = 9999 ) usrinfo
308 WRITE( nout, fmt = * )
309 WRITE( nout, fmt = 9999 )
310 $
'Tests of the parallel '//
311 $
'complex single precision least-square solve.'
312 WRITE( nout, fmt = 9999 )
313 $
'The following scaled residual '//
314 $
'checks will be computed:'
315 WRITE( nout, fmt = 9999 )
316 $
' Solve residual = ||Ax - b|| / '//
317 $
'(||x|| * ||A|| * eps * N)'
318 WRITE( nout, fmt = 9999 )
319 $
' Factorization residual = ||A - QR|| / '//
320 $
'(||A|| * eps * N)'
321 WRITE( nout, fmt = 9999 )
322 $
'The matrix A is randomly '//
323 $
'generated for each test.'
324 WRITE( nout, fmt = * )
325 WRITE( nout, fmt = 9999 )
326 $
'An explanation of the input/output '//
327 $
'parameters follows:'
328 WRITE( nout, fmt = 9999 )
329 $
'TIME : Indicates whether WALL or '//
330 $
'CPU time was used. If CPU and WALL time'
331 WRITE( nout, fmt = 9999 )
332 $
' are the same, only one line '//
333 $
'is printed, and the label is ''BOTH''.'
335 WRITE( nout, fmt = 9999 )
336 $
'M : The number of rows in the '//
338 WRITE( nout, fmt = 9999 )
339 $
'N : The number of columns in the '//
341 WRITE( nout, fmt = 9999 )
342 $
'NB : The size of the square blocks the'//
343 $
' matrix A is split into.'
344 WRITE( nout, fmt = 9999 )
345 $
'NRHS : The total number of RHS to solve'//
347 WRITE( nout, fmt = 9999 )
348 $
'NBRHS : The number of RHS to be put on '//
349 $
'a column of processes before going'
350 WRITE( nout, fmt = 9999 )
351 $
' on to the next column of processes.'
352 WRITE( nout, fmt = 9999 )
353 $
'P : The number of process rows.'
354 WRITE( nout, fmt = 9999 )
355 $
'Q : The number of process columns.'
356 WRITE( nout, fmt = 9999 )
357 $
'THRESH : If a residual value is less than'//
358 $
' THRESH, CHECK is flagged as PASSED'
359 WRITE( nout, fmt = 9999 )
360 WRITE( nout, fmt = 9999 )
361 $
'QR time : Time in seconds to factor the'//
363 WRITE( nout, fmt = 9999 )
364 $
'Sol Time: Time in seconds to solve the'//
366 WRITE( nout, fmt = 9999 )
367 $
'MFLOPS : Rate of execution for factor '//
369 WRITE( nout, fmt = * )
370 WRITE( nout, fmt = 9999 )
371 $
'The following parameter values will be used:'
372 WRITE( nout, fmt = 9996 )
373 $
'M ', ( mval(i), i = 1,
min(nmat, 10) )
375 $
WRITE( nout, fmt = 9997 ) ( mval(i), i = 11, nmat )
376 WRITE( nout, fmt = 9996 )
377 $
'N ', ( nval(i), i = 1,
min(nmat, 10) )
379 $
WRITE( nout, fmt = 9997 ) ( nval(i), i = 11, nmat )
380 WRITE( nout, fmt = 9996 )
381 $
'NB ', ( nbval(i), i = 1,
min(nnb, 10) )
383 $
WRITE( nout, fmt = 9997 ) ( nbval(i), i = 11, nnb )
384 WRITE( nout, fmt = 9996 )
385 $
'NRHS ', ( nrval(i), i = 1,
min(nnr, 10) )
387 $
WRITE( nout, fmt = 9997 ) ( nrval(i), i = 11, nnr )
388 WRITE( nout, fmt = 9996 )
389 $
'NBRHS', ( nbrval(i), i = 1,
min(nnbr, 10) )
391 $
WRITE( nout, fmt = 9997 ) ( nbrval(i), i = 11, nnbr )
392 WRITE( nout, fmt = 9996 )
393 $
'P ', ( pval(i), i = 1,
min(ngrids, 10) )
395 $
WRITE( nout, fmt = 9997) ( pval(i), i = 11, ngrids )
396 WRITE( nout, fmt = 9996 )
397 $
'Q ', ( qval(i), i = 1,
min(ngrids, 10) )
399 $
WRITE( nout, fmt = 9997 ) ( qval(i), i = 11, ngrids )
400 WRITE( nout, fmt = * )
401 WRITE( nout, fmt = 9995 ) eps
402 WRITE( nout, fmt = 9998 ) thresh
409 $
CALL blacs_setup( iam, nprocs )
414 CALL blacs_get( -1, 0, ictxt )
415 CALL blacs_gridinit( ictxt,
'Row-major', 1, nprocs )
419 eps = pslamch( ictxt,
'eps' )
421 CALL sgebr2d( ictxt,
'All',
' ', 1, 1, thresh, 1, 0, 0 )
423 CALL igebr2d( ictxt,
'All',
' ', 5, 1, work, 5, 0, 0 )
430 i = 2*nmat + nnb + nnr + nnbr + 2*ngrids
431 CALL igebr2d( ictxt,
'All',
' ', i, 1, work, i, 0, 0 )
433 CALL icopy( nmat, work( i ), 1, mval, 1 )
435 CALL icopy( nmat, work( i ), 1, nval, 1 )
437 CALL icopy( nnb, work( i ), 1, nbval, 1 )
439 CALL icopy( nnr, work( i ), 1, nrval, 1 )
441 CALL icopy( nnbr, work( i ), 1, nbrval, 1 )
443 CALL icopy( ngrids, work( i ), 1, pval, 1 )
445 CALL icopy( ngrids, work( i ), 1, qval, 1 )
449 CALL blacs_gridexit( ictxt )
453 20
WRITE( nout, fmt = 9993 )
455 IF( nout.NE.6 .AND. nout.NE.0 )
457 CALL blacs_abort( ictxt, 1 )
462 9998
FORMAT(
'Routines pass computational tests if scaled residual ',
463 $
'is less than ', g12.5 )
464 9997
FORMAT(
' ', 10i6 )
465 9996
FORMAT( 2x, a5,
' : ', 10i6 )
466 9995
FORMAT(
'Relative machine precision (eps) is taken to be ',
468 9994
FORMAT(
' Number of values of ',5a,
' is less than 1 or greater ',
470 9993
FORMAT(
' Illegal input in file ',40a,
'. Aborting run.' )