VBET Performance Issues #633
-
This is mainly for @KellyMWhitehead and @philipbaileynar but @joewheaton might find it interesting too. EDIT: I was really wrong about this. I didn't realize that VBET had crashed immediately after the layer path calcs so these numbers don't include all the rest of VBET (which is significant). I'll update the ticket when this finally completes. TL;DR:
The problem
Possible solutions
Deep dive:Why is it taking so long? Where is the time being spent? Generally: Calculating individual level paths Inside the level path calculation it breaks down like this: When we chart processing time against ascending path length we get an exponential curve. This is the part that has me worried. You can see that calculating centerlines is the chief offender. Here's a rough histogram of how the level path lengths are distributed There's some good news though. The next chart shows that there's nothing increasing from one iteration to the next. If this chart were ticking up over time it would indicate a memory leak or something that gets recursively harder as we do more of them GIS StuffI also imported my debug stats into QGIS and married it to the flowlines so we can see where the problems exist (For 17060304 there aren't that many problems but in my next HUC this will be more revalatory) Here are all the VBET errors labeled by type. Green is pass, red is fail. The reason you don't see any red lines are that they are tiny. The error label is there just to show you how many there are and that they exist. Edit: Talking with @philipbaileynar I realized the red isn't necessarily an error. The red COULD represent level paths we don't need to calculate and thus discard. Here are all the level paths assigned random colors so we can see where they are. Here are the calculation times heatmap Here is a level path length heatmap Notes and resources:
|
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 8 replies
-
Just talked to Philip and we discussed strategy:
|
Beta Was this translation helpful? Give feedback.
-
@MattReimer I love this ticket. Super, super interesting and informative. I am following the basic logic of lets do everything we can in raster space and I love it...
I am really confused though by the centerline thing. You say this is taking forever because it is using vornoi polygons, but @philipbaileynar came up with a really cool raster based way of deriving centerlines for each level path, based on i) a Euclidian distance (i.e. raster) from the edge clipped to inside the valley bottom mask (also know reason that mask can't stay as a raster mask instead of being converted to vector one), and ii) a least-cost path analysis (i.e. also raster), and then only converting the path from raster to polyline at the end. If this isn't what we're doing, why aren't we? It made a ton of sense back then and I don't know why we wouldn't do something different. |
Beta Was this translation helpful? Give feedback.
-
I am also a little confused on how many level paths you are running things for. The test HUC might not be a great one for big enough, but can someone confirm what I thought we were doing (or where I have it wrong):
If that is the case, for a bunch of watersheds it seems like we should be getting rid of a lot of levelpaths representing the side channels and canals and such (BTW... can't we just remove ALL canals and perhaps connectors from consideration)? So it seems like you might start with a lot (e.g. 6674 like you pointed out), but then for those with bigger valley bottoms, after the first pass through, it decreases off a lot (maybe down to 50%? I don' t know) until we start getting to the smaller level paths that don't really have much? What am I missing? I think we should be reporting for ourselves some diagnostics (much like your graphs above), but also things like:
|
Beta Was this translation helpful? Give feedback.
-
Ok. I'm marking this discussion "answered" because we've gotten VBET as fast as possible given the week we had to work on it. Note that the warehouse links above may stop working as we delete these projects and replace them with new ones. I'm creating a new discussion for the results of this work. |
Beta Was this translation helpful? Give feedback.
Ok. I'm marking this discussion "answered" because we've gotten VBET as fast as possible given the week we had to work on it.
Note that the warehouse links above may stop working as we delete these projects and replace them with new ones. I'm creating a new discussion for the results of this work.