Skip to content

Commit

Permalink
MueLu: Apply clang-format 14.0.6 and see if it's compatible with the …
Browse files Browse the repository at this point in the history
…workflow
  • Loading branch information
GrahamBenHarper committed Nov 3, 2023
1 parent c6cead3 commit 79e9779
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion packages/muelu/.clang-format
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#Official Tool: clang-format version 14.0.0
#Official Tool: clang-format version 14.0.0, 14.0.6
#Kokkos options
BasedOnStyle: google
SortIncludes: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ void AggregateQualityEstimateFactory<Scalar, LocalOrdinal, GlobalOrdinal, Node>:

DenseVector workArray(14 * (aggSize + 1), false);

LO (*ptr2func)
LO(*ptr2func)
(MT*, MT*, MT*);
ptr2func = NULL;
LO* bwork = NULL;
Expand Down
4 changes: 2 additions & 2 deletions packages/muelu/src/Misc/MueLu_DemoFactory_def.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,13 @@ template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
DemoFactory<Scalar, LocalOrdinal, GlobalOrdinal, Node>::~DemoFactory() {}

template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
void DemoFactory<Scalar, LocalOrdinal, GlobalOrdinal, Node>::DeclareInput(Level & /* currentLevel */) const {
void DemoFactory<Scalar, LocalOrdinal, GlobalOrdinal, Node>::DeclareInput(Level& /* currentLevel */) const {
// TODO: declare input for factory
// Input(currentLevel, varName_);
}

template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
void DemoFactory<Scalar, LocalOrdinal, GlobalOrdinal, Node>::Build(Level & /* currentLevel */) const {
void DemoFactory<Scalar, LocalOrdinal, GlobalOrdinal, Node>::Build(Level& /* currentLevel */) const {
// TODO: implement factory
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -607,8 +607,8 @@ void ClassicalPFactory<Scalar, LocalOrdinal, GlobalOrdinal, Node>::
}

} else { // Case E
// Case E: Strong F-Point (adds to the first denominator if we don't share a
// a strong C-Point with i; adds to the second denominator otherwise)
// Case E: Strong F-Point (adds to the first denominator if we don't share a
// a strong C-Point with i; adds to the second denominator otherwise)
#ifdef CMS_DEBUG
printf("- A(%d,%d) is a strong F-Point\n", i, k);
#endif
Expand Down
8 changes: 4 additions & 4 deletions packages/muelu/test/unit_tests/Hierarchy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1569,10 +1569,10 @@ TEUCHOS_UNIT_TEST_TEMPLATE_4_DECL(Hierarchy, Write, Scalar, LocalOrdinal, Global
char t[] = "XXXXXX";
int filedescriptor = 0;
if (comm->getRank() == 0)
filedescriptor = mkstemp(t); // mkstemp() creates a temporary file. We use the name of that file as
// the suffix for the various data files produced by Hierarchy::Write().
// A better solution would be to write to a file stream, but this would
// involve writing new interfaces to Epetra's file I/O capabilities.
filedescriptor = mkstemp(t); // mkstemp() creates a temporary file. We use the name of that file as
// the suffix for the various data files produced by Hierarchy::Write().
// A better solution would be to write to a file stream, but this would
// involve writing new interfaces to Epetra's file I/O capabilities.
TEST_INEQUALITY(filedescriptor, -1); // if the file descriptor is -1, it failed
std::string tname(t);
Teuchos::broadcast<int, char>(*comm, 0, tname.size(), &tname[0]);
Expand Down
4 changes: 2 additions & 2 deletions packages/muelu/utils/run_clang_format.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ else
# get the clang-format version by running clang-format --version
CLANGFORMAT_VERSION=$(clang-format --version)
# check if clang-format result contains the string 14.0.0. if not, error out
if [[ ! "${CLANGFORMAT_VERSION}" =~ "14.0.0" ]] ; then
echo "Error! clang-format is not version 14.0.0, so it may have conflicts with the MueLu style!"
if [[ ! "${CLANGFORMAT_VERSION}" =~ "14.0.0" && ! "${CLANGFORMAT_VERSION}" =~ "14.0.6" ]] ; then
echo "Error! clang-format is not version 14.0.0 or 14.0.6, so it may have conflicts with the MueLu style!"
echo "Detected clang-format version: ${CLANGFORMAT_VERSION}"
echo "If you would like to run this anyway, you can force run this with"
echo " ./utils/run_clang_format.sh -f"
Expand Down

0 comments on commit 79e9779

Please sign in to comment.