{"id":50554982,"url":"https://github.com/bigmat18/distributed-qem-simplification","last_synced_at":"2026-06-04T06:02:40.176Z","repository":{"id":308585383,"uuid":"1033314601","full_name":"bigmat18/distributed-qem-simplification","owner":"bigmat18","description":"Parallel and distributed mesh simplification using Quadric Error Metrics (QEM), designed for large-scale 3D models.","archived":false,"fork":false,"pushed_at":"2026-03-29T00:56:28.000Z","size":18357,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-29T03:44:13.474Z","etag":null,"topics":["computer-graphics","cpp","mesh-processing","mpi","numa","openmp"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bigmat18.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-08-06T16:10:49.000Z","updated_at":"2026-03-29T01:53:39.000Z","dependencies_parsed_at":"2025-08-06T19:36:26.615Z","dependency_job_id":null,"html_url":"https://github.com/bigmat18/distributed-qem-simplification","commit_stats":null,"previous_names":["bigmat18/distributed-mesh-simplification","bigmat18/distributed-qem-simplification"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bigmat18/distributed-qem-simplification","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bigmat18%2Fdistributed-qem-simplification","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bigmat18%2Fdistributed-qem-simplification/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bigmat18%2Fdistributed-qem-simplification/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bigmat18%2Fdistributed-qem-simplification/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bigmat18","download_url":"https://codeload.github.com/bigmat18/distributed-qem-simplification/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bigmat18%2Fdistributed-qem-simplification/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33891733,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-04T02:00:06.755Z","response_time":64,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["computer-graphics","cpp","mesh-processing","mpi","numa","openmp"],"created_at":"2026-06-04T06:02:38.782Z","updated_at":"2026-06-04T06:02:40.170Z","avatar_url":"https://github.com/bigmat18.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Distributed QEM Simplification\n\n## 1\\. Introduction\n\n**Distributed QEM Simplification** is a high-performance C++ implementation for 3D mesh simplification based on Quadric Error Metrics (QEM). It provides multiple implementations to handle massive meshes using both Shared Memory parallelism and Distributed Memory clusters.\n\n### Features\n- **Parallel QEM:** High-speed edge collapse algorithm using OpenMP and FastFlow.\n- **Spatial Partitioning:** Supports both **Uniform Grid** and **Octree** decomposition for workload balancing.\n- **Distributed Computing:** Scalable MPI implementations (Hybrid and Full MPI) for processing meshes across multiple nodes.\n- **Modern C++:** Built with C++23 features for efficiency and robust memory management.\n- **Topology Management:** Powered by OpenMesh for reliable half-edge data structures.\n\n\n## 2\\. Papers, Libraries, and Requirements\n\n### Reference Papers and Algorithms\n\n- [Surface Simplification Using Quadric Error Metrics](https://www.cs.cmu.edu/~garland/Papers/quadrics.pdf)\n- [Scalable Algorithms for Distributed-Memory Adaptive Mesh Refinement](https://charm.cs.illinois.edu/newPapers/12-35/paper.pdf)\n- [Mesh Simplification in Parallel](https://www.researchgate.net/profile/Gerhard-Roth/publication/2924678_Mesh_Simplification_In_Parallel/links/00b7d52b9d30e5d88e000000/Mesh-Simplification-In-Parallel.pdf)\n- [Distributed Processing of Mesh Simplification](https://diglib.eg.org/server/api/core/bitstreams/57a8a69a-14a2-4995-8f26-efbb8b300c11/content)\n- [External Memory Management and Simplification of Huge Meshes](https://vcgdata.isti.cnr.it/Publications/2003/CRMS03/oemm_tvcg.pdf)\n\n### Libraries Used\n\n- [cxxopts](https://github.com/jarro2783/cxxopts) for CLI parsing\n- [eigen](https://github.com/PX4/eigen.git) for math computation\n- [openmesh](https://github.com/Lawrencemm/openmesh.git) for mesh topological management\n- [cpp-utils](https://github.com/bigmat18/cpp-utils-lib.git) for generic utilities\n- [fastflow](https://github.com/fastflow/fastflow.git) for parallel pattern testing\n- CMake as the build system\n\n### Software Requirements\n\n- **C++:** \\\u003e= C++23\n- **OpenMPI:** \\\u003e= 5.0\n- **OpenMP:** \\\u003e= 6.1\n- **CMake:** \\\u003e= 3.20\n- **Compiler:** GCC 13+ / Clang 16+ / MSVC with C++23 support\n\n---\n\n## 3\\. Installation and Usage\n\n### Installation\n\n```bash\ngit clone https://github.com/bigmat18/distributed-qem-simplification.git\ncd distributed-qem-simplification\ngit submodule update --init --recursive\n```\n\n### Build\n```bash\n./SETUP.sh \u003ctype\u003e\n./BUILD.sh \u003ctype\u003e\n```\n\nThe `type` parameter can be `debug, release, reldeb` that activete different optiomations.\n\n### Basic Usage\n\nThe project generates different executables based on the parallelization strategy:\n\n**Shared Memory (OMP/FastFlow):**\n\n```bash\n# Uniform Grid OpenMP\n./build/examples/02-omp-uniform input.obj -n \u003ctarget_faces_num\u003e\n# Octree OpenMP\n./build/examples/03-omp-octree input.obj -n \u003ctarget_faces_num\u003e\n# FastFlow Uniform\n./build/examples04-ff-uniform input.obj -n \u003ctarget_faces_num\u003e\n```\n\n**Main Options:**\n  - `-i, --filename` : Input filename list\n  - `-t, --threads`  : Number of threads (default: -1, uses all available)\n  - `-p, --partitions` : Start partitions (default: 16)\n  - `-n, --target`   : Target faces\n\n**Distributed Memory (MPI):**\nUse the provided bash script to launch MPI executions. The script safely wraps `mpirun` handling hardware threads, CPU bindings, and OpenMP thread mapping for masters and workers.\n\n```bash\n./RUN.sh \u003ctype\u003e \u003cexe\u003e -nw 4 -wt 2 -mt 4 -i data_folder/ -p 16 -t 10\n```\n\n**Script Usage:** `./run_mpi.sh \u003ctype\u003e \u003cexe\u003e [options]`\n\n  - `\u003ctype\u003e` : `debug`, `release`, or `reldeb`\n  - `\u003cexe\u003e`  : Target executable (e.g., `06-mpi-omp`, `07-mpi`)\n  - `-nw`    : Number of MPI worker processes\n  - `-wt`    : Number of OpenMP threads per worker\n  - `-mt`    : Number of OpenMP threads for the master\n  - `-p`     : Number of partitions\n  - `-t`     : Target percentage\n  - `-pr`    : Enable performance profiling via `perf record`\n\n\n## 4. Results\n\n\u003cdiv align=\"center\"\u003e\n\n\u003ctable style=\"margin:0 auto;\"\u003e\n  \u003ctr\u003e\n    \u003ctd align=\"center\" width=\"50%\"\u003e\u003cimg src=\".github/result2.png\" width=\"100%\"/\u003e\u003c/td\u003e\n    \u003ctd align=\"center\" width=\"50%\"\u003e\u003cimg src=\".github/result3.png\" width=\"100%\"/\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd align=\"center\" width=\"50%\"\u003e\n      \u003cb\u003eUniform Grid Reduction\u003c/b\u003e\u003cbr\u003eStanford Bunny from 56,172 faces to 1,000.\n    \u003c/td\u003e\n    \u003ctd align=\"center\" width=\"50%\"\u003e\n      \u003cb\u003eOctree Reduction\u003c/b\u003e\u003cbr\u003eStanford Bunny from 56,172 faces to 1,000 with wireframe visualization.\n    \u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n\u003c/div\u003e\n\n### Uniform Grid Partitions Reduction\n\n\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\".github/result1.png\" width=\"100%\"/\u003e\n\u003c/div\u003e\n\n---\n\n## 5. Benchmark and Performance Analysis\n\n### Overall Speedup Comparison\n\nThe performance of the various parallel implementations (Shared Memory and Distributed Memory) was evaluated against a sequential baseline and MeshLab's decimation algorithm. The efficiency of these parallel solutions is highly correlated with the input model's complexity. Small meshes, such as the Bunny (68K faces), show limited improvement due to thread management and communication overhead. Conversely, massive models like Lucy (28M faces) achieve up to a 10x speedup in distributed environments.\n\n\u003cdiv align=\"center\"\u003e\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd align=\"center\" width=\"500\"\u003e\n      \u003cimg src=\".github/chart_bunny.jpg\" width=\"350\"/\u003e\u003cbr\u003e\n      \u003csub\u003e\u003cb\u003eBunny (68K Triangles)\u003c/b\u003e [cite: 315]\u003c/sub\u003e\n    \u003c/td\u003e\n    \u003ctd align=\"center\" width=\"500\"\u003e\n      \u003cimg src=\".github/chart_bunny.jpg\" width=\"350\"/\u003e\u003cbr\u003e\n      \u003csub\u003e\u003cb\u003eArmadillo (300K Triangles)\u003c/b\u003e [cite: 316]\u003c/sub\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd align=\"center\" width=\"500\"\u003e\n      \u003cimg src=\".github/chart_dragon.jpg\" width=\"350\"/\u003e\u003cbr\u003e\n      \u003csub\u003e\u003cb\u003eDragon (7.5M Triangles)\u003c/b\u003e [cite: 334]\u003c/sub\u003e\n    \u003c/td\u003e\n    \u003ctd align=\"center\" width=\"500\"\u003e\n      \u003cimg src=\".github/chart_lucy.jpg\" width=\"350\"/\u003e\u003cbr\u003e\n      \u003csub\u003e\u003cb\u003eLucy (28M Triangles)\u003c/b\u003e [cite: 375]\u003c/sub\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\u003c/div\u003e\n\n### Scalability Analysis\n\nStrong scaling analysis highlights the operational limits of both architectures. Shared memory approaches scale well initially but saturate near 32 cores due to Amdahl's Law, synchronization overhead, and memory bandwidth limits. Distributed implementations (Full MPI and Hybrid MPI+OMP) process massive datasets efficiently but face severe communication bottlenecks and load imbalance beyond 128 cores, primarily driven by I/O constraints.\n\n\u003cdiv align=\"center\"\u003e\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd align=\"center\" width=\"500\"\u003e\n      \u003cimg src=\".github/scalability_detailed.jpg\" width=\"350\"/\u003e\u003cbr\u003e\n      \u003csub\u003e\u003cb\u003eShared Memory Strong Scaling\u003c/b\u003e\u003cbr\u003eExecution time variation up to 32 physical cores.\u003c/sub\u003e\n    \u003c/td\u003e\n    \u003ctd align=\"center\" width=\"500\"\u003e\n      \u003cimg src=\".github/scalability_detailed_2.jpg\" width=\"350\"/\u003e\u003cbr\u003e\n      \u003csub\u003e\u003cb\u003eDistributed Memory Scalability\u003c/b\u003e\u003cbr\u003eComparison of Hybrid MPI+OMP and Full MPI architectures.\u003c/sub\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\u003c/div\u003e\n\n---\n\n**Detailed Documentation:** For a comprehensive explanation of the mathematical models, spatial partitioning strategies (Uniform Grid vs. Octree), and in-depth performance analysis, please refer to the full project report:  \n📄 [Relation_SPM.pdf](.github/Relation_SPM.pdf)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbigmat18%2Fdistributed-qem-simplification","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbigmat18%2Fdistributed-qem-simplification","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbigmat18%2Fdistributed-qem-simplification/lists"}