[Beowulf] programming guidence request

Joshua mora acosta joshua_mora at usa.net
Fri Jan 23 01:25:48 PST 2009

Answers inline.


------ Original Message ------
Received: 12:49 AM CST, 01/23/2009
From: amjad ali <amjad11 at gmail.com>
To: Beowulf Mailing List <beowulf at beowulf.org>
Subject: [Beowulf] programming guidence request

> Hello All,
> I am developing my parallel CFD code on a small cluster. My system has
> openmpi installed based on gfortran compiler. Please guide me
> follwing:
> (1) Which debugger would be easy and effective to use for above?
> [Joshua] gdb should be fine
> (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.
[Joshua] i.a) You can face memory fragmentation further down the road on your
computation. i.b) There is a certain amount of time spent in
allocating/deallocating memory. i.c)On the other hand you keep your memory
utilization as low as you can so you can run bigger problems.
>               or (ii) We should keep the local arrays fix-sized as
[Joshua] negative versions of i: ii.a) You don't fave memory fragmentation.
ii.b) You don't spend time in allocate/deallocate. ii.c) But your memory
utilization will prevent you from running larger problems.
> much as we can. 
[Joshua] Overall answer: you have to have some time critical/memory
fragmentation parts with fixed memory. The rest allocate/deallocate. You won't
know a priori which parts are those. Build the software, get to do runs and
the experience will tell you how to improve the code.
Think perhaps in having your own memory manager where you get to use a generic
array (eg. scalar array (for P,T), vector array (for U,V,W) )for the different
auxiliar data manipulation so you don;t have to allocate/deallocate many,many
Do not make your code "tightly integrated" otherwise, changes like the ones we
are talking are harder to do (worst case scenario, you restart from scratch).
It is normal to rewrite code many times until you find something it makes
(Will the memory is deallaocated/freed automatically
> on return from the subroutine?). 
[Joshua] you have to explicitly deallocate.Even in C++ you have to do that in
the definition of your destructor.
> Thanks.
> with best regards,
> Amjad Ali.
> _______________________________________________
> Beowulf mailing list, Beowulf at beowulf.org
> To change your subscription (digest mode or unsubscribe) visit

More information about the Beowulf mailing list