PLASMA  2.4.5
PLASMA - Parallel Linear Algebra for Scalable Multi-core Architectures
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
alareq.f
Go to the documentation of this file.
1  SUBROUTINE alareq( PATH, NMATS, DOTYPE, NTYPES, NIN, NOUT )
2 *
3 * -- LAPACK test routine (version 3.1) --
4 * Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd..
5 * November 2006
6 *
7 * .. Scalar Arguments ..
8  CHARACTER*3 path
9  INTEGER nin, nmats, nout, ntypes
10 * ..
11 * .. Array Arguments ..
12  LOGICAL dotype( * )
13 * ..
14 *
15 * Purpose
16 * =======
17 *
18 * ALAREQ handles input for the LAPACK test program. It is called
19 * to evaluate the input line which requested NMATS matrix types for
20 * PATH. The flow of control is as follows:
21 *
22 * If NMATS = NTYPES then
23 * DOTYPE(1:NTYPES) = .TRUE.
24 * else
25 * Read the next input line for NMATS matrix types
26 * Set DOTYPE(I) = .TRUE. for each valid type I
27 * endif
28 *
29 * Arguments
30 * =========
31 *
32 * PATH (input) CHARACTER*3
33 * An LAPACK path name for testing.
34 *
35 * NMATS (input) INTEGER
36 * The number of matrix types to be used in testing this path.
37 *
38 * DOTYPE (output) LOGICAL array, dimension (NTYPES)
39 * The vector of flags indicating if each type will be tested.
40 *
41 * NTYPES (input) INTEGER
42 * The maximum number of matrix types for this path.
43 *
44 * NIN (input) INTEGER
45 * The unit number for input. NIN >= 1.
46 *
47 * NOUT (input) INTEGER
48 * The unit number for output. NOUT >= 1.
49 *
50 * =====================================================================
51 *
52 * .. Local Scalars ..
53  LOGICAL firstt
54  CHARACTER c1
55  CHARACTER*10 intstr
56  CHARACTER*80 line
57  INTEGER i, i1, ic, j, k, lenp, nt
58 * ..
59 * .. Local Arrays ..
60  INTEGER nreq( 100 )
61 * ..
62 * .. Intrinsic Functions ..
63  INTRINSIC len
64 * ..
65 * .. Data statements ..
66  DATA intstr / '0123456789' /
67 * ..
68 * .. Executable Statements ..
69 *
70  IF( nmats.GE.ntypes ) THEN
71 *
72 * Test everything if NMATS >= NTYPES.
73 *
74  DO 10 i = 1, ntypes
75  dotype( i ) = .true.
76  10 continue
77  ELSE
78  DO 20 i = 1, ntypes
79  dotype( i ) = .false.
80  20 continue
81  firstt = .true.
82 *
83 * Read a line of matrix types if 0 < NMATS < NTYPES.
84 *
85  IF( nmats.GT.0 ) THEN
86  READ( nin, fmt = '(A80)', END = 90 )line
87  lenp = len( line )
88  i = 0
89  DO 60 j = 1, nmats
90  nreq( j ) = 0
91  i1 = 0
92  30 continue
93  i = i + 1
94  IF( i.GT.lenp ) THEN
95  IF( j.EQ.nmats .AND. i1.GT.0 ) THEN
96  go to 60
97  ELSE
98  WRITE( nout, fmt = 9995 )line
99  WRITE( nout, fmt = 9994 )nmats
100  go to 80
101  END IF
102  END IF
103  IF( line( i: i ).NE.' ' .AND. line( i: i ).NE.',' ) THEN
104  i1 = i
105  c1 = line( i1: i1 )
106 *
107 * Check that a valid integer was read
108 *
109  DO 40 k = 1, 10
110  IF( c1.EQ.intstr( k: k ) ) THEN
111  ic = k - 1
112  go to 50
113  END IF
114  40 continue
115  WRITE( nout, fmt = 9996 )i, line
116  WRITE( nout, fmt = 9994 )nmats
117  go to 80
118  50 continue
119  nreq( j ) = 10*nreq( j ) + ic
120  go to 30
121  ELSE IF( i1.GT.0 ) THEN
122  go to 60
123  ELSE
124  go to 30
125  END IF
126  60 continue
127  END IF
128  DO 70 i = 1, nmats
129  nt = nreq( i )
130  IF( nt.GT.0 .AND. nt.LE.ntypes ) THEN
131  IF( dotype( nt ) ) THEN
132  IF( firstt )
133  $ WRITE( nout, fmt = * )
134  firstt = .false.
135  WRITE( nout, fmt = 9997 )nt, path
136  END IF
137  dotype( nt ) = .true.
138  ELSE
139  WRITE( nout, fmt = 9999 )path, nt, ntypes
140  9999 format( ' *** Invalid type request for ', a3, ', type ',
141  $ i4, ': must satisfy 1 <= type <= ', i2 )
142  END IF
143  70 continue
144  80 continue
145  END IF
146  return
147 *
148  90 continue
149  WRITE( nout, fmt = 9998 )path
150  9998 format( /' *** End of file reached when trying to read matrix ',
151  $ 'types for ', a3, /' *** Check that you are requesting the',
152  $ ' right number of types for each path', / )
153  9997 format( ' *** Warning: duplicate request of matrix type ', i2,
154  $ ' for ', a3 )
155  9996 format( //' *** Invalid integer value in column ', i2,
156  $ ' of input', ' line:', /a79 )
157  9995 format( //' *** Not enough matrix types on input line', /a79 )
158  9994 format( ' ==> Specify ', i4, ' matrix types on this line or ',
159  $ 'adjust NTYPES on previous line' )
160  WRITE( nout, fmt = * )
161  stop
162 *
163 * End of ALAREQ
164 *
165  END