Repository navigation
Parallelize cloud generation in export/view clouds dialog and rtabmap-export - #1757
Conversation
27976f3 to
5dc9c63
Compare
fallenmi
left a comment
There was a problem hiding this comment.
Disclosure: I used Codex to assist with this review and verified the result against exact commit be7714e7b8b5a0d14e52bd2f2ad5cfb7db2ea880.
I traced both parallel refactors against base d4940634: the GUI keeps subtraction filtering on its sequential path and publishes every other result atomically before flushing it in node order, while the CLI performs only per-node loading/generation in parallel and preserves node order for cloud assembly, pose/GPS/grid accumulation, counters, and progress.
A focused OpenMP oracle exercised 3,000 randomized 1/2/4/8-thread ordering and cancellation cases in both normal and ASan/UBSan builds; all passed. The current GitHub merge b51f4dc2 contains the same versions of all three changed files, and the exact-head upstream matrix is green across 25 executed jobs, with one dependency job intentionally skipped. I found no blocking issue.
…ads option (default max cores) for CLI and UI.
|
I reviewed more deeply and did some minor changes (matching commits above):
Experiment: I used combined
Commands used: # Assemble
$ rtabmap-reprocess --Optimizer/GravitySigma 0.3 --Mem/UseOdomGravity true "chalet1.db;chalet2.db;chalet3.db;chalet4.db" merged.db
# Processing with 1 thread (like before)
rtabmap-export --threads 1 --texture --texture_size 4096 --texture_range 3 --poisson_depth 9 --max_polygons 500000 --multiband --color_radius 0 --no_clean merged.db
# Processing with 16 threads (default is 0 -> auto)
rtabmap-export --threads 0 --texture --texture_size 4096 --texture_range 3 --poisson_depth 9 --max_polygons 500000 --multiband --color_radius 0 --no_clean merged.dbOne downside for texturing is that there is a 50 MB overhead per thread. So 16 threads means 15*50MB=750MB overhead in RAM. For only cloud generation, the penalty in RAM usage is way less. |
Take upstream's export-cloud parallelization (introlab#1757) and proximity BFS (introlab#1756), keeping easy-priors anchor-point and optimizer work.
This PR multi threads the cloud generation when exporting from the DB viewer or using the CLI export tool. Only the cloud generation is affected, the cloud assembly is still sequential.
With 32 threads it's a 16x speedup for me, very significant as I have databases with lots of nodes in them and the cloud export takes a long time. The output should be identical to the existing implementation.
The diff is a bit noisy because all the properties needed for cloud exports have been extracted to a separate data object. That's done because I'm worried about interacting with the Qt widget values on a different thread, but maybe it's fine. Open to suggestions for better ways of doing this!