Re: Who uses clapack?

From: Jentje Goslinga (goslinga_at_telus.net)
Date: 12/12/04


Date: Sun, 12 Dec 2004 18:07:07 GMT


Ron Shepard wrote:
> In article <slrncroaij.tik.romanNOSPAM@theta1.cft.edu.pl>,
> Roman Werpachowski <"r o m a nNOSPAM"@theta1.cft.edu.pl> wrote:
>
>
>>The only sensible way would be to have two functions: one which does the
>>allocation, another which does not. The problem is, that sometimes one
>>can flexibly choose a work space area, like in (D,S)SYEV routine. Small
>>workspace conserves memory but large workspace gives better convergence.
>>Which options should the self-allocating version of (D,S)SYEV choose?
>
>
> Modern Fortran

?

  allows optional arguments, so the "sensible" way in
> that language would be to specify the workspace with an optional
> array. If specified during the call, then it is used, otherwise the
> subroutine allocates its own workspace. Of course, this puts
> additional burdens on other languages in cross-language projects to
> support the fortran calling conventions.

They already have to deal with the calling conventions, many
of which are not even defined by the Fortran language.

   BTW, fortran also allows
> the call to use a generic name (e.g. call syev() in the above
> example), which is resolved to the specific precision based on the
> data types of its arguments, in order to eliminate the (D,S)
> portability problems when moving code between machines.

Hmmm.

> $.02 -Ron Shepard

I am sorry, but this advice is not worth two cents in my opinion.
Functions should be self-contained and allocate local storage.
If they really perform so little actual work that this is a
concern, then maybe the program is not structured optimally.
Variable arguments are another dubious language feature which
made its way into the C language because of the requirement of
the formatted print functions, but it causes problems.

Esoteric language "features" like variable arguments and "multiple
returns" should be avoided if at all possible.

Jentje Goslinga



Relevant Pages

  • Re: Who uses clapack?
    ... >>allocation, another which does not. ... >>workspace conserves memory but large workspace gives better convergence. ... > support the fortran calling conventions. ... of which are not even defined by the Fortran language. ...
    (sci.math.num-analysis)
  • Re: OT: Lost in Translation
    ... C that aren't even thought of in Fortran (like dynamic allocation). ... So if a language gives you the Big Three control structures, ... also cannot do dynamic allocation in Fortan, nor even emulate it. ...
    (soc.culture.jewish.moderated)
  • Re: Who uses clapack?
    ... > allocation, another which does not. ... > workspace conserves memory but large workspace gives better convergence. ... that language would be to specify the workspace with an optional ... support the fortran calling conventions. ...
    (comp.lang.fortran)
  • Re: Who uses clapack?
    ... > allocation, another which does not. ... > workspace conserves memory but large workspace gives better convergence. ... that language would be to specify the workspace with an optional ... support the fortran calling conventions. ...
    (sci.math.num-analysis)
  • Re: subroutine stack and C machine model
    ... key distinction between the language and the code. ... of the dynamic allocation system's functions, ... No. Evidence of that would be writing clearly and effectively, ...
    (comp.lang.c)