[FLASH-USERS] [EXT] debugging

Marissa B. P. Adams madams at pas.rochester.edu
Tue Feb 9 08:49:20 EST 2021


Hi Maksim,

Much is up to you and how you like to do things. People will message the
user-list when they've encountered a specific error, and often they will
post the standard output, as well as a detailed explanation for what
happened upon encountering said error. You'll see below that I describe a
workflow, and those aforementioned messages to the user-list usually
come up with people who are struggling between steps (2)-(4).

When it comes to debugging any executable, personally I am a fan of using
gdb (https://www.gnu.org/software/gdb/).  However you may want to make a
certificate for gdb to work on your system (thinking of Mac OS here). It
depends what you like. I find this debugger to be the most natural one to
use.

The workflow for this is quite simple at a glance, but the process can take
anywhere from a couple minutes to months depending on your problem:

(0) all the things that go into writing the code

(1) set it up using the pertinent set up commands for flash4 (there is also
the -debug setup command and the -verbose=DEBUG (see user manual*)) and
make sure you have the relevant flags in your *Makefile.h.*

(2) make the executable in the "object" directory

(3) debug the errors from the make if there are any

(4) run the flash4 executable... if there are errors at runtime, this is
where gdb comes into play, and the cycle (0)-(4) repeats itself until there
are no errors at runtime. At runtime you'll see the time steps, as well as
the location of the cell that is causing the code to work the hardest (i.e.
smallest time step), when a file is outputted, as well as when refinement
is done, among other things. You can also code in prints at (0), for
instance, by using the *Simulation_adjustEvolution.F90* routine. If there
are no errors during runtime,

(5) I track my output to see if it looks as expected using VisIt (
https://wci.llnl.gov/simulation/computer-codes/visit) or whatever
visualization software I use that I feel most comfortable with. Errors in
(5) aren't "errors" in the computational sense, but require physical &
numerical understanding of what your routines are doing and whether or not
the output is reasonable, and to what extent. Depending on what you see,
you may need to start from (0) again. This is a method of observing the
variables you are calculating. There are also the integrated factors that
get spit out for each time step in a log file.


Overall it's a long and iterative process, so don't get discouraged. It's
good to ask questions and ask for help as needed and just try your best.

Apologies if my email is too general, feel free to get more specific and
more people may be able to chim in too.

Best,
Marissa

* If you're overwhelmed by the user manual, which is understandable, I
recommend just cmd+F-ing the PDF document for whatever you're interested
in. For instance if I do so with the word, "debug" there are 58 hits for
that string.

On Mon, Feb 8, 2021 at 11:59 PM Maksim Kozlov <maksim.kozlov at nu.edu.kz>
wrote:

> Dear Friends,
> I am very new to Flash code so my questions could be naive. Yet I was not
> able to find any information on this in user's guide and so would really
> appreciate your help on this. My question is how do I debug Flash
> application. I know that I need to use -debug option during setup but then
> what? How can I track execution, current values of variables and so on?
> many thanks
> MAksim
>
>
> <https://urldefense.proofpoint.com/v2/url?u=https-3A__www.avast.com_sig-2Demail-3Futm-5Fmedium-3Demail-26utm-5Fsource-3Dlink-26utm-5Fcampaign-3Dsig-2Demail-26utm-5Fcontent-3Dwebmail&d=DwMFaQ&c=kbmfwr1Yojg42sGEpaQh5ofMHBeTl9EI2eaqQZhHbOU&r=wlIj2Wk5AYR_utqRRqN2OpI1nykd7sy-UZesSWABUiw&m=XKtD_5m3-Vq_V1kvzg6BgwDNHYM5MFVk7Vq1IIK0vZk&s=v2EANEgZ6ocfQOI4Xfc4bJUBfuIcQTDcfSqbQP2-JTQ&e=> Без
> вирусов. www.avast.com
> <https://urldefense.proofpoint.com/v2/url?u=https-3A__www.avast.com_sig-2Demail-3Futm-5Fmedium-3Demail-26utm-5Fsource-3Dlink-26utm-5Fcampaign-3Dsig-2Demail-26utm-5Fcontent-3Dwebmail&d=DwMFaQ&c=kbmfwr1Yojg42sGEpaQh5ofMHBeTl9EI2eaqQZhHbOU&r=wlIj2Wk5AYR_utqRRqN2OpI1nykd7sy-UZesSWABUiw&m=XKtD_5m3-Vq_V1kvzg6BgwDNHYM5MFVk7Vq1IIK0vZk&s=v2EANEgZ6ocfQOI4Xfc4bJUBfuIcQTDcfSqbQP2-JTQ&e=>
> <#m_4109206401418273965_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://flash.rochester.edu/pipermail/flash-users/attachments/20210209/c4adbf13/attachment.htm>


More information about the flash-users mailing list