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: Name of a programs library
    ... I do not know the DDNAME that TSO CALL uses for the pgmlib allocation, ... ***routine LOCDEBS locates the DEB for all datasets allocated to the region and saves the addresses in a table along with the DDNAME corresponding to the DEB. ...
    (bit.listserv.ibm-main)
  • 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)
  • segmentation fault caused by allocate memory in a loop?
    ... my guess is that SIGSEGV is caused by memory allocation in a loop. ... Get the variable array jac by subroutine radiance_function, ... IV can be evaluated by the routine DRN2G, ...
    (comp.lang.fortran)
  • 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)