Skip to content

Commit

Permalink
add a '+no_warning' variant to METIS to prevent pervasive warning (sp…
Browse files Browse the repository at this point in the history
…ack#47452)

* add a '+no_warning' variant to metis to prevent prevasive warning
* fix formating

---------

Co-authored-by: Cleveland <[email protected]>
Co-authored-by: mcourtois <[email protected]>
  • Loading branch information
3 people authored Dec 4, 2024
1 parent 8898e14 commit b0b9cf1
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions var/spack/repos/builtin/packages/draco/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ class Draco(CMakePackage):
depends_on("lapack", when="+lapack")
depends_on("[email protected]:", when="@7.4.0:+libquo")
depends_on("metis", when="+parmetis")
depends_on("metis@5:+no_warning", when="@7.19:+parmetis")
depends_on("parmetis", when="+parmetis")
depends_on("qt", when="+qt", type=("build", "link", "run"))
depends_on("superlu-dist@:5", when="@:7.6+superlu_dist")
Expand Down
13 changes: 13 additions & 0 deletions var/spack/repos/builtin/packages/metis/no_warning.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/libmetis/pmetis.c b/libmetis/pmetis.c
index 9174aa3..f8ced79 100644
--- a/libmetis/pmetis.c
+++ b/libmetis/pmetis.c
@@ -163,8 +163,6 @@ idx_t MlevelRecursiveBisection(ctrl_t *ctrl, graph_t *graph, idx_t nparts,
real_t wsum, *tpwgts2;

if ((nvtxs = graph->nvtxs) == 0) {
- printf("\t***Cannot bisect a graph with 0 vertices!\n"
- "\t***You are trying to partition a graph into too many parts!\n");
return 0;
}

7 changes: 7 additions & 0 deletions var/spack/repos/builtin/packages/metis/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@ class Metis(CMakePackage, MakefilePackage):
depends_on("c", type="build")
depends_on("cxx", type="build")

variant(
"no_warning",
default=False,
description="Disable failed partition warning print on all ranks",
)
patch("no_warning.patch", when="@5:+no_warning")

build_system(
conditional("cmake", when="@5:"), conditional("makefile", when="@:4"), default="cmake"
)
Expand Down

0 comments on commit b0b9cf1

Please sign in to comment.