Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Memory access checking in CVF

Intel_C_Intel
Employee
773 Views
I am a heavy user of Visual FORTRAN under Win2k. On HPUX/Solaris there is a software package called PURIFY that checks for memory errors at run time (access past end of an array, freed memory read, memory leaks etc etc.) This package has been ported to the PC but only for C/C++.

Are you aware of any similar package that will work with CVF under Win2k to check for these types of errors?

Thanks in advance

Please reply via e-mail connell@crd.ge.com
0 Kudos
3 Replies
Jugoslav_Dujic
Valued Contributor II
773 Views
CVF (like all modern Fortran compilers) has built-in checks for:
- access out of array bounds (run-time)
- attempt to write into constant memory (run-time)
- uninitialized variables (compile-time, only partly)
these are all by default on in Debug configurations. Check out switches at Project/Settings/Fortran/Run-time and Fortran data categories. Array bounds checking is IMO especially important; most C/C++ compilers don't have it built-in due to language design -- they don't have arrays, only pointers.

CVF doesn't have built-in memory leak checks. However, due to language design, it's not so easy to make them in Fortran -- the only ways to do it are extensive use of POINTERs and calling C/C++ based functions (including Windows APIs). Most 3rd-party tools which work with Visual C++ should, however, be able to detect such leaks in CVF programs (as CVF and VC++ share C RTL and Win32 libraries, .pdb file format etc).

Jugoslav
0 Kudos
Intel_C_Intel
Employee
773 Views
To clarify things - I am using dynamic memory allocation and cray pointers. i.e.

pointer (ip_x, x(1))
ip_x = malloc(4*100)

I believe the error checking you speak of only applies to fixed size arrays i.e.
dimension x(100)
not dynamic arrays
0 Kudos
Jugoslav_Dujic
Valued Contributor II
773 Views
The error checking applies to:
- static arrays
- ALLOCATABLE arrays
- pointer arrays
- assumed-shape dummy arguments
- Cray target arrays containing DIMENSION statement, i.e.
integer x(4*100); pointer(ip_x, x); ip_x = malloc(4*100)
but not on
- Cray targets with (*) size.
- assumed-size dummy arguments.

If I were you, I would rework all the non-standard crays to standard and portable ALLOCATABLE arrays. I understand, however, that thay may not be an (easy) option.

Jugoslav




0 Kudos
Reply