From 3857c58324ea2a1562b55abdd229b10ff9835064 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Mon, 22 Nov 2021 12:38:53 +0100 Subject: [PATCH 1/2] Fix #part type --- BGL/include/CGAL/boost/graph/METIS/partition_dual_graph.h | 2 +- BGL/include/CGAL/boost/graph/METIS/partition_graph.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/BGL/include/CGAL/boost/graph/METIS/partition_dual_graph.h b/BGL/include/CGAL/boost/graph/METIS/partition_dual_graph.h index ce82306e85e..175cbea7caa 100644 --- a/BGL/include/CGAL/boost/graph/METIS/partition_dual_graph.h +++ b/BGL/include/CGAL/boost/graph/METIS/partition_dual_graph.h @@ -98,7 +98,7 @@ void partition_dual_graph(const TriangleMesh& tm, CGAL_assertion_code(int ret =) METIS_PartMeshDual(&ne, &nn, eptr, eind, nullptr /* elements weights*/, nullptr /*elements sizes*/, - &ncommon, &nparts, + &ncommon, static_cast(&nparts), nullptr /* partitions weights */, *options, &objval, epart, npart); diff --git a/BGL/include/CGAL/boost/graph/METIS/partition_graph.h b/BGL/include/CGAL/boost/graph/METIS/partition_graph.h index c95a8fb7efb..deeb335ae1b 100644 --- a/BGL/include/CGAL/boost/graph/METIS/partition_graph.h +++ b/BGL/include/CGAL/boost/graph/METIS/partition_graph.h @@ -130,7 +130,7 @@ void partition_graph(const TriangleMesh& tm, CGAL_assertion_code(int ret =) METIS_PartMeshNodal(&ne, &nn, eptr, eind, nullptr /* nodes weights */, nullptr /* nodes sizes */, - &nparts, + static_cast(&nparts), nullptr /* partitions weights */, *options, &objval, epart, npart); From 4f02dd2fc24b5ddb3e1f2da6cc9ee55e08519cf2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Mon, 22 Nov 2021 13:06:46 +0100 Subject: [PATCH 2/2] Fix the previous, bad fix --- BGL/include/CGAL/boost/graph/METIS/partition_dual_graph.h | 3 ++- BGL/include/CGAL/boost/graph/METIS/partition_graph.h | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/BGL/include/CGAL/boost/graph/METIS/partition_dual_graph.h b/BGL/include/CGAL/boost/graph/METIS/partition_dual_graph.h index 175cbea7caa..69e31c2eb95 100644 --- a/BGL/include/CGAL/boost/graph/METIS/partition_dual_graph.h +++ b/BGL/include/CGAL/boost/graph/METIS/partition_dual_graph.h @@ -79,6 +79,7 @@ void partition_dual_graph(const TriangleMesh& tm, // a dual edge between elements exists if they share 'nparts' vertices idx_t ncommon = 2; + idx_t nparts_as_idx_t = nparts; // either the edgecut or the total communication volume of the dual graph’s partitioning idx_t objval; @@ -98,7 +99,7 @@ void partition_dual_graph(const TriangleMesh& tm, CGAL_assertion_code(int ret =) METIS_PartMeshDual(&ne, &nn, eptr, eind, nullptr /* elements weights*/, nullptr /*elements sizes*/, - &ncommon, static_cast(&nparts), + &ncommon, &nparts_as_idx_t, nullptr /* partitions weights */, *options, &objval, epart, npart); diff --git a/BGL/include/CGAL/boost/graph/METIS/partition_graph.h b/BGL/include/CGAL/boost/graph/METIS/partition_graph.h index deeb335ae1b..ae1058c3917 100644 --- a/BGL/include/CGAL/boost/graph/METIS/partition_graph.h +++ b/BGL/include/CGAL/boost/graph/METIS/partition_graph.h @@ -112,6 +112,8 @@ void partition_graph(const TriangleMesh& tm, eptr[i + 1] = j; } + idx_t nparts_as_idx_t = nparts; + // either the edgecut or the total communication volume of the dual graph’s partitioning idx_t objval; @@ -130,7 +132,7 @@ void partition_graph(const TriangleMesh& tm, CGAL_assertion_code(int ret =) METIS_PartMeshNodal(&ne, &nn, eptr, eind, nullptr /* nodes weights */, nullptr /* nodes sizes */, - static_cast(&nparts), + &nparts_as_idx_t, nullptr /* partitions weights */, *options, &objval, epart, npart);