From 7e7e643210810028b034b00474db9449979a0426 Mon Sep 17 00:00:00 2001 From: Sebastian Grimberg Date: Wed, 10 Jan 2024 10:26:54 -0800 Subject: [PATCH] Fix 64-bit index bug found by compiler warning --- extern/patch/metis/patch_build.diff | 40 +++++++++++++++++++ .../mfem/patch_getnodalvalues_device_fix.diff | 15 +++++++ 2 files changed, 55 insertions(+) create mode 100644 extern/patch/mfem/patch_getnodalvalues_device_fix.diff diff --git a/extern/patch/metis/patch_build.diff b/extern/patch/metis/patch_build.diff index d16882037..ec8b37257 100644 --- a/extern/patch/metis/patch_build.diff +++ b/extern/patch/metis/patch_build.diff @@ -124,3 +124,43 @@ index 3fb0e6e..6e88b53 100644 return; if (graph->nbnd > 0) +diff --git a/libmetis/parmetis.c b/libmetis/parmetis.c +index 631d811..418b606 100644 +--- a/libmetis/parmetis.c ++++ b/libmetis/parmetis.c +@@ -308,7 +308,7 @@ void FM_2WayNodeRefine1SidedP(ctrl_t *ctrl, graph_t *graph, + * Get into the FM loop + *******************************************************/ + mptr[0] = nmind = nbad = 0; +- mindiff = abs(pwgts[0]-pwgts[1]); ++ mindiff = iabs(pwgts[0]-pwgts[1]); + for (nswaps=0; nswaps values; + Array overlap(fes->GetNV()); + nval.SetSize(fes->GetNV()); +- + nval = 0.0; + overlap = 0; ++ nval.HostReadWrite(); + for (i = 0; i < fes->GetNE(); i++) + { + fes->GetElementVertices(i, vertices);