r-barnes / Barnes2019-DepressionHierarchy

Fast handling of depressions in flow graphs
MIT License
9 stars 7 forks source link

Test: code aborted after successfully producing output #7

Closed awickert closed 4 years ago

awickert commented 4 years ago

I installed the prereqs and compiled the software no problem with the README information -- excellent!

I then created a test case with a DEM of my favorite place as a kid:

./build/dephier.exe AWtest/BCwest.tif AWtest/testOut AWtest/testDH 0

It ran well -- all outputs look fine -- but ended with an abort:

./build/dephier.exe AWtest/BCwest.tif AWtest/testOut AWtest/testDH 0
m Processing    = AWtest/BCwest.tif
m Output prefix = AWtest/testOut
m Output graph  = AWtest/testDH
m Ocean level   = 0
m Data width  = 130
m Data height = 170
m Data cells  = 22100
##########Getting depression hierarchy
p Adding ocean cells to priority-queue...
p Finding pit cells...
t Pit cells found in = 0.0 s
p Searching for outlets...
t Outlets found in = 0.0 s
p Constructing hierarchy from outlets...
t Time to construct Depression Hierarchy = 0.1 s
p Calculating depression marginal volumes...
p Calculating depression total volumes...
t Time to calculate volumes = 0.0 s
t Total time in depression hierarchy calculations = 0.1 s
p Moving surface water downstream...
t FlowInDepressionHierarchy: Surface water = 0.0 s
t FlowInDepressionHierarchy: Overflow time = 0.0
p Finding filled...
t FlowInDepressionHierarchy: Fill time = 0.0 s
t FlowInDepressionHierarchy = 0.0 s
Finished
IO time   = 0.13301
3 s
double free or corruption (out)
Aborted (core dumped)

Files: AWtest.zip

r-barnes commented 4 years ago

Are you running the latest? My dephier.exe takes only 3 inputs and didn't crash.

awickert commented 4 years ago

Ignore my comments for a moment! I didn't realize that I was on my branch, which is a bit out of date. Give me ~5 minutes to update and revise/close.

awickert commented 4 years ago

Your version compiled and running. Updates:

  1. ./build/dephier.exe <Input> <Output> <OutGraph> <Ocean Level> does not seem to work, as stated on the README. It seems that instead it is ./build/dephier.exe <Input> <Output> <Ocean Level>.

  2. The output is not appearing.

  3. My runs are still ending with:

    double free or corruption (out)
    Aborted (core dumped)
r-barnes commented 4 years ago

Okay, <OutGraph> should probably be removed from README.md, unless you think we should have that output in the test executable.

The following works for me:

./build/dephier.exe AWtest/BCwest.tif AWtest/testOut 0
r-barnes commented 4 years ago

Suggest you compile with cmake -DCMAKE_BUILD_TYPE=Debug and then run with gdb to catch the problem.

awickert commented 4 years ago

Kerry's test file; is this a library that I'm missing?

(gdb) run ./build/dephier.exe test_cases/kerry_test1.dem AWtest/outtest 0
Starting program: /home/awickert/dataanalysis/Barnes2019-DepressionHierarchy/build/dephier.exe ./build/dephier.exe test_cases/kerry_test1.dem AWtest/outtest 0
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Syntax: /home/awickert/dataanalysis/Barnes2019-DepressionHierarchy/build/dephier.exe <Input> <Output> <Ocean Level>
double free or corruption (out)

Program received signal SIGABRT, Aborted.
__GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
51  ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
r-barnes commented 4 years ago

No, that's just where the code stopped. Type bt to get a backtrace and then up until you get into the DH code.

awickert commented 4 years ago

Highest-level error seems to be from libproj. I'm on my laptop; going to retest on desktop with newer version of Ubuntu and libraries.

awickert commented 4 years ago

Yes; was simply outdated gdal/proj/something. Thanks for the debugging walkthrough!

awickert commented 4 years ago

Closed until I realized that there remain two related and unresolved issues:

  1. Exporting the DH graphs. Are we doing this? I think that it's one of the most useful pieces of information from the DH, though we could -- as you suggest -- view the executable as just a demo.
  2. Indeed, no outputs seem to be written anymore, even though an input file name is required to run the DH. So this should be fixed in some way or another.
speleophysics commented 4 years ago

After fixing my compilation problems, I also tried running BCwest.tif. I'm getting the same behavior. Runs fine, or at least with no error messages. No output files are created.

r-barnes commented 4 years ago

Okay, the outputs had got dropped somehow. I've added them back. @awickert: DH graphs are output now as well.

awickert commented 4 years ago

Everything is now working for me, and the output graph looks good.