1 SUBROUTINE pcluinfo( SUMMRY, NOUT, NMAT, MVAL, NVAL, LDNVAL, NNB,
2 $ NBVAL, LDNBVAL, NNR, NRVAL, LDNRVAL, NNBR,
3 $ NBRVAL, LDNBRVAL, NGRIDS, PVAL, LDPVAL, QVAL,
4 $ LDQVAL, THRESH, EST, WORK, IAM, NPROCS )
13 CHARACTER*( * ) SUMMRY
14 INTEGER IAM, LDNBRVAL, LDNBVAL, LDNRVAL, LDNVAL,
15 $ ldpval, ldqval, ngrids, nmat, nnb, nnbr,
20 INTEGER MVAL( LDNVAL ), NBRVAL( LDNBRVAL ),
21 $ NBVAL( LDNBVAL ), NRVAL( LDNRVAL ),
22 $ NVAL( LDNVAL ), PVAL( LDPVAL ), QVAL( LDQVAL ),
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
172 OPEN( nin, file=
'LU.dat', status=
'OLD' )
173 READ( nin, fmt = * ) summry
178 READ( nin, fmt = 9999 ) usrinfo
182 READ( nin, fmt = * ) summry
183 READ( nin, fmt = * ) nout
184 IF( nout.NE.0 .AND. nout.NE.6 )
185 $
OPEN( nout, file = summry, status =
'UNKNOWN' )
191 READ( nin, fmt = * ) nmat
192 IF( nmat.LT.1 .OR. nmat.GT.ldnval )
THEN
193 WRITE( nout, fmt = 9994 )
'N', ldnval
196 READ( nin, fmt = * ) ( mval( i ), i = 1, nmat )
197 READ( nin, fmt = * ) ( nval( i ), i = 1, nmat )
201 READ( nin, fmt = * ) nnb
202 IF( nnb.LT.1 .OR. nnb.GT.ldnbval )
THEN
203 WRITE( nout, fmt = 9994 )
'NB', ldnbval
206 READ( nin, fmt = * ) ( nbval( i ), i = 1, nnb )
210 READ( nin, fmt = * ) nnr
211 IF( nnr.LT.1 .OR. nnr.GT.ldnrval )
THEN
212 WRITE( nout, fmt = 9994 )
'NRHS', ldnrval
215 READ( nin, fmt = * ) ( nrval( i ), i = 1, nnr )
219 READ( nin, fmt = * ) nnbr
220 IF( nnbr.LT.1 .OR. nnbr.GT.ldnbrval )
THEN
221 WRITE( nout, fmt = 9994 )
'NBRHS', ldnbrval
224 READ( nin, fmt = * ) ( nbrval( i ), i = 1, nnbr )
228 READ( nin, fmt = * ) ngrids
229 IF( ngrids.LT.1 .OR. ngrids.GT.ldpval )
THEN
230 WRITE( nout, fmt = 9994 )
'Grids', ldpval
232 ELSE IF( ngrids.GT.ldqval )
THEN
233 WRITE( nout, fmt = 9994 )
'Grids', ldqval
239 READ( nin, fmt = * ) ( pval( i ), i = 1, ngrids )
240 READ( nin, fmt = * ) ( qval( i ), i = 1, ngrids )
244 READ( nin, fmt = * ) thresh
249 READ( nin, fmt = * ) est
258 IF( nprocs.LT.1 )
THEN
261 nprocs =
max( nprocs, pval( i )*qval( i ) )
263 CALL blacs_setup( iam, nprocs )
269 CALL blacs_get( -1, 0, ictxt )
270 CALL blacs_gridinit( ictxt,
'Row-major', 1, nprocs )
274 eps = pslamch( ictxt,
'eps' )
278 CALL sgebs2d( ictxt,
'All',
' ', 1, 1, thresh, 1 )
290 CALL igebs2d( ictxt,
'All',
' ', 6, 1, work, 6 )
293 CALL icopy( nmat, mval, 1, work( i ), 1 )
295 CALL icopy( nmat, nval, 1, work( i ), 1 )
297 CALL icopy( nnb, nbval, 1, work( i ), 1 )
299 CALL icopy( nnr, nrval, 1, work( i ), 1 )
301 CALL icopy( nnbr, nbrval, 1, work( i ), 1 )
303 CALL icopy( ngrids, pval, 1, work( i ), 1 )
305 CALL icopy( ngrids, qval, 1, work( i ), 1 )
307 CALL igebs2d( ictxt,
'All',
' ', i, 1, work, i )
311 WRITE( nout, fmt = 9999 )
312 $
'ScaLAPACK Ax=b by LU factorization.'
313 WRITE( nout, fmt = 9999 ) usrinfo
314 WRITE( nout, fmt = * )
315 WRITE( nout, fmt = 9999 )
316 $
'Tests of the parallel '//
317 $
'complex single precision LU factorization '//
319 WRITE( nout, fmt = 9999 )
320 $
'The following scaled residual '//
321 $
'checks will be computed:'
322 WRITE( nout, fmt = 9999 )
323 $
' Solve residual = ||Ax - b|| / '//
324 $
'(||x|| * ||A|| * eps * N)'
325 WRITE( nout, fmt = 9999 )
326 $
' Factorization residual = ||A - LU|| / '//
327 $
'(||A|| * eps * N)'
328 WRITE( nout, fmt = 9999 )
329 $
'The matrix A is randomly '//
330 $
'generated for each test.'
331 WRITE( nout, fmt = * )
332 WRITE( nout, fmt = 9999 )
333 $
'An explanation of the input/output '//
334 $
'parameters follows:'
335 WRITE( nout, fmt = 9999 )
336 $
'TIME : Indicates whether WALL or '//
337 $
'CPU time was used.'
339 WRITE( nout, fmt = 9999 )
340 $
'M : The number of rows in the '//
342 WRITE( nout, fmt = 9999 )
343 $
'N : The number of columns in the '//
345 WRITE( nout, fmt = 9999 )
346 $
'NB : The size of the square blocks the'//
347 $
' matrix A is split into.'
348 WRITE( nout, fmt = 9999 )
349 $
'NRHS : The total number of RHS to solve'//
351 WRITE( nout, fmt = 9999 )
352 $
'NBRHS : The number of RHS to be put on '//
353 $
'a column of processes before going'
354 WRITE( nout, fmt = 9999 )
355 $
' on to the next column of processes.'
356 WRITE( nout, fmt = 9999 )
357 $
'P : The number of process rows.'
358 WRITE( nout, fmt = 9999 )
359 $
'Q : The number of process columns.'
360 WRITE( nout, fmt = 9999 )
361 $
'THRESH : If a residual value is less than'//
362 $
' THRESH, CHECK is flagged as PASSED'
363 WRITE( nout, fmt = 9999 )
364 $
'LU time : Time in seconds to factor the'//
366 WRITE( nout, fmt = 9999 )
367 $
'Sol Time: Time in seconds to solve the'//
369 WRITE( nout, fmt = 9999 )
370 $
'MFLOPS : Rate of execution for factor '//
372 WRITE( nout, fmt = * )
373 WRITE( nout, fmt = 9999 )
374 $
'The following parameter values will be used:'
375 WRITE( nout, fmt = 9996 )
376 $
'M ', ( mval(i), i = 1,
min(nmat, 10) )
378 $
WRITE( nout, fmt = 9997 ) ( mval(i), i = 11, nmat )
379 WRITE( nout, fmt = 9996 )
380 $
'N ', ( nval(i), i = 1,
min(nmat, 10) )
382 $
WRITE( nout, fmt = 9997 ) ( nval(i), i = 11, nmat )
383 WRITE( nout, fmt = 9996 )
384 $
'NB ', ( nbval(i), i = 1,
min(nnb, 10) )
386 $
WRITE( nout, fmt = 9997 ) ( nbval(i), i = 11, nnb )
387 WRITE( nout, fmt = 9996 )
388 $
'NRHS ', ( nrval(i), i = 1,
min(nnr, 10) )
390 $
WRITE( nout, fmt = 9997 ) ( nrval(i), i = 11, nnr )
391 WRITE( nout, fmt = 9996 )
392 $
'NBRHS', ( nbrval(i), i = 1,
min(nnbr, 10) )
394 $
WRITE( nout, fmt = 9997 ) ( nbrval(i), i = 11, nnbr )
395 WRITE( nout, fmt = 9996 )
396 $
'P ', ( pval(i), i = 1,
min(ngrids, 10) )
398 $
WRITE( nout, fmt = 9997) ( pval(i), i = 11, ngrids )
399 WRITE( nout, fmt = 9996 )
400 $
'Q ', ( qval(i), i = 1,
min(ngrids, 10) )
402 $
WRITE( nout, fmt = 9997 ) ( qval(i), i = 11, ngrids )
403 WRITE( nout, fmt = * )
404 WRITE( nout, fmt = 9995 ) eps
405 WRITE( nout, fmt = 9998 ) thresh
412 $
CALL blacs_setup( iam, nprocs )
417 CALL blacs_get( -1, 0, ictxt )
418 CALL blacs_gridinit( ictxt,
'Row-major', 1, nprocs )
422 eps = pslamch( ictxt,
'eps' )
424 CALL sgebr2d( ictxt,
'All',
' ', 1, 1, thresh, 1, 0, 0 )
425 CALL igebr2d( ictxt,
'All',
' ', 6, 1, work, 6, 0, 0 )
431 IF( work( 6 ).EQ.1 )
THEN
437 i = 2*nmat + nnb + nnr + nnbr + 2*ngrids
438 CALL igebr2d( ictxt,
'All',
' ', i, 1, work, i, 0, 0 )
440 CALL icopy( nmat, work( i ), 1, mval, 1 )
442 CALL icopy( nmat, work( i ), 1, nval, 1 )
444 CALL icopy( nnb, work( i ), 1, nbval, 1 )
446 CALL icopy( nnr, work( i ), 1, nrval, 1 )
448 CALL icopy( nnbr, work( i ), 1, nbrval, 1 )
450 CALL icopy( ngrids, work( i ), 1, pval, 1 )
452 CALL icopy( ngrids, work( i ), 1, qval, 1 )
456 CALL blacs_gridexit( ictxt )
460 20
WRITE( nout, fmt = 9993 )
462 IF( nout.NE.6 .AND. nout.NE.0 )
464 CALL blacs_abort( ictxt, 1 )
469 9998
FORMAT(
'Routines pass computational tests if scaled residual ',
470 $
'is less than ', g12.5 )
471 9997
FORMAT(
' ', 10i6 )
472 9996
FORMAT( 2x, a5,
' : ', 10i6 )
473 9995
FORMAT(
'Relative machine precision (eps) is taken to be ',
475 9994
FORMAT(
' Number of values of ',5a,
' is less than 1 or greater ',
477 9993
FORMAT(
' Illegal input in file ',40a,
'. Aborting run.' )