Replies: 3 comments
-
Can you show the code where you run |
Beta Was this translation helpful? Give feedback.
-
Sure! I put it in a lapply function to run across the absorption scenarios. I used the exact same code for visitation, just swapping out the function.
|
Beta Was this translation helpful? Give feedback.
-
Have you tried creating just a single samc object, running visitation once and timing it, and then running dispersal once and timing it to see if they are similar?
My best guess right now is that your timings, especially if it's predicted rather than measured, are being confounded by the caching system. So if you happened to run visitation or certain other metrics before the apply, then when the apply runs, it could be using the cached data and running substantially faster. if you didn't do the same for dispersal and the apply was the first time dispersal is run, then it doesn't have the cached data to use. I've seen the caching system generally reduce the time for additional runs by about 98%. 7 minutes is about a 97% reduction from 4 hrs, which seems to support the caching hypothesis. |
Beta Was this translation helpful? Give feedback.
-
Hey Andrew,
Hope all is well with you!
I had a couple questions about calculating
visitation
anddispersal
metrics under different absorption states. I have 4 absorption states and I would like to calculate these metrics under each one--independently--using the*(origin, dest)
parameterization (with roughly 30 origin-destination pairings). When I run visitation, the whole lot takes no longer than 7 minutes, but dispersal takes about 3-4 hours (if it doesn't crash or hang-up indefinitely).I noticed that, in your performance vignette, visitation and dispersal under the origin-dest parameterization, computation times should be approximately equivalent. Is that true, or was that an artifact of the old benchmarking tool?
Currently, I'm creating a new samc object for each absorption scenario and running them separately So, I'm wondering if this is what's causing the long runtimes (e.g., no diagonal caching or excess samc objects in my environment). Should I instead create a multiple absorption samc object and calculate those metrics from? If so, would that give me dispersal/absorption independent of other absorption states?
If you have any suggestions on how I could make this analysis more efficient, I would be really glad to hear them!
All my best,
-Alex.
Beta Was this translation helpful? Give feedback.
All reactions