[Beowulf] programming guidence request

Greg Lindahl lindahl at pbm.com
Fri Jan 23 01:40:25 EST 2009

On Fri, Jan 23, 2009 at 11:03:46AM +0500, amjad ali wrote:

> (1) Which debugger would be easy and effective to use for above?

print *,

> (2) Which of the folliwng two ways of using arrays is more efficient
> with respect to memory and function-call-overheads or other overheads:
>                  (i) We should keep the arrays ALLOCATABLE and then
> before return from the subroutines, DEALLOCATE the local arrays.
>               or (ii) We should keep the local arrays fix-sized as
> much as we can. (Will the memory is deallaocated/freed automatically
> on return from the subroutine?).

In general (ii) is faster: the compiler can generate better code if it
knows the size of the arrays. This is always possible with (ii) and
only sometimes with (i).

With (ii) the memory will be freed on return from the subroutine, with
most modern compilers. With (i) the arrays will also be automagically
freed on exit from the subroutine.

-- greg

Beowulf mailing list, Beowulf at beowulf.org
To change your subscription (digest mode or unsubscribe) visit http://www.beowulf.org/mailman/listinfo/beowulf

This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

More information about the Beowulf mailing list