Re: Who uses clapack?

From: Jan Vorbrüggen (jvorbrueggen-not_at_mediasec.de)
Date: 12/13/04


Date: Mon, 13 Dec 2004 11:57:02 +0100


> Ok, it's clear where this use of temporaries comes from. However, it's
> not clear that dynamic allocation is the best solution. If your routine
> is called once, with a large dataset, then it could do its own
> alloation. However, if the routine is called a large number of times
> with the same small problem size, then you want to do the allocation
> outside it.

Just so. What I did in 187.facerec was to provide the storage by the caller
in form of an allocatable array*, and the called routined checked whether it
was 1) allocated and 2) of the proper size; if either of those conditions
was not met, it would (re-)allocate at that proper size.

Also, I believe some interfaces of that era - for instance, FFTPACK - used
the work arrays to store data structures describing the operation, or some
tables of constants, into them. These have more natural solutions in F95
that are much easier to use.

* I used POINTERs because most compilers didn't implement the ALLOCTABLE TR
at the time - I'm not even sure it was an official TR yet...Nowadays, used
ALLOCATABLE dummy arguments is the method of choice in almost all cases, IMO.

        Jan



Relevant Pages

  • Re: Who uses clapack?
    ... > which do not support dynamic memory allocation? ... not clear that dynamic allocation is the best solution. ... if the routine is called a large number of times ... www cs utk edu tilde lastname ...
    (comp.lang.fortran)
  • Re: Who uses clapack?
    ... > which do not support dynamic memory allocation? ... not clear that dynamic allocation is the best solution. ... if the routine is called a large number of times ... www cs utk edu tilde lastname ...
    (sci.math.num-analysis)
  • Re: Crash of dlincg
    ... is not allocation for the return inverse but the working space inside ... the routine itself so allocating that memory a priori isn't going to ... memory for the work arrays outside the routine and pass it by using the ... application to be able to allocate this work space, ...
    (comp.lang.fortran)
  • Re: Who uses clapack?
    ... > not clear that dynamic allocation is the best solution. ... if the routine is called a large number of times ... in form of an allocatable array*, and the called routined checked whether it ... it would allocate at that proper size. ...
    (sci.math.num-analysis)
  • Re: Freeing memory - will it be available immediately
    ... The proper answer is that, according to the text of the standard, ... According to your interpretation of the somewhat ambiguous phrase ... properly free'd is made available for "further allocation". ...
    (comp.lang.c)

Loading