1TSTIEE ‐ called from the LAPACK routines to choose problem‐depen‐
2dent parameters for the local environment PROGRAM MAIN
3    INTEGER ILAENV
4    EXTERNAL ILAENV
5    INTEGER IEEEOK
6    WRITE( 6, FMT = * ) 'We are about to check  whether  infinity
7arithmetic'
8    WRITE( 6, FMT = * )'can be trusted. If this test hangs, set'
9    WRITE(  6,  FMT  =  *  )  'ILAENV  =  0 for ISPEC = 10 in LA‐
10PACK/SRC/ilaenv.f'
11    IEEEOK = ILAENV( 10, 'ILAENV', 'N', 1, 2, 3, 4 )
12    WRITE( 6, FMT = * )
13    IF( IEEEOK.EQ.0 ) THEN
14    WRITE( 6, FMT = * ) 'Infinity arithmetic did not perform  per
15the ieee spec'
16    ELSE
17    WRITE( 6, FMT = * ) 'Infinity arithmetic performed as per the
18ieee spec.'
19    WRITE( 6, FMT = * ) 'However, this is not an exhaustive  test
20and does not'
21    WRITE( 6, FMT = * ) 'guarantee that infinity arithmetic meets
22the', ' ieee spec.'
23    END IF
24    WRITE( 6, FMT = * )
25    WRITE( 6, FMT = * ) 'We are about to check whether NaN arith‐
26metic'
27    WRITE( 6, FMT = * )'can be trusted. If this test hangs, set'
28    WRITE(  6,  FMT  =  *  )  'ILAENV  =  0 for ISPEC = 11 in LA‐
29PACK/SRC/ilaenv.f'
30    IEEEOK = ILAENV( 11, 'ILAENV', 'N', 1, 2, 3, 4 )
31    WRITE( 6, FMT = * )
32    IF( IEEEOK.EQ.0 ) THEN
33    WRITE( 6, FMT = * ) 'NaN arithmetic did not perform  per  the
34ieee spec'
35    ELSE
36    WRITE(  6,  FMT  =  *  )'NaN  arithmetic performed as per the
37ieee', ' spec.'
38    WRITE( 6, FMT = * ) 'However, this is not an exhaustive  test
39and does not'
40    WRITE( 6, FMT = * )'guarantee that NaN arithmetic meets the',
41' ieee spec.'
42    END IF
43    WRITE( 6, FMT = * )
44    END
45    INTEGER FUNCTION ILAENV( ISPEC, NAME, OPTS, N1, N2, N3, N4 )
46    CHARACTER*( * ) NAME, OPTS
47    INTEGER ISPEC, N1, N2, N3, N4 ILAENV is called from  the  LA‐
48PACK  routines to choose problem‐dependent parameters for the lo‐
49cal environment.  See ISPEC for a description of the parameters.
50
51This version provides a set of parameters which should give good,
52but  not  optimal, performance on many of the currently available
53computers.  Users are encouraged to modify this subroutine to set
54the  tuning parameters for their particular machine using the op‐
55tion and problem size information in the arguments.
56
57This routine will not function correctly if it  is  converted  to
58all lower case.  Converting it to all upper case is allowed.
59
60ISPEC   (input) INTEGER Specifies the parameter to be returned as
61the value of ILAENV.  = 1: the optimal blocksize; if  this  value
62is  1,  an unblocked algorithm will give the best performance.  =
632: the minimum block size for which the block routine  should  be
64used;  if  the  usable block size is less than this value, an un‐
65blocked routine should be used.  = 3: the crossover point  (in  a
66block  routine,  for N less than this value, an unblocked routine
67should be used) = 4: the number of shifts, used in the nonsymmet‐
68ric  eigenvalue  routines  =  5: the minimum column dimension for
69blocking to be used; rectangular blocks must  have  dimension  at
70least  k  by  m,  where  k  is  given  by  ILAENV(2,...) and m by
71ILAENV(5,...)  = 6: the crossover point for the SVD (when  reduc‐
72ing an m by n matrix to bidiagonal form, if max(m,n)/min(m,n) ex‐
73ceeds this value, a QR factorization is used first to reduce  the
74matrix to a triangular form.)  = 7: the number of processors
75= 8: the crossover point for the multishift QR and QZ methods for
76nonsymmetric eigenvalue problems.  = 9: maximum size of the  sub‐
77problems at the bottom of the computation tree in the divide‐and‐
78conquer algorithm (used by  xGELSD  and  xGESDD)  =10:  ieee  NaN
79arithmetic can be trusted not to trap
80=11:  infinity arithmetic can be trusted not to trap NAME    (in‐
81put) CHARACTER*(*) The name of the calling subroutine, in  either
82upper  case  or  lower  case.   OPTS    (input) CHARACTER*(*) The
83character options to the subroutine  NAME,  concatenated  into  a
84single  character  string.  For example, UPLO = 'U', TRANS = 'T',
85and DIAG = 'N' for a triangular routine  would  be  specified  as
86OPTS = 'UTN'.  N1      (input) INTEGER N2      (input) INTEGER N3
87(input) INTEGER N4      (input) INTEGER  Problem  dimensions  for
88the subroutine NAME; these may not all be required.
89
90>=  0:  the  value  of  the parameter specified by ISPEC < 0:  if
91ILAENV = ‐k, the k‐th argument had an illegal value.  The follow‐
92ing  conventions  have been used when calling ILAENV from the LA‐
93PACK routines:
941)  OPTS is a concatenation of all of the character options to
95    subroutine NAME, in the same order that they appear in the
96    argument list for NAME, even if they are not used  in  deter‐
97mining
98    the value of the parameter specified by ISPEC.
992)   The  problem  dimensions N1, N2, N3, N4 are specified in the
100order
101    that they appear in the argument list for NAME.  N1 is used
102    first, N2 second, and so on, and  unused  problem  dimensions
103are
104    passed a value of ‐1.
1053)  The parameter value returned by ILAENV is checked for validi‐
106ty in
107    the calling subroutine.  For example, ILAENV is used  to  re‐
108trieve
109    the optimal blocksize for STRTRI as follows:
110
111    NB = ILAENV( 1, 'STRTRI', UPLO // DIAG, N, ‐1, ‐1, ‐1 )
112    IF( NB.LE.1 ) NB = MAX( 1, N )
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
Impressum