[Info-vax] problems allocating "large" arrays in OpenVMS-Fortran

hb end.of at inter.net
Tue Oct 29 16:35:26 EDT 2013


On 10/29/2013 08:10 PM, Simon Clubley wrote:
> On 2013-10-29, Joukj <joukj at hrem.nano.tudelft.nl> wrote:
>> In the mean time I figured out that for 1-dimensional arrays, I can use 
>> Dec-Pointers and LIB$GET_VM_64.
>>
>> I have no idea how to get multt-dimensional arrays working without much 
>> code-change.
>>
> 
> Did you try running SDA as I suggested to see where the memory is being
> allocated to within the virtual address space when using the builtin
> Fortran intrinsic ?

Hmm, the "already allocated" one from the error message:
%FOR-F-INVREALLOC, allocatable array is already allocated
?

The OP asked FORTRAN to dynamically allocate (a big chunk of) memory,
named 'size_array', so that the OP can easily address the data within
the FORTRAN program. The FORRTL tries to, but fails with INVREALLOC.
With the given !DEC$ATTRIBUTES ADDRESS64 for size_array there is very
likely a 64bit call to allocate/map the memory...

> It would be interesting to see if it's P0 space or not.
... and it is very likely that it is for P2. Again, that call or
something else fails so the FORRTL decides to terminate the image. You
can try the debugger and/or intercept any lib$ call, but without the
FORRTL sources you may not really be able to determine the root cause of
the error nor fix it.

> Alternatively, are there any intrinsics or other facilities within
> Fortran to see the base address of the allocated memory ?
I don't see how this can be done when allocation failed.

The error message indicates that there is another instance of the same
array already allocated/mapped, but there is only one 'allocate' in the
shown source. This looks more like a FORRTL problem.

An alternative may be to use a static array, which FORTRAN will happily
place into a 64bit PSECT which as a program segment will be mapped in P2.



More information about the Info-vax mailing list