LAPACK  3.5.0
LAPACK: Linear Algebra PACKage
ilaenv.f File Reference

Go to the source code of this file.

Functions/Subroutines

integer function ilaenv (ISPEC, NAME, OPTS, N1, N2, N3, N4)
 ILAENV More...
 

Function/Subroutine Documentation

integer function ilaenv ( integer  ISPEC,
character*( * )  NAME,
character*( * )  OPTS,
integer  N1,
integer  N2,
integer  N3,
integer  N4 
)

ILAENV

Download ILAENV + dependencies [TGZ] [ZIP] [TXT]

Purpose:
 ILAENV is called from the LAPACK routines to choose problem-dependent
 parameters for the local environment.  See ISPEC for a description of
 the parameters.

 ILAENV returns an INTEGER
 if ILAENV >= 0: ILAENV returns the value of the parameter specified by ISPEC
 if ILAENV < 0:  if ILAENV = -k, the k-th argument had an illegal value.

 This version provides a set of parameters which should give good,
 but not optimal, performance on many of the currently available
 computers.  Users are encouraged to modify this subroutine to set
 the tuning parameters for their particular machine using the option
 and problem size information in the arguments.

 This routine will not function correctly if it is converted to all
 lower case.  Converting it to all upper case is allowed.
Parameters
[in]ISPEC
          ISPEC is INTEGER
          Specifies the parameter to be returned as the value of
          ILAENV.
          = 1: the optimal blocksize; if this value is 1, an unblocked
               algorithm will give the best performance.
          = 2: the minimum block size for which the block routine
               should be used; if the usable block size is less than
               this value, an unblocked routine should be used.
          = 3: the crossover point (in a block routine, for N less
               than this value, an unblocked routine should be used)
          = 4: the number of shifts, used in the nonsymmetric
               eigenvalue routines (DEPRECATED)
          = 5: the minimum column dimension for blocking to be used;
               rectangular blocks must have dimension at least k by m,
               where k is given by ILAENV(2,...) and m by ILAENV(5,...)
          = 6: the crossover point for the SVD (when reducing an m by n
               matrix to bidiagonal form, if max(m,n)/min(m,n) exceeds
               this value, a QR factorization is used first to reduce
               the matrix to a triangular form.)
          = 7: the number of processors
          = 8: the crossover point for the multishift QR method
               for nonsymmetric eigenvalue problems (DEPRECATED)
          = 9: maximum size of the subproblems at the bottom of the
               computation tree in the divide-and-conquer algorithm
               (used by xGELSD and xGESDD)
          =10: ieee NaN arithmetic can be trusted not to trap
          =11: infinity arithmetic can be trusted not to trap
          12 <= ISPEC <= 16:
               xHSEQR or one of its subroutines,
               see IPARMQ for detailed explanation
[in]NAME
          NAME is CHARACTER*(*)
          The name of the calling subroutine, in either upper case or
          lower case.
[in]OPTS
          OPTS is CHARACTER*(*)
          The character options to the subroutine NAME, concatenated
          into a single character string.  For example, UPLO = 'U',
          TRANS = 'T', and DIAG = 'N' for a triangular routine would
          be specified as OPTS = 'UTN'.
[in]N1
          N1 is INTEGER
[in]N2
          N2 is INTEGER
[in]N3
          N3 is INTEGER
[in]N4
          N4 is INTEGER
          Problem dimensions for the subroutine NAME; these may not all
          be required.
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Date
November 2011
Further Details:
  The following conventions have been used when calling ILAENV from the
  LAPACK routines:
  1)  OPTS is a concatenation of all of the character options to
      subroutine NAME, in the same order that they appear in the
      argument list for NAME, even if they are not used in determining
      the value of the parameter specified by ISPEC.
  2)  The problem dimensions N1, N2, N3, N4 are specified in the order
      that they appear in the argument list for NAME.  N1 is used
      first, N2 second, and so on, and unused problem dimensions are
      passed a value of -1.
  3)  The parameter value returned by ILAENV is checked for validity in
      the calling subroutine.  For example, ILAENV is used to retrieve
      the optimal blocksize for STRTRI as follows:

      NB = ILAENV( 1, 'STRTRI', UPLO // DIAG, N, -1, -1, -1 )
      IF( NB.LE.1 ) NB = MAX( 1, N )

Definition at line 164 of file ilaenv.f.

164 *
165 * -- LAPACK auxiliary routine (version 3.4.0) --
166 * -- LAPACK is a software package provided by Univ. of Tennessee, --
167 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
168 * November 2011
169 *
170 * .. Scalar Arguments ..
171  CHARACTER*( * ) name, opts
172  INTEGER ispec, n1, n2, n3, n4
173 * ..
174 *
175 * =====================================================================
176 *
177 * .. Local Scalars ..
178  INTEGER i, ic, iz, nb, nbmin, nx
179  LOGICAL cname, sname
180  CHARACTER c1*1, c2*2, c4*2, c3*3, subnam*6
181 * ..
182 * .. Intrinsic Functions ..
183  INTRINSIC char, ichar, int, min, real
184 * ..
185 * .. External Functions ..
186  INTEGER ieeeck, iparmq
187  EXTERNAL ieeeck, iparmq
188 * ..
189 * .. Executable Statements ..
190 *
191  GO TO ( 10, 10, 10, 80, 90, 100, 110, 120,
192  $ 130, 140, 150, 160, 160, 160, 160, 160 )ispec
193 *
194 * Invalid value for ISPEC
195 *
196  ilaenv = -1
197  RETURN
198 *
199  10 CONTINUE
200 *
201 * Convert NAME to upper case if the first character is lower case.
202 *
203  ilaenv = 1
204  subnam = name
205  ic = ichar( subnam( 1: 1 ) )
206  iz = ichar( 'Z' )
207  IF( iz.EQ.90 .OR. iz.EQ.122 ) THEN
208 *
209 * ASCII character set
210 *
211  IF( ic.GE.97 .AND. ic.LE.122 ) THEN
212  subnam( 1: 1 ) = char( ic-32 )
213  DO 20 i = 2, 6
214  ic = ichar( subnam( i: i ) )
215  IF( ic.GE.97 .AND. ic.LE.122 )
216  $ subnam( i: i ) = char( ic-32 )
217  20 CONTINUE
218  END IF
219 *
220  ELSE IF( iz.EQ.233 .OR. iz.EQ.169 ) THEN
221 *
222 * EBCDIC character set
223 *
224  IF( ( ic.GE.129 .AND. ic.LE.137 ) .OR.
225  $ ( ic.GE.145 .AND. ic.LE.153 ) .OR.
226  $ ( ic.GE.162 .AND. ic.LE.169 ) ) THEN
227  subnam( 1: 1 ) = char( ic+64 )
228  DO 30 i = 2, 6
229  ic = ichar( subnam( i: i ) )
230  IF( ( ic.GE.129 .AND. ic.LE.137 ) .OR.
231  $ ( ic.GE.145 .AND. ic.LE.153 ) .OR.
232  $ ( ic.GE.162 .AND. ic.LE.169 ) )subnam( i:
233  $ i ) = char( ic+64 )
234  30 CONTINUE
235  END IF
236 *
237  ELSE IF( iz.EQ.218 .OR. iz.EQ.250 ) THEN
238 *
239 * Prime machines: ASCII+128
240 *
241  IF( ic.GE.225 .AND. ic.LE.250 ) THEN
242  subnam( 1: 1 ) = char( ic-32 )
243  DO 40 i = 2, 6
244  ic = ichar( subnam( i: i ) )
245  IF( ic.GE.225 .AND. ic.LE.250 )
246  $ subnam( i: i ) = char( ic-32 )
247  40 CONTINUE
248  END IF
249  END IF
250 *
251  c1 = subnam( 1: 1 )
252  sname = c1.EQ.'S' .OR. c1.EQ.'D'
253  cname = c1.EQ.'C' .OR. c1.EQ.'Z'
254  IF( .NOT.( cname .OR. sname ) )
255  $ RETURN
256  c2 = subnam( 2: 3 )
257  c3 = subnam( 4: 6 )
258  c4 = c3( 2: 3 )
259 *
260  GO TO ( 50, 60, 70 )ispec
261 *
262  50 CONTINUE
263 *
264 * ISPEC = 1: block size
265 *
266 * In these examples, separate code is provided for setting NB for
267 * real and complex. We assume that NB will take the same value in
268 * single or double precision.
269 *
270  nb = 1
271 *
272  IF( c2.EQ.'GE' ) THEN
273  IF( c3.EQ.'TRF' ) THEN
274  IF( sname ) THEN
275  nb = 64
276  ELSE
277  nb = 64
278  END IF
279  ELSE IF( c3.EQ.'QRF' .OR. c3.EQ.'RQF' .OR. c3.EQ.'LQF' .OR.
280  $ c3.EQ.'QLF' ) THEN
281  IF( sname ) THEN
282  nb = 32
283  ELSE
284  nb = 32
285  END IF
286  ELSE IF( c3.EQ.'HRD' ) THEN
287  IF( sname ) THEN
288  nb = 32
289  ELSE
290  nb = 32
291  END IF
292  ELSE IF( c3.EQ.'BRD' ) THEN
293  IF( sname ) THEN
294  nb = 32
295  ELSE
296  nb = 32
297  END IF
298  ELSE IF( c3.EQ.'TRI' ) THEN
299  IF( sname ) THEN
300  nb = 64
301  ELSE
302  nb = 64
303  END IF
304  END IF
305  ELSE IF( c2.EQ.'PO' ) THEN
306  IF( c3.EQ.'TRF' ) THEN
307  IF( sname ) THEN
308  nb = 64
309  ELSE
310  nb = 64
311  END IF
312  END IF
313  ELSE IF( c2.EQ.'SY' ) THEN
314  IF( c3.EQ.'TRF' ) THEN
315  IF( sname ) THEN
316  nb = 64
317  ELSE
318  nb = 64
319  END IF
320  ELSE IF( sname .AND. c3.EQ.'TRD' ) THEN
321  nb = 32
322  ELSE IF( sname .AND. c3.EQ.'GST' ) THEN
323  nb = 64
324  END IF
325  ELSE IF( cname .AND. c2.EQ.'HE' ) THEN
326  IF( c3.EQ.'TRF' ) THEN
327  nb = 64
328  ELSE IF( c3.EQ.'TRD' ) THEN
329  nb = 32
330  ELSE IF( c3.EQ.'GST' ) THEN
331  nb = 64
332  END IF
333  ELSE IF( sname .AND. c2.EQ.'OR' ) THEN
334  IF( c3( 1: 1 ).EQ.'G' ) THEN
335  IF( c4.EQ.'QR' .OR. c4.EQ.'RQ' .OR. c4.EQ.'LQ' .OR. c4.EQ.
336  $ 'QL' .OR. c4.EQ.'HR' .OR. c4.EQ.'TR' .OR. c4.EQ.'BR' )
337  $ THEN
338  nb = 32
339  END IF
340  ELSE IF( c3( 1: 1 ).EQ.'M' ) THEN
341  IF( c4.EQ.'QR' .OR. c4.EQ.'RQ' .OR. c4.EQ.'LQ' .OR. c4.EQ.
342  $ 'QL' .OR. c4.EQ.'HR' .OR. c4.EQ.'TR' .OR. c4.EQ.'BR' )
343  $ THEN
344  nb = 32
345  END IF
346  END IF
347  ELSE IF( cname .AND. c2.EQ.'UN' ) THEN
348  IF( c3( 1: 1 ).EQ.'G' ) THEN
349  IF( c4.EQ.'QR' .OR. c4.EQ.'RQ' .OR. c4.EQ.'LQ' .OR. c4.EQ.
350  $ 'QL' .OR. c4.EQ.'HR' .OR. c4.EQ.'TR' .OR. c4.EQ.'BR' )
351  $ THEN
352  nb = 32
353  END IF
354  ELSE IF( c3( 1: 1 ).EQ.'M' ) THEN
355  IF( c4.EQ.'QR' .OR. c4.EQ.'RQ' .OR. c4.EQ.'LQ' .OR. c4.EQ.
356  $ 'QL' .OR. c4.EQ.'HR' .OR. c4.EQ.'TR' .OR. c4.EQ.'BR' )
357  $ THEN
358  nb = 32
359  END IF
360  END IF
361  ELSE IF( c2.EQ.'GB' ) THEN
362  IF( c3.EQ.'TRF' ) THEN
363  IF( sname ) THEN
364  IF( n4.LE.64 ) THEN
365  nb = 1
366  ELSE
367  nb = 32
368  END IF
369  ELSE
370  IF( n4.LE.64 ) THEN
371  nb = 1
372  ELSE
373  nb = 32
374  END IF
375  END IF
376  END IF
377  ELSE IF( c2.EQ.'PB' ) THEN
378  IF( c3.EQ.'TRF' ) THEN
379  IF( sname ) THEN
380  IF( n2.LE.64 ) THEN
381  nb = 1
382  ELSE
383  nb = 32
384  END IF
385  ELSE
386  IF( n2.LE.64 ) THEN
387  nb = 1
388  ELSE
389  nb = 32
390  END IF
391  END IF
392  END IF
393  ELSE IF( c2.EQ.'TR' ) THEN
394  IF( c3.EQ.'TRI' ) THEN
395  IF( sname ) THEN
396  nb = 64
397  ELSE
398  nb = 64
399  END IF
400  END IF
401  ELSE IF( c2.EQ.'LA' ) THEN
402  IF( c3.EQ.'UUM' ) THEN
403  IF( sname ) THEN
404  nb = 64
405  ELSE
406  nb = 64
407  END IF
408  END IF
409  ELSE IF( sname .AND. c2.EQ.'ST' ) THEN
410  IF( c3.EQ.'EBZ' ) THEN
411  nb = 1
412  END IF
413  END IF
414  ilaenv = nb
415  RETURN
416 *
417  60 CONTINUE
418 *
419 * ISPEC = 2: minimum block size
420 *
421  nbmin = 2
422  IF( c2.EQ.'GE' ) THEN
423  IF( c3.EQ.'QRF' .OR. c3.EQ.'RQF' .OR. c3.EQ.'LQF' .OR. c3.EQ.
424  $ 'QLF' ) THEN
425  IF( sname ) THEN
426  nbmin = 2
427  ELSE
428  nbmin = 2
429  END IF
430  ELSE IF( c3.EQ.'HRD' ) THEN
431  IF( sname ) THEN
432  nbmin = 2
433  ELSE
434  nbmin = 2
435  END IF
436  ELSE IF( c3.EQ.'BRD' ) THEN
437  IF( sname ) THEN
438  nbmin = 2
439  ELSE
440  nbmin = 2
441  END IF
442  ELSE IF( c3.EQ.'TRI' ) THEN
443  IF( sname ) THEN
444  nbmin = 2
445  ELSE
446  nbmin = 2
447  END IF
448  END IF
449  ELSE IF( c2.EQ.'SY' ) THEN
450  IF( c3.EQ.'TRF' ) THEN
451  IF( sname ) THEN
452  nbmin = 8
453  ELSE
454  nbmin = 8
455  END IF
456  ELSE IF( sname .AND. c3.EQ.'TRD' ) THEN
457  nbmin = 2
458  END IF
459  ELSE IF( cname .AND. c2.EQ.'HE' ) THEN
460  IF( c3.EQ.'TRD' ) THEN
461  nbmin = 2
462  END IF
463  ELSE IF( sname .AND. c2.EQ.'OR' ) THEN
464  IF( c3( 1: 1 ).EQ.'G' ) THEN
465  IF( c4.EQ.'QR' .OR. c4.EQ.'RQ' .OR. c4.EQ.'LQ' .OR. c4.EQ.
466  $ 'QL' .OR. c4.EQ.'HR' .OR. c4.EQ.'TR' .OR. c4.EQ.'BR' )
467  $ THEN
468  nbmin = 2
469  END IF
470  ELSE IF( c3( 1: 1 ).EQ.'M' ) THEN
471  IF( c4.EQ.'QR' .OR. c4.EQ.'RQ' .OR. c4.EQ.'LQ' .OR. c4.EQ.
472  $ 'QL' .OR. c4.EQ.'HR' .OR. c4.EQ.'TR' .OR. c4.EQ.'BR' )
473  $ THEN
474  nbmin = 2
475  END IF
476  END IF
477  ELSE IF( cname .AND. c2.EQ.'UN' ) THEN
478  IF( c3( 1: 1 ).EQ.'G' ) THEN
479  IF( c4.EQ.'QR' .OR. c4.EQ.'RQ' .OR. c4.EQ.'LQ' .OR. c4.EQ.
480  $ 'QL' .OR. c4.EQ.'HR' .OR. c4.EQ.'TR' .OR. c4.EQ.'BR' )
481  $ THEN
482  nbmin = 2
483  END IF
484  ELSE IF( c3( 1: 1 ).EQ.'M' ) THEN
485  IF( c4.EQ.'QR' .OR. c4.EQ.'RQ' .OR. c4.EQ.'LQ' .OR. c4.EQ.
486  $ 'QL' .OR. c4.EQ.'HR' .OR. c4.EQ.'TR' .OR. c4.EQ.'BR' )
487  $ THEN
488  nbmin = 2
489  END IF
490  END IF
491  END IF
492  ilaenv = nbmin
493  RETURN
494 *
495  70 CONTINUE
496 *
497 * ISPEC = 3: crossover point
498 *
499  nx = 0
500  IF( c2.EQ.'GE' ) THEN
501  IF( c3.EQ.'QRF' .OR. c3.EQ.'RQF' .OR. c3.EQ.'LQF' .OR. c3.EQ.
502  $ 'QLF' ) THEN
503  IF( sname ) THEN
504  nx = 128
505  ELSE
506  nx = 128
507  END IF
508  ELSE IF( c3.EQ.'HRD' ) THEN
509  IF( sname ) THEN
510  nx = 128
511  ELSE
512  nx = 128
513  END IF
514  ELSE IF( c3.EQ.'BRD' ) THEN
515  IF( sname ) THEN
516  nx = 128
517  ELSE
518  nx = 128
519  END IF
520  END IF
521  ELSE IF( c2.EQ.'SY' ) THEN
522  IF( sname .AND. c3.EQ.'TRD' ) THEN
523  nx = 32
524  END IF
525  ELSE IF( cname .AND. c2.EQ.'HE' ) THEN
526  IF( c3.EQ.'TRD' ) THEN
527  nx = 32
528  END IF
529  ELSE IF( sname .AND. c2.EQ.'OR' ) THEN
530  IF( c3( 1: 1 ).EQ.'G' ) THEN
531  IF( c4.EQ.'QR' .OR. c4.EQ.'RQ' .OR. c4.EQ.'LQ' .OR. c4.EQ.
532  $ 'QL' .OR. c4.EQ.'HR' .OR. c4.EQ.'TR' .OR. c4.EQ.'BR' )
533  $ THEN
534  nx = 128
535  END IF
536  END IF
537  ELSE IF( cname .AND. c2.EQ.'UN' ) THEN
538  IF( c3( 1: 1 ).EQ.'G' ) THEN
539  IF( c4.EQ.'QR' .OR. c4.EQ.'RQ' .OR. c4.EQ.'LQ' .OR. c4.EQ.
540  $ 'QL' .OR. c4.EQ.'HR' .OR. c4.EQ.'TR' .OR. c4.EQ.'BR' )
541  $ THEN
542  nx = 128
543  END IF
544  END IF
545  END IF
546  ilaenv = nx
547  RETURN
548 *
549  80 CONTINUE
550 *
551 * ISPEC = 4: number of shifts (used by xHSEQR)
552 *
553  ilaenv = 6
554  RETURN
555 *
556  90 CONTINUE
557 *
558 * ISPEC = 5: minimum column dimension (not used)
559 *
560  ilaenv = 2
561  RETURN
562 *
563  100 CONTINUE
564 *
565 * ISPEC = 6: crossover point for SVD (used by xGELSS and xGESVD)
566 *
567  ilaenv = int( REAL( MIN( N1, N2 ) )*1.6e0 )
568  RETURN
569 *
570  110 CONTINUE
571 *
572 * ISPEC = 7: number of processors (not used)
573 *
574  ilaenv = 1
575  RETURN
576 *
577  120 CONTINUE
578 *
579 * ISPEC = 8: crossover point for multishift (used by xHSEQR)
580 *
581  ilaenv = 50
582  RETURN
583 *
584  130 CONTINUE
585 *
586 * ISPEC = 9: maximum size of the subproblems at the bottom of the
587 * computation tree in the divide-and-conquer algorithm
588 * (used by xGELSD and xGESDD)
589 *
590  ilaenv = 25
591  RETURN
592 *
593  140 CONTINUE
594 *
595 * ISPEC = 10: ieee NaN arithmetic can be trusted not to trap
596 *
597 * ILAENV = 0
598  ilaenv = 1
599  IF( ilaenv.EQ.1 ) THEN
600  ilaenv = ieeeck( 1, 0.0, 1.0 )
601  END IF
602  RETURN
603 *
604  150 CONTINUE
605 *
606 * ISPEC = 11: infinity arithmetic can be trusted not to trap
607 *
608 * ILAENV = 0
609  ilaenv = 1
610  IF( ilaenv.EQ.1 ) THEN
611  ilaenv = ieeeck( 0, 0.0, 1.0 )
612  END IF
613  RETURN
614 *
615  160 CONTINUE
616 *
617 * 12 <= ISPEC <= 16: xHSEQR or one of its subroutines.
618 *
619  ilaenv = iparmq( ispec, name, opts, n1, n2, n3, n4 )
620  RETURN
621 *
622 * End of ILAENV
623 *
integer function iparmq(ISPEC, NAME, OPTS, N, ILO, IHI, LWORK)
IPARMQ
Definition: iparmq.f:216
integer function ieeeck(ISPEC, ZERO, ONE)
Definition: tstiee.f:626
integer function ilaenv(ISPEC, NAME, OPTS, N1, N2, N3, N4)
Definition: tstiee.f:83

Here is the call graph for this function: