From d9d7c634dcde3b8c797960fc0456f6389be94601 Mon Sep 17 00:00:00 2001 From: Sandro Elsweijer Date: Mon, 2 Mar 2026 10:22:00 +0100 Subject: [PATCH 01/11] Error: -> ERROR: --- scripts/configure_for_rtd.sh | 2 +- scripts/internal/find_all_source_files.sh | 2 +- src/t8_cad/t8_cad.cxx | 2 +- src/t8_cmesh/t8_cmesh.cxx | 8 ++++---- src/t8_geometry/t8_geometry.cxx | 2 +- .../t8_geometry_cad.cxx | 4 ++-- .../t8_geometry_lagrange.cxx | 14 +++++++------- 7 files changed, 17 insertions(+), 17 deletions(-) diff --git a/scripts/configure_for_rtd.sh b/scripts/configure_for_rtd.sh index c728d4ee62..c3e9bdb405 100755 --- a/scripts/configure_for_rtd.sh +++ b/scripts/configure_for_rtd.sh @@ -39,7 +39,7 @@ cd build if [ "$READTHEDOCS" = "True" ]; then DOXYFILE_PATH="../doc/Doxyfile.in" if [ ! -f "$DOXYFILE_PATH" ]; then - echo "Error: $DOXYFILE_PATH does not exist or is not a regular file." + echo "ERROR: $DOXYFILE_PATH does not exist or is not a regular file." exit 1 fi echo "Configuring Doxygen for ReadTheDocs: Excluding source files." diff --git a/scripts/internal/find_all_source_files.sh b/scripts/internal/find_all_source_files.sh index 4f053d5539..a58fa3a318 100755 --- a/scripts/internal/find_all_source_files.sh +++ b/scripts/internal/find_all_source_files.sh @@ -53,7 +53,7 @@ else if gfind --version >/dev/null 2>&1; then FIND=gfind else - echo "Error: GNU find not found." + echo "ERROR: GNU find not found." exit 1 fi fi diff --git a/src/t8_cad/t8_cad.cxx b/src/t8_cad/t8_cad.cxx index dc319f08c9..5f2d0db03c 100644 --- a/src/t8_cad/t8_cad.cxx +++ b/src/t8_cad/t8_cad.cxx @@ -413,7 +413,7 @@ t8_cad::t8_geom_get_parameters_of_vertex_on_face (const int vertex_index, const } /* Hopefully we found a seam. If not something has gone catastrophically wrong or I overlooked something. Probably the latter. */ - SC_CHECK_ABORTF (seam.has_value (), "Error: Could not find seam of periodic surface."); + SC_CHECK_ABORTF (seam.has_value (), "ERROR: Could not find seam of periodic surface."); /* We now have the seam and can iterate over all edges of the face again. Every edge matching our seam is also a seam (in my eyes). In the case of our cylinder this would be the two lines. */ diff --git a/src/t8_cmesh/t8_cmesh.cxx b/src/t8_cmesh/t8_cmesh.cxx index 2d55efd120..d4f577830c 100644 --- a/src/t8_cmesh/t8_cmesh.cxx +++ b/src/t8_cmesh/t8_cmesh.cxx @@ -702,7 +702,7 @@ t8_cmesh_bcast (const t8_cmesh_t cmesh_in, const int root, sc_MPI_Comm comm) * Geometries must therefore be added after broadcasting. */ if (cmesh_in->geometry_handler != NULL) { SC_CHECK_ABORT (cmesh_in->geometry_handler->get_num_geometries () == 0, - "Error: Broadcasting a cmesh with registered geometries is not possible.\n" + "ERROR: Broadcasting a cmesh with registered geometries is not possible.\n" "We recommend to broadcast first and register the geometries after.\n"); } memcpy (&meta_info.cmesh, cmesh_in, sizeof (*cmesh_in)); @@ -2396,13 +2396,13 @@ t8_cmesh_get_local_bounding_box (const t8_cmesh_t cmesh, double bounds[6]) double tree_bounds[6] = { 0.0 }; t8_geometry_handler *geom_handler = cmesh->geometry_handler; if (geom_handler == NULL) { - t8_errorf ("Error: Trying to compute bounding box for cmesh with no geometry.\n"); + t8_errorf ("ERROR: Trying to compute bounding box for cmesh with no geometry.\n"); return false; } const t8_gloidx_t first_tree = cmesh->first_tree; bool bbox_return = geom_handler->get_tree_bounding_box (cmesh, first_tree, bounds); if (!bbox_return) { - t8_errorf ("Error: Failed to compute the bounding box for the first tree.\n"); + t8_errorf ("ERROR: Failed to compute the bounding box for the first tree.\n"); /* If the bounding box is not available, we return false */ return false; } @@ -2419,7 +2419,7 @@ t8_cmesh_get_local_bounding_box (const t8_cmesh_t cmesh, double bounds[6]) } if (!bbox_return) { /* If the bounding box is not available, we return false */ - t8_errorf ("Error: Failed to compute the bounding box for a tree\n"); + t8_errorf ("ERROR: Failed to compute the bounding box for a tree\n"); return false; } #if T8_ENABLE_DEBUG diff --git a/src/t8_geometry/t8_geometry.cxx b/src/t8_geometry/t8_geometry.cxx index 595755260b..81d6e90501 100644 --- a/src/t8_geometry/t8_geometry.cxx +++ b/src/t8_geometry/t8_geometry.cxx @@ -39,7 +39,7 @@ t8_geometry_evaluate (t8_cmesh_t cmesh, t8_gloidx_t gtreeid, const double *ref_c } if (cmesh->geometry_handler == NULL) { - SC_ABORT ("Error: Trying to evaluate non-existing geometry.\n"); + SC_ABORT ("ERROR: Trying to evaluate non-existing geometry.\n"); } /* Evaluate the geometry. */ diff --git a/src/t8_geometry/t8_geometry_implementations/t8_geometry_cad.cxx b/src/t8_geometry/t8_geometry_implementations/t8_geometry_cad.cxx index ffd3f0b4db..4574877d0c 100644 --- a/src/t8_geometry/t8_geometry_implementations/t8_geometry_cad.cxx +++ b/src/t8_geometry/t8_geometry_implementations/t8_geometry_cad.cxx @@ -21,7 +21,7 @@ */ /** \file t8_geometry_cad.cxx - * Implements functions declared in \ref t8_geometry_cad.hxx + * Implements functions declared in \ref t8_geometry_cad.hxx * or the C interface \ref t8_geometry_cad.h. */ @@ -90,7 +90,7 @@ t8_geometry_cad::t8_geom_evaluate (t8_cmesh_t cmesh, t8_gloidx_t gtreeid, const t8_geometry_cad::t8_geom_evaluate_cad_tet (cmesh, gtreeid, ref_coords, num_coords, out_coords); break; default: - SC_ABORTF ("Error: Curved cad geometry for element type %s not yet implemented. \n", + SC_ABORTF ("ERROR: Curved cad geometry for element type %s not yet implemented. \n", t8_eclass_to_string[active_tree_class]); } } diff --git a/src/t8_geometry/t8_geometry_implementations/t8_geometry_lagrange.cxx b/src/t8_geometry/t8_geometry_implementations/t8_geometry_lagrange.cxx index 1bc5be6d09..03cb747f19 100644 --- a/src/t8_geometry/t8_geometry_implementations/t8_geometry_lagrange.cxx +++ b/src/t8_geometry/t8_geometry_implementations/t8_geometry_lagrange.cxx @@ -21,7 +21,7 @@ */ /** \file t8_geometry_lagrange.cxx - * Implements functions declared in \ref t8_geometry_lagrange.hxx + * Implements functions declared in \ref t8_geometry_lagrange.hxx * or the C interface \ref t8_geometry_lagrange.h. */ @@ -51,7 +51,7 @@ t8_geometry_lagrange::t8_geom_evaluate ([[maybe_unused]] t8_cmesh_t cmesh, [[may const double *ref_coords, const size_t num_points, double *out_coords) const { if (num_points != 1) - SC_ABORT ("Error: Batch computation of geometry not yet supported."); + SC_ABORT ("ERROR: Batch computation of geometry not yet supported."); T8_ASSERT (t8_geom_check_tree_compatibility ()); const auto basis_functions = t8_geometry_lagrange::t8_geom_compute_basis (ref_coords); const size_t n_vertex = basis_functions.size (); @@ -97,7 +97,7 @@ t8_geometry_lagrange::t8_geom_compute_basis (const double *ref_coords) const case 2: return t8_geometry_lagrange::t8_geom_s3_basis (ref_coords); default: - SC_ABORTF ("Error: Lagrange geometry for degree %i %s not yet implemented. \n", *degree, + SC_ABORTF ("ERROR: Lagrange geometry for degree %i %s not yet implemented. \n", *degree, t8_eclass_to_string[active_tree_class]); } @@ -108,7 +108,7 @@ t8_geometry_lagrange::t8_geom_compute_basis (const double *ref_coords) const case 2: return t8_geometry_lagrange::t8_geom_t6_basis (ref_coords); default: - SC_ABORTF ("Error: Lagrange geometry for degree %i %s not yet implemented. \n", *degree, + SC_ABORTF ("ERROR: Lagrange geometry for degree %i %s not yet implemented. \n", *degree, t8_eclass_to_string[active_tree_class]); } case T8_ECLASS_QUAD: @@ -118,7 +118,7 @@ t8_geometry_lagrange::t8_geom_compute_basis (const double *ref_coords) const case 2: return t8_geometry_lagrange::t8_geom_q9_basis (ref_coords); default: - SC_ABORTF ("Error: Lagrange geometry for degree %i %s not yet implemented. \n", *degree, + SC_ABORTF ("ERROR: Lagrange geometry for degree %i %s not yet implemented. \n", *degree, t8_eclass_to_string[active_tree_class]); } case T8_ECLASS_HEX: @@ -128,11 +128,11 @@ t8_geometry_lagrange::t8_geom_compute_basis (const double *ref_coords) const case 2: return t8_geometry_lagrange::t8_geom_h27_basis (ref_coords); default: - SC_ABORTF ("Error: Lagrange geometry for degree %i %s not yet implemented. \n", *degree, + SC_ABORTF ("ERROR: Lagrange geometry for degree %i %s not yet implemented. \n", *degree, t8_eclass_to_string[active_tree_class]); } default: - SC_ABORTF ("Error: Lagrange geometry for eclass %s not yet implemented. \n", + SC_ABORTF ("ERROR: Lagrange geometry for eclass %s not yet implemented. \n", t8_eclass_to_string[active_tree_class]); } } From 3ae354d4c4d3f22b423461b9cb60192a9bc66b66 Mon Sep 17 00:00:00 2001 From: Sandro Elsweijer Date: Mon, 2 Mar 2026 10:22:39 +0100 Subject: [PATCH 02/11] Warning: -> WARNING: --- benchmarks/t8_time_fractal.cxx | 2 +- benchmarks/t8_time_prism_adapt.cxx | 2 +- benchmarks/t8_time_set_join_by_vertices.cxx | 4 +- example/IO/cmesh/gmsh/t8_read_msh_file.cxx | 4 +- example/IO/cmesh/t8_cmesh_load_save.cxx | 4 +- .../IO/cmesh/tetgen/t8_forest_from_tetgen.cxx | 4 +- .../IO/cmesh/tetgen/t8_read_tetgen_file.cxx | 4 +- .../IO/cmesh/tetgen/t8_time_tetgen_file.cxx | 4 +- .../cmesh/triangle/t8_read_triangle_file.cxx | 4 +- .../IO/cmesh/vtk/t8_cmesh_read_from_vtk.cxx | 12 +-- example/IO/forest/gmsh/t8_gmsh_to_vtk.cxx | 2 +- .../cmesh/t8_cmesh_set_join_by_vertices.cxx | 4 +- example/forest/t8_test_face_iterate.cxx | 2 +- example/forest/t8_test_ghost.cxx | 2 +- .../forest/t8_test_ghost_large_level_diff.cxx | 4 +- example/geometry/t8_example_geometries.cxx | 78 +++++++++---------- example/remove/t8_example_empty_trees.cxx | 2 +- example/remove/t8_example_gauss_blob.cxx | 2 +- example/remove/t8_example_spheres.cxx | 2 +- example/version/t8_version.cxx | 8 +- scripts/check_valgrind.sh | 2 +- .../t8_cmesh_internal/t8_cmesh_partition.cxx | 2 +- .../t8_cmesh_io/t8_cmesh_readmshfile.cxx | 4 +- src/t8_vtk/t8_vtk.c | 24 +++--- src/t8_vtk/t8_vtk_write_ASCII.cxx | 4 +- src/t8_vtk/t8_vtk_writer.hxx | 2 +- .../features/t8_features_curved_meshes.cxx | 2 +- 27 files changed, 95 insertions(+), 95 deletions(-) diff --git a/benchmarks/t8_time_fractal.cxx b/benchmarks/t8_time_fractal.cxx index b3d4b7caf2..bb5411ad31 100644 --- a/benchmarks/t8_time_fractal.cxx +++ b/benchmarks/t8_time_fractal.cxx @@ -387,7 +387,7 @@ main (int argc, char **argv) /* The usage string or help message was truncated */ /* Note: gcc >= 7.1 prints a warning if we * do not check the return value of snprintf. */ - t8_debugf ("Warning: Truncated usage string and help message to '%s' and '%s'\n", usage, help); + t8_debugf ("WARNING: Truncated usage string and help message to '%s' and '%s'\n", usage, help); } int mpiret = sc_MPI_Init (&argc, &argv); diff --git a/benchmarks/t8_time_prism_adapt.cxx b/benchmarks/t8_time_prism_adapt.cxx index 8853845315..d359f9296b 100644 --- a/benchmarks/t8_time_prism_adapt.cxx +++ b/benchmarks/t8_time_prism_adapt.cxx @@ -183,7 +183,7 @@ main (int argc, char **argv) /* The usage string or help message was truncated */ /* Note: gcc >= 7.1 prints a warning if we * do not check the return value of snprintf. */ - t8_debugf ("Warning: Truncated usage string and help message to '%s' and '%s'\n", usage, help); + t8_debugf ("WARNING: Truncated usage string and help message to '%s' and '%s'\n", usage, help); } mpiret = sc_MPI_Init (&argc, &argv); diff --git a/benchmarks/t8_time_set_join_by_vertices.cxx b/benchmarks/t8_time_set_join_by_vertices.cxx index b36714b631..405c17591d 100644 --- a/benchmarks/t8_time_set_join_by_vertices.cxx +++ b/benchmarks/t8_time_set_join_by_vertices.cxx @@ -106,9 +106,9 @@ main (int argc, char **argv) if (sreturnA > BUFSIZ || sreturnB > BUFSIZ) { /* The usage string or help message was truncated */ - /* Note: gcc >= 7.1 prints a warning if we + /* Note: gcc >= 7.1 prints a warning if we * do not check the return value of snprintf. */ - t8_debugf ("Warning: Truncated usage string and help message to '%s' and '%s'\n", usage, help); + t8_debugf ("WARNING: Truncated usage string and help message to '%s' and '%s'\n", usage, help); } int mpiret = sc_MPI_Init (&argc, &argv); diff --git a/example/IO/cmesh/gmsh/t8_read_msh_file.cxx b/example/IO/cmesh/gmsh/t8_read_msh_file.cxx index 7faaf346d7..49523f34e1 100644 --- a/example/IO/cmesh/gmsh/t8_read_msh_file.cxx +++ b/example/IO/cmesh/gmsh/t8_read_msh_file.cxx @@ -124,9 +124,9 @@ main (int argc, char *argv[]) if (sreturn >= BUFSIZ) { /* The help message was truncated */ - /* Note: gcc >= 7.1 prints a warning if we + /* Note: gcc >= 7.1 prints a warning if we * do not check the return value of snprintf. */ - t8_debugf ("Warning: Truncated help message to '%s'\n", help); + t8_debugf ("WARNING: Truncated help message to '%s'\n", help); } mpiret = sc_MPI_Init (&argc, &argv); diff --git a/example/IO/cmesh/t8_cmesh_load_save.cxx b/example/IO/cmesh/t8_cmesh_load_save.cxx index 566d1c2ce4..1e3dfcf043 100644 --- a/example/IO/cmesh/t8_cmesh_load_save.cxx +++ b/example/IO/cmesh/t8_cmesh_load_save.cxx @@ -106,9 +106,9 @@ main (int argc, char **argv) if (sreturn >= BUFSIZ) { /* The help message was truncated */ - /* Note: gcc >= 7.1 prints a warning if we + /* Note: gcc >= 7.1 prints a warning if we * do not check the return value of snprintf. */ - t8_debugf ("Warning: Truncated help message to '%s'\n", help); + t8_debugf ("WARNING: Truncated help message to '%s'\n", help); } mpiret = sc_MPI_Init (&argc, &argv); diff --git a/example/IO/cmesh/tetgen/t8_forest_from_tetgen.cxx b/example/IO/cmesh/tetgen/t8_forest_from_tetgen.cxx index 40f5a7f2b4..6c708431a1 100644 --- a/example/IO/cmesh/tetgen/t8_forest_from_tetgen.cxx +++ b/example/IO/cmesh/tetgen/t8_forest_from_tetgen.cxx @@ -96,9 +96,9 @@ main (int argc, char *argv[]) if (sreturn >= BUFSIZ) { /* The help message was truncated */ - /* Note: gcc >= 7.1 prints a warning if we + /* Note: gcc >= 7.1 prints a warning if we * do not check the return value of snprintf. */ - t8_debugf ("Warning: Truncated help message to '%s'\n", help); + t8_debugf ("WARNING: Truncated help message to '%s'\n", help); } mpiret = sc_MPI_Init (&argc, &argv); diff --git a/example/IO/cmesh/tetgen/t8_read_tetgen_file.cxx b/example/IO/cmesh/tetgen/t8_read_tetgen_file.cxx index 4b01f240a7..a32826757b 100644 --- a/example/IO/cmesh/tetgen/t8_read_tetgen_file.cxx +++ b/example/IO/cmesh/tetgen/t8_read_tetgen_file.cxx @@ -95,9 +95,9 @@ main (int argc, char *argv[]) if (sreturn >= BUFSIZ) { /* The help message was truncated */ - /* Note: gcc >= 7.1 prints a warning if we + /* Note: gcc >= 7.1 prints a warning if we * do not check the return value of snprintf. */ - t8_debugf ("Warning: Truncated help message to '%s'\n", help); + t8_debugf ("WARNING: Truncated help message to '%s'\n", help); } mpiret = sc_MPI_Init (&argc, &argv); diff --git a/example/IO/cmesh/tetgen/t8_time_tetgen_file.cxx b/example/IO/cmesh/tetgen/t8_time_tetgen_file.cxx index 7f6c258e83..1d7718f76e 100644 --- a/example/IO/cmesh/tetgen/t8_time_tetgen_file.cxx +++ b/example/IO/cmesh/tetgen/t8_time_tetgen_file.cxx @@ -76,9 +76,9 @@ main (int argc, char *argv[]) if (sreturn >= BUFSIZ) { /* The help message was truncated */ - /* Note: gcc >= 7.1 prints a warning if we + /* Note: gcc >= 7.1 prints a warning if we * do not check the return value of snprintf. */ - t8_debugf ("Warning: Truncated help message to '%s'\n", help); + t8_debugf ("WARNING: Truncated help message to '%s'\n", help); } mpiret = sc_MPI_Init (&argc, &argv); diff --git a/example/IO/cmesh/triangle/t8_read_triangle_file.cxx b/example/IO/cmesh/triangle/t8_read_triangle_file.cxx index 956316d7f5..88f07314a4 100644 --- a/example/IO/cmesh/triangle/t8_read_triangle_file.cxx +++ b/example/IO/cmesh/triangle/t8_read_triangle_file.cxx @@ -90,9 +90,9 @@ main (int argc, char *argv[]) if (sreturn >= BUFSIZ) { /* The help message was truncated */ - /* Note: gcc >= 7.1 prints a warning if we + /* Note: gcc >= 7.1 prints a warning if we * do not check the return value of snprintf. */ - t8_debugf ("Warning: Truncated help message to '%s'\n", help); + t8_debugf ("WARNING: Truncated help message to '%s'\n", help); } mpiret = sc_MPI_Init (&argc, &argv); diff --git a/example/IO/cmesh/vtk/t8_cmesh_read_from_vtk.cxx b/example/IO/cmesh/vtk/t8_cmesh_read_from_vtk.cxx index 0da13bbcad..72be87d3ad 100644 --- a/example/IO/cmesh/vtk/t8_cmesh_read_from_vtk.cxx +++ b/example/IO/cmesh/vtk/t8_cmesh_read_from_vtk.cxx @@ -29,8 +29,8 @@ along with t8code; if not, write to the Free Software Foundation, Inc., /** * Construct a cmesh read from a VTK-file type supported by our vtk-reader. * Given the number of cell-values in the file we read the data again from the forest - * and write it into the file forest.(p)vtu . - * + * and write it into the file forest.(p)vtu . + * * \param[in] prefix The prefix of the file to read the mesh from * \param[in] comm The communicator used in this example * \param[in] values_per_cell The number of values per cell in the mesh. @@ -43,8 +43,8 @@ void t8_forest_construct_from_vtk (const char *prefix, sc_MPI_Comm comm, const int values_per_cell, const int partition, vtk_file_type_t vtk_file_type, const int user_package_id, const char *out_prefix) { - /* Read a poly-data file (.ply, .vtp, .obj, .stl, .vtk, .g) and construct a cmesh - * representing the mesh. If there is any cell-data, it will be read too. + /* Read a poly-data file (.ply, .vtp, .obj, .stl, .vtk, .g) and construct a cmesh + * representing the mesh. If there is any cell-data, it will be read too. * Triangle-strips and polygons will be broken down to multiple triangles. */ t8_cmesh_t cmesh_in = t8_vtk_reader_cmesh (prefix, partition, 0, comm, vtk_file_type, user_package_id, 0); if (cmesh_in == NULL) { @@ -140,9 +140,9 @@ main (int argc, char **argv) usage); if (sreturn >= BUFSIZ) { /* The help message was truncated */ - /* Note: gcc >= 7.1 prints a warning if we + /* Note: gcc >= 7.1 prints a warning if we * do not check the return value of snprintf. */ - t8_debugf ("Warning: Truncated help message to '%s'\n", help); + t8_debugf ("WARNING: Truncated help message to '%s'\n", help); } mpiret = sc_MPI_Init (&argc, &argv); SC_CHECK_MPI (mpiret); diff --git a/example/IO/forest/gmsh/t8_gmsh_to_vtk.cxx b/example/IO/forest/gmsh/t8_gmsh_to_vtk.cxx index f0025ee6ef..0c99eff235 100644 --- a/example/IO/forest/gmsh/t8_gmsh_to_vtk.cxx +++ b/example/IO/forest/gmsh/t8_gmsh_to_vtk.cxx @@ -57,7 +57,7 @@ main (int argc, char **argv) // The help message was truncated. // Note: gcc >= 7.1 prints a warning if we // do not check the return value of snprintf. - t8_debugf ("Warning: Truncated help message to '%s'\n", help); + t8_debugf ("WARNING: Truncated help message to '%s'\n", help); } // Initialize MPI. This has to happen before we initialize sc or t8code. diff --git a/example/cmesh/t8_cmesh_set_join_by_vertices.cxx b/example/cmesh/t8_cmesh_set_join_by_vertices.cxx index 9ee2e87fba..ee903dc597 100644 --- a/example/cmesh/t8_cmesh_set_join_by_vertices.cxx +++ b/example/cmesh/t8_cmesh_set_join_by_vertices.cxx @@ -169,9 +169,9 @@ main (int argc, char **argv) if (sreturnA > BUFSIZ || sreturnB > BUFSIZ) { /* The usage string or help message was truncated */ - /* Note: gcc >= 7.1 prints a warning if we + /* Note: gcc >= 7.1 prints a warning if we * do not check the return value of snprintf. */ - t8_debugf ("Warning: Truncated usage string and help message to '%s' and '%s'\n", usage, help); + t8_debugf ("WARNING: Truncated usage string and help message to '%s' and '%s'\n", usage, help); } int mpiret = sc_MPI_Init (&argc, &argv); diff --git a/example/forest/t8_test_face_iterate.cxx b/example/forest/t8_test_face_iterate.cxx index fe51e449c3..5be119fd36 100644 --- a/example/forest/t8_test_face_iterate.cxx +++ b/example/forest/t8_test_face_iterate.cxx @@ -214,7 +214,7 @@ main (int argc, char **argv) /* The usage string or help message was truncated */ /* Note: gcc >= 7.1 prints a warning if we * do not check the return value of snprintf. */ - t8_debugf ("Warning: Truncated usage string and help message to '%s' and '%s'\n", usage, help); + t8_debugf ("WARNING: Truncated usage string and help message to '%s' and '%s'\n", usage, help); } mpiret = sc_MPI_Init (&argc, &argv); diff --git a/example/forest/t8_test_ghost.cxx b/example/forest/t8_test_ghost.cxx index ec58ef3392..8b0e3030d3 100644 --- a/example/forest/t8_test_ghost.cxx +++ b/example/forest/t8_test_ghost.cxx @@ -305,7 +305,7 @@ main (int argc, char **argv) /* The usage string or help message was truncated */ /* Note: gcc >= 7.1 prints a warning if we * do not check the return value of snprintf. */ - t8_debugf ("Warning: Truncated usage string and help message to '%s' and '%s'\n", usage, help); + t8_debugf ("WARNING: Truncated usage string and help message to '%s' and '%s'\n", usage, help); } mpiret = sc_MPI_Init (&argc, &argv); SC_CHECK_MPI (mpiret); diff --git a/example/forest/t8_test_ghost_large_level_diff.cxx b/example/forest/t8_test_ghost_large_level_diff.cxx index d6fd2c69bd..bff5b50275 100644 --- a/example/forest/t8_test_ghost_large_level_diff.cxx +++ b/example/forest/t8_test_ghost_large_level_diff.cxx @@ -63,7 +63,7 @@ * * If the mesh is not 3D then no element is refined. * - * Warning: this refinement schemes only works with the default element + * WARNING: this refinement schemes only works with the default element * scheme (see t8_scheme_new_default in t8_default/t8_default.hxx). */ static int @@ -221,7 +221,7 @@ main (int argc, char *argv[]) /* The help message was truncated */ /* Note: gcc >= 7.1 prints a warning if we * do not check the return value of snprintf. */ - t8_debugf ("Warning: Truncated help message to '%s'\n", help); + t8_debugf ("WARNING: Truncated help message to '%s'\n", help); } mpiret = sc_MPI_Init (&argc, &argv); diff --git a/example/geometry/t8_example_geometries.cxx b/example/geometry/t8_example_geometries.cxx index c38987de4f..ffb6e38d35 100644 --- a/example/geometry/t8_example_geometries.cxx +++ b/example/geometry/t8_example_geometries.cxx @@ -74,10 +74,10 @@ typedef enum { T8_GEOM_COUNT } t8_example_geom_type; -/** This geometry maps a point (x,y) in R^2 +/** This geometry maps a point (x,y) in R^2 * to the point (x,y, 0.2 * sin(2PI X) * cos(2PI Y)). * It should only be used for 2 dimensional forests. - * + * * This geometry does not provide a jacobian. */ struct t8_geometry_sincos: public t8_geometry @@ -89,9 +89,9 @@ struct t8_geometry_sincos: public t8_geometry } /** - * Maps points (x,y) in R^2 + * Maps points (x,y) in R^2 * to the point (x,y, 0.2 * sin(2PI X) * cos(2PI Y)). - * It is specifically designed to work on two tree cmeshes and + * It is specifically designed to work on two tree cmeshes and * models the rectangle [0,2] x [0,1]. * \param [in] cmesh The cmesh in which the point lies. * \param [in] gtreeid The global tree (of the cmesh) in which the reference point is. @@ -163,7 +163,7 @@ struct t8_geometry_sincos: public t8_geometry /** This geometry maps the unit square \f$ [0,1]^2 \f$ to the moebius strip. * The unit square can be modelled with any cmesh (consisting of any number of trees). - * + * * It inherits from the w_vertices geometry since we use the tree's vertex coordinates. * This geometry does not provide a jacobian. */ @@ -246,7 +246,7 @@ struct t8_geometry_moebius: public t8_geometry_with_vertices /** This geometry maps the unit square to a cylinder. * It should only be used for cmeshes with a single quad tree. - * + * * This geometry does not provide a jacobian. */ struct t8_geometry_cylinder: public t8_geometry @@ -326,7 +326,7 @@ struct t8_geometry_cylinder: public t8_geometry * and radius 1. * This geometry massively distorts elements near the boundary and should not be * used for actual numerical experiments. - * + * * This geometry does not provide a jacobian. */ struct t8_geometry_circle: public t8_geometry_with_vertices @@ -414,7 +414,7 @@ struct t8_geometry_circle: public t8_geometry_with_vertices * sincos function and multiplied with the current time. * To use this, a pointer to a double variable time is added to the geometry. * This variable can be modified from outside. - * + * * The geometry can only be used with single tree cmeshes (unit square). */ @@ -599,7 +599,7 @@ t8_geom_adapt_boundary (t8_forest_t forest, t8_forest_t forest_from, t8_locidx_t /* Get the number of faces of the element. */ const int num_faces = scheme->element_get_num_faces (tree_class, elements[0]); int iface; - /* Get the maximum level from the forest's user data + /* Get the maximum level from the forest's user data * (must be set before using the callback). */ int maxlevel = *(int *) t8_forest_get_user_data (forest); @@ -608,7 +608,7 @@ t8_geom_adapt_boundary (t8_forest_t forest, t8_forest_t forest_from, t8_locidx_t return 0; } - /* Check for each face of the element whether it lies on the + /* Check for each face of the element whether it lies on the * domain boundary. If so, the element is refined. */ for (iface = 0; iface < num_faces; ++iface) { if (scheme->element_is_root_boundary (tree_class, elements[0], iface)) { @@ -757,8 +757,8 @@ t8_analytic_geom (int level, t8_example_geom_type geom_type) /* Create a cad geometry. */ t8_cmesh_register_geometry (cmesh, shape); - /* The arrays indicate which face/edge carries a geometry. - * 0 means no geometry and any other number indicates the position of the geometry + /* The arrays indicate which face/edge carries a geometry. + * 0 means no geometry and any other number indicates the position of the geometry * in the global geometry array. Here edge 1 carries the created cad_curve. */ int faces[1] = { 0 }; int edges[6] = { 0, 1, 0, 0, 0, 0 }; @@ -770,7 +770,7 @@ t8_analytic_geom (int level, t8_example_geom_type geom_type) /* The valid parameter range for bsplines is [0, 1]. Therefore, we define the parameter range accordingly. */ double parameters_edge[2] = { 0, 1 }; - /* Give the tree information about its curves and the parameters of the vertices. + /* Give the tree information about its curves and the parameters of the vertices. * Each parameter set is given to the tree via its attribute key + the edge or face index it corresponds with. */ t8_cmesh_set_attribute (cmesh, 0, t8_get_package_id (), T8_CMESH_CAD_FACE_ATTRIBUTE_KEY, faces, 1 * sizeof (int), 0); @@ -789,7 +789,7 @@ t8_analytic_geom (int level, t8_example_geom_type geom_type) #if T8_ENABLE_OCC t8_global_productionf ("Creating uniform level %i forests with cad curve geometries.\n", level); - /* Create two cad bsplines which oscillate along the x-axis. + /* Create two cad bsplines which oscillate along the x-axis. * For this we need to define two arrays from which we create the bsplines. */ Handle_Geom_Curve cad_curve0; Handle_Geom_Curve cad_curve1; @@ -821,8 +821,8 @@ t8_analytic_geom (int level, t8_example_geom_type geom_type) /* Create a cad geometry. */ t8_cmesh_register_geometry (cmesh, shape); - /* The arrays indicate which face/edge carries a geometry. - * 0 means no geometry and any other number indicates the position of the geometry + /* The arrays indicate which face/edge carries a geometry. + * 0 means no geometry and any other number indicates the position of the geometry * in the global geometry array. Here edge 0 carries cad_curve0 and edge 3 carries cad_curve1. * We add them in the next step. */ int faces[6] = { 0, 0, 0, 0, 0, 0 }; @@ -833,11 +833,11 @@ t8_analytic_geom (int level, t8_example_geom_type geom_type) double vertices[24] = { 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1 }; t8_cmesh_set_tree_vertices (cmesh, 0, vertices, 8); - /* The valid parameter range for bsplines is [0, 1]. We defined the bsplines in such a way, + /* The valid parameter range for bsplines is [0, 1]. We defined the bsplines in such a way, * that parameter 0 and 1 resemble the two vertices of the connected edge. */ double parameters[2] = { 0, 1 }; - /* Give the tree information about its curves and the parameters of the vertices. + /* Give the tree information about its curves and the parameters of the vertices. * Each parameter set is given to the tree via its attribute key + the edge or face index it corresponds with. */ t8_cmesh_set_attribute (cmesh, 0, t8_get_package_id (), T8_CMESH_CAD_FACE_ATTRIBUTE_KEY, faces, 6 * sizeof (int), 0); @@ -863,10 +863,10 @@ t8_analytic_geom (int level, t8_example_geom_type geom_type) TColgp_Array2OfPnt point_array (1, 5, 1, 3); TopoDS_Shape shape; - /* Filling the 2D surface array with knots. The resulting surface resembles + /* Filling the 2D surface array with knots. The resulting surface resembles * a surface at the top (face 5) of the trees. - * Some of the knots have the same position as the vertices of the trees. - * These knots are marked with the tree id and vertex index. + * Some of the knots have the same position as the vertices of the trees. + * These knots are marked with the tree id and vertex index. * We also marked the direction of the u- and v-parameter. * * x--> u-parameter @@ -912,9 +912,9 @@ t8_analytic_geom (int level, t8_example_geom_type geom_type) cad_surface = GeomAPI_PointsToBSplineSurface (point_array).Surface (); shape = BRepBuilderAPI_MakeFace (cad_surface, 1e-6).Face (); - /* The arrays indicate which face/edge carries a geometry. - * 0 means no geometry and any other number indicates the position of the geometry - * in the global geometry array. Here face 5 carries the surface, we add it in the next step. + /* The arrays indicate which face/edge carries a geometry. + * 0 means no geometry and any other number indicates the position of the geometry + * in the global geometry array. Here face 5 carries the surface, we add it in the next step. * There are no geometries linked to the edges, hence all entries are 0. */ int faces[6] = { 0, 0, 0, 0, 0, 1 }; int edges[24] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; @@ -932,12 +932,12 @@ t8_analytic_geom (int level, t8_example_geom_type geom_type) }; t8_cmesh_set_tree_vertices (cmesh, 0, vertices0, 8); - /* The valid parameter range for bspline surfaces is [0,1]^2. We defined the bspline surface in such a way, + /* The valid parameter range for bspline surfaces is [0,1]^2. We defined the bspline surface in such a way, * that parameters 0, 0.5 and 1 resemble the vertices of the connected surface. */ double parameters0[8] = { 0, 0, 0.5, 0, 0, 1, 0.5, 1 }; - /* Give tree 0 information about its surface and the parameters of the vertices. - * Each parameter set is given to the tree via its attribute key + the edge or face index it corresponds with. + /* Give tree 0 information about its surface and the parameters of the vertices. + * Each parameter set is given to the tree via its attribute key + the edge or face index it corresponds with. */ t8_cmesh_set_attribute (cmesh, 0, t8_get_package_id (), T8_CMESH_CAD_FACE_ATTRIBUTE_KEY, faces, 6 * sizeof (int), 0); @@ -960,8 +960,8 @@ t8_analytic_geom (int level, t8_example_geom_type geom_type) * that parameters 0, 0.5 and 1 resemble the vertices of the connected surface. */ double parameters1[8] = { 0.5, 0, 1, 0, 0.5, 1, 1, 1 }; - /* Give tree 1 information about its surface and the parameters of the vertices. - * Each parameter set is given to the tree via its attribute key + the edge or face index it corresponds with. + /* Give tree 1 information about its surface and the parameters of the vertices. + * Each parameter set is given to the tree via its attribute key + the edge or face index it corresponds with. * We can use the same edges and faces array, because we link the surface to the same face on tree 1. */ t8_cmesh_set_attribute (cmesh, 1, t8_get_package_id (), T8_CMESH_CAD_FACE_ATTRIBUTE_KEY, faces, 6 * sizeof (int), 0); @@ -1009,8 +1009,8 @@ t8_analytic_geom (int level, t8_example_geom_type geom_type) /* Fill shape with mantles so that we can create a geometry with this shape. */ shape = BRepAlgoAPI_Fuse (shape, BRepBuilderAPI_MakeFace (cylinder_inner, 1e-6).Face ()); - /* The arrays indicate which face/edge carries a geometry. - * 0 means no geometry and any other number indicates the position of the geometry + /* The arrays indicate which face/edge carries a geometry. + * 0 means no geometry and any other number indicates the position of the geometry * in the global geometry array. Here face 0 carries the outer cylinder and face 1 carries the inner cylinder. * We add them in the next step. The edges do not have any geometries, hence all entries are 0. */ int faces[6] = { 1, 2, 0, 0, 0, 0 }; @@ -1019,7 +1019,7 @@ t8_analytic_geom (int level, t8_example_geom_type geom_type) /* Create a cad geometry. */ t8_cmesh_register_geometry (cmesh, shape); - /* Create corresponding trees and parameters. + /* Create corresponding trees and parameters. * Here we create num trees by a coordinate transformation from cylinder to cartesian coordinates. */ int num = 4; double *vertices, *parameters; @@ -1054,7 +1054,7 @@ t8_analytic_geom (int level, t8_example_geom_type geom_type) vertices[i * 24 + 23] = 1; t8_cmesh_set_tree_vertices (cmesh, i, vertices + i * 24, 8); - /* Create corresponding parameters for the cylinders. + /* Create corresponding parameters for the cylinders. * The parameter range of the cylinders is u ∈ [0, 2 * M_PI] and v ∈ ]inf, -inf[ */ parameters[i * 8 + 0] = (i + 1) * 2 * M_PI / num; parameters[i * 8 + 1] = 0; @@ -1065,8 +1065,8 @@ t8_analytic_geom (int level, t8_example_geom_type geom_type) parameters[i * 8 + 6] = i * 2 * M_PI / num; parameters[i * 8 + 7] = -1; - /* Give the trees information about their surfaces and the parameters of the vertices. - * Each parameter set is given to the tree via its attribute key + face index it corresponds with. + /* Give the trees information about their surfaces and the parameters of the vertices. + * Each parameter set is given to the tree via its attribute key + face index it corresponds with. * We can use the same edges and faces array, because we link the surface to the same faces on every tree.*/ t8_cmesh_set_attribute (cmesh, i, t8_get_package_id (), T8_CMESH_CAD_FACE_ATTRIBUTE_KEY, faces, 6 * sizeof (int), 1); @@ -1100,8 +1100,8 @@ t8_analytic_geom (int level, t8_example_geom_type geom_type) forest = t8_forest_new_uniform (cmesh, t8_scheme_new_default (), uniform_level, 0, sc_MPI_COMM_WORLD); if (geom_type == T8_GEOM_CIRCLE) { t8_forest_t forest_adapt; - /* Create a forest that is only refined at the tree boundaries. - * We pass the input level as user pointer and use it in the adapt + /* Create a forest that is only refined at the tree boundaries. + * We pass the input level as user pointer and use it in the adapt * callback to stop refinement after this level. */ forest_adapt = t8_forest_new_adapt (forest, t8_geom_adapt_boundary, 1, 1, &level); forest = forest_adapt; @@ -1135,7 +1135,7 @@ t8_analytic_geom (int level, t8_example_geom_type geom_type) /* The vtu name message was truncated */ /* Note: gcc >= 7.1 prints a warning if we * do not check the return value of snprintf. */ - t8_debugf ("Warning: Truncated vtu name to '%s'\n", vtuname_with_timestep); + t8_debugf ("WARNING: Truncated vtu name to '%s'\n", vtuname_with_timestep); } t8_forest_write_vtk (forest, vtuname_with_timestep); @@ -1175,7 +1175,7 @@ main (int argc, char **argv) /* The help message was truncated */ /* Note: gcc >= 7.1 prints a warning if we * do not check the return value of snprintf. */ - t8_debugf ("Warning: Truncated help message to '%s'\n", help); + t8_debugf ("WARNING: Truncated help message to '%s'\n", help); } mpiret = sc_MPI_Init (&argc, &argv); diff --git a/example/remove/t8_example_empty_trees.cxx b/example/remove/t8_example_empty_trees.cxx index 19da354526..1171c0c080 100644 --- a/example/remove/t8_example_empty_trees.cxx +++ b/example/remove/t8_example_empty_trees.cxx @@ -114,7 +114,7 @@ main (int argc, char **argv) /* The usage string or help message was truncated */ /* Note: gcc >= 7.1 prints a warning if we * do not check the return value of snprintf. */ - t8_debugf ("Warning: Truncated usage string and help message to '%s' and '%s'\n", usage, help); + t8_debugf ("WARNING: Truncated usage string and help message to '%s' and '%s'\n", usage, help); } int mpiret = sc_MPI_Init (&argc, &argv); diff --git a/example/remove/t8_example_gauss_blob.cxx b/example/remove/t8_example_gauss_blob.cxx index 13d10aa3c5..192c8ef591 100644 --- a/example/remove/t8_example_gauss_blob.cxx +++ b/example/remove/t8_example_gauss_blob.cxx @@ -190,7 +190,7 @@ main (int argc, char **argv) /* The usage string or help message was truncated */ /* Note: gcc >= 7.1 prints a warning if we * do not check the return value of snprintf. */ - t8_debugf ("Warning: Truncated usage string and help message to '%s' and '%s'\n", usage, help); + t8_debugf ("WARNING: Truncated usage string and help message to '%s' and '%s'\n", usage, help); } int mpiret = sc_MPI_Init (&argc, &argv); diff --git a/example/remove/t8_example_spheres.cxx b/example/remove/t8_example_spheres.cxx index a5b391f81f..38c95b0c90 100644 --- a/example/remove/t8_example_spheres.cxx +++ b/example/remove/t8_example_spheres.cxx @@ -144,7 +144,7 @@ main (int argc, char **argv) /* The usage string or help message was truncated */ /* Note: gcc >= 7.1 prints a warning if we * do not check the return value of snprintf. */ - t8_debugf ("Warning: Truncated usage string and help message to '%s' and '%s'\n", usage, help); + t8_debugf ("WARNING: Truncated usage string and help message to '%s' and '%s'\n", usage, help); } int mpiret = sc_MPI_Init (&argc, &argv); diff --git a/example/version/t8_version.cxx b/example/version/t8_version.cxx index 89774d0c66..1932f0f5eb 100644 --- a/example/version/t8_version.cxx +++ b/example/version/t8_version.cxx @@ -48,18 +48,18 @@ main (int argc, char **argv) if (sreturn >= BUFSIZ) { /* Usage string was truncated. */ - /* Note: gcc >= 7.1 prints a warning if we + /* Note: gcc >= 7.1 prints a warning if we * do not check the return value of snprintf. */ - t8_debugf ("Warning: Truncated usage string to '%s'\n", usage); + t8_debugf ("WARNING: Truncated usage string to '%s'\n", usage); } /* long help message */ sreturn = snprintf (help, BUFSIZ, "This program prints the version number of t8code.\n\n%s\n", usage); if (sreturn >= BUFSIZ) { /* help message was truncated. */ - /* Note: gcc >= 7.1 prints a warning if we + /* Note: gcc >= 7.1 prints a warning if we * do not check the return value of snprintf. */ - t8_debugf ("Warning: Truncated help message to '%s'\n", help); + t8_debugf ("WARNING: Truncated help message to '%s'\n", help); } /* initialize command line argument parser */ diff --git a/scripts/check_valgrind.sh b/scripts/check_valgrind.sh index c33c685413..6cb8de33bf 100755 --- a/scripts/check_valgrind.sh +++ b/scripts/check_valgrind.sh @@ -92,7 +92,7 @@ VALGRIND_FLAGS="${VALGRIND_FLAGS} --leak-check=full --track-origins=yes \ # We used minimal flags for performance reasons. # Further flags include (but of course are not limited to): --expensive-definedness-checks=yes --track-fds=yes # For more detailed outputs: -read-var-info=yes --read-inline-info=yes --gen-suppressions=all -# Warning: --show-leak-kinds=all will find a lot of still reachable leaks. This is not necessarily a problem. +# WARNING: --show-leak-kinds=all will find a lot of still reachable leaks. This is not necessarily a problem. # Run valgrind on given file with flags and write output to OUTPUT_FILE. mpirun -n $num_procs valgrind $VALGRIND_FLAGS "${FILE}" > /dev/null 2>"${OUTPUT_FILE}" diff --git a/src/t8_cmesh/t8_cmesh_internal/t8_cmesh_partition.cxx b/src/t8_cmesh/t8_cmesh_internal/t8_cmesh_partition.cxx index f7a272d98c..58783c01b4 100644 --- a/src/t8_cmesh/t8_cmesh_internal/t8_cmesh_partition.cxx +++ b/src/t8_cmesh/t8_cmesh_internal/t8_cmesh_partition.cxx @@ -180,7 +180,7 @@ t8_cmesh_gather_trees_per_eclass (const t8_cmesh_t cmesh, sc_MPI_Comm comm) * trees on each process, * additional flag whether we compute the trees per eclass or not * additional flag whether to check if cmesh is committed. - * Warning: use with caution with check_commit = 0 */ + * WARNING: use with caution with check_commit = 0 */ static void t8_cmesh_gather_treecount_ext (const t8_cmesh_t cmesh, sc_MPI_Comm comm, const int check_commit) { diff --git a/src/t8_cmesh/t8_cmesh_io/t8_cmesh_readmshfile.cxx b/src/t8_cmesh/t8_cmesh_io/t8_cmesh_readmshfile.cxx index 4335210028..7ecfaf3a43 100644 --- a/src/t8_cmesh/t8_cmesh_io/t8_cmesh_readmshfile.cxx +++ b/src/t8_cmesh/t8_cmesh_io/t8_cmesh_readmshfile.cxx @@ -1316,7 +1316,7 @@ t8_cmesh_msh_file_4_read_eles (t8_cmesh_t cmesh, FILE *fp, const t8_msh_node_tab if (t8_eclass_to_dimension[eclass] > dim) { t8_errorf ( - "Warning: Encountered element which dimension is greater than %d. Did you set the correct dimension?\n", dim); + "WARNING: Encountered element which dimension is greater than %d. Did you set the correct dimension?\n", dim); } /* Check if the tree is of the correct dimension */ @@ -1419,7 +1419,7 @@ t8_cmesh_msh_file_4_read_eles (t8_cmesh_t cmesh, FILE *fp, const t8_msh_node_tab } free (line); if (tree_count == 0) { - t8_global_errorf ("Warning: No %iD elements found in msh file.\n", dim); + t8_global_errorf ("WARNING: No %iD elements found in msh file.\n", dim); t8_cmesh_destroy (&cmesh); return std::nullopt; } diff --git a/src/t8_vtk/t8_vtk.c b/src/t8_vtk/t8_vtk.c index 3a9480b080..8d9cd816e9 100644 --- a/src/t8_vtk/t8_vtk.c +++ b/src/t8_vtk/t8_vtk.c @@ -42,9 +42,9 @@ t8_write_pvtu (const char *filename, int num_procs, int write_tree, int write_ra if (sreturn >= BUFSIZ) { /* The filename was truncated */ - /* Note: gcc >= 7.1 prints a warning if we + /* Note: gcc >= 7.1 prints a warning if we * do not check the return value of snprintf. */ - t8_debugf ("Warning: Truncated vtk file name to '%s'\n", pvtufilename); + t8_debugf ("WARNING: Truncated vtk file name to '%s'\n", pvtufilename); } pvtufile = fopen (pvtufilename, "wb"); @@ -80,9 +80,9 @@ t8_write_pvtu (const char *filename, int num_procs, int write_tree, int write_ra if (sreturn >= BUFSIZ) { /* The output was truncated */ - /* Note: gcc >= 7.1 prints a warning if we + /* Note: gcc >= 7.1 prints a warning if we * do not check the return value of snprintf. */ - t8_debugf ("Warning: Truncated vtk point data description to '%s'\n", description); + t8_debugf ("WARNING: Truncated vtk point data description to '%s'\n", description); } printed += snprintf (vtkPointDataString + printed, BUFSIZ - printed, "%s%s", printed > 0 ? "," : "", description); @@ -98,9 +98,9 @@ t8_write_pvtu (const char *filename, int num_procs, int write_tree, int write_ra if (sreturn >= BUFSIZ) { /* The output was truncated */ - /* Note: gcc >= 7.1 prints a warning if we + /* Note: gcc >= 7.1 prints a warning if we * do not check the return value of snprintf. */ - t8_debugf ("Warning: Truncated vtk point data description to '%s'\n", description); + t8_debugf ("WARNING: Truncated vtk point data description to '%s'\n", description); } printed += snprintf (vtkPointVectorString + printed, BUFSIZ - printed, "%s%s", printed > 0 ? "," : "", description); @@ -122,9 +122,9 @@ t8_write_pvtu (const char *filename, int num_procs, int write_tree, int write_ra if (sreturn >= BUFSIZ) { /* The output was truncated */ - /* Note: gcc >= 7.1 prints a warning if we + /* Note: gcc >= 7.1 prints a warning if we * do not check the return value of snprintf. */ - t8_debugf ("Warning: Truncated vtk point data description to '%s'\n", description); + t8_debugf ("WARNING: Truncated vtk point data description to '%s'\n", description); } fprintf (pvtufile, @@ -140,9 +140,9 @@ t8_write_pvtu (const char *filename, int num_procs, int write_tree, int write_ra if (sreturn >= BUFSIZ) { /* The output was truncated */ - /* Note: gcc >= 7.1 prints a warning if we + /* Note: gcc >= 7.1 prints a warning if we * do not check the return value of snprintf. */ - t8_debugf ("Warning: Truncated vtk point data description to '%s'\n", description); + t8_debugf ("WARNING: Truncated vtk point data description to '%s'\n", description); } fprintf (pvtufile, @@ -247,9 +247,9 @@ t8_write_pvtu (const char *filename, int num_procs, int write_tree, int write_ra sreturn = snprintf (filename_copy, BUFSIZ, "%s", filename); if (sreturn >= BUFSIZ) { /* The Filename was truncated */ - /* Note: gcc >= 7.1 prints a warning if we + /* Note: gcc >= 7.1 prints a warning if we * do not check the return value of snprintf. */ - t8_debugf ("Warning: Truncated vtk file name copy to '%s'\n", filename_copy); + t8_debugf ("WARNING: Truncated vtk file name copy to '%s'\n", filename_copy); } for (p = 0; p < num_procs; ++p) { fprintf (pvtufile, " \n", basename (filename_copy), p); diff --git a/src/t8_vtk/t8_vtk_write_ASCII.cxx b/src/t8_vtk/t8_vtk_write_ASCII.cxx index c088904948..f1ad7c0aed 100644 --- a/src/t8_vtk/t8_vtk_write_ASCII.cxx +++ b/src/t8_vtk/t8_vtk_write_ASCII.cxx @@ -750,7 +750,7 @@ t8_forest_vtk_write_points (t8_forest_t forest, FILE *vtufile, const int write_g if (sreturn >= BUFSIZ) { /* The output was truncated */ - t8_debugf ("Warning: Truncated vtk point data description to '%s'\n", description); + t8_debugf ("WARNING: Truncated vtk point data description to '%s'\n", description); } freturn = t8_forest_vtk_write_cell_data (forest, vtufile, description, T8_VTK_FLOAT_NAME, "", 8, t8_forest_vtk_vertices_scalar_kernel, write_ghosts, data[idata].data); @@ -766,7 +766,7 @@ t8_forest_vtk_write_points (t8_forest_t forest, FILE *vtufile, const int write_g /* The output was truncated */ /* Note: gcc >= 7.1 prints a warning if we * do not check the return value of snprintf. */ - t8_debugf ("Warning: Truncated vtk point data description to '%s'\n", description); + t8_debugf ("WARNING: Truncated vtk point data description to '%s'\n", description); } freturn = t8_forest_vtk_write_cell_data (forest, vtufile, description, T8_VTK_FLOAT_NAME, component_string, diff --git a/src/t8_vtk/t8_vtk_writer.hxx b/src/t8_vtk/t8_vtk_writer.hxx index d4c3355a4e..f3dea0f20c 100644 --- a/src/t8_vtk/t8_vtk_writer.hxx +++ b/src/t8_vtk/t8_vtk_writer.hxx @@ -567,7 +567,7 @@ struct vtk_writer return false; #else - t8_global_errorf ("Warning: t8code is not linked against vtk library. Vtk output will not be generated.\n"); + t8_global_errorf ("WARNING: t8code is not linked against vtk library. Vtk output will not be generated.\n"); t8_global_productionf ("Consider calling 't8_forest_write_vtk' or 't8_forest_vtk_write_file' instead.\n"); return false; #endif diff --git a/tutorials/features/t8_features_curved_meshes.cxx b/tutorials/features/t8_features_curved_meshes.cxx index 58eb3a622c..d0afc00200 100644 --- a/tutorials/features/t8_features_curved_meshes.cxx +++ b/tutorials/features/t8_features_curved_meshes.cxx @@ -378,7 +378,7 @@ main (int argc, char **argv) /* The help message was truncated */ /* Note: gcc >= 7.1 prints a warning if we * do not check the return value of snprintf. */ - t8_debugf ("Warning: Truncated help message to '%s'\n", help); + t8_debugf ("WARNING: Truncated help message to '%s'\n", help); } /* Initialize MPI. This has to happen before we initialize sc or t8code. */ From 4b4b2ece9adfc24409d84a1415545bc7d63d7dad Mon Sep 17 00:00:00 2001 From: Sandro Elsweijer Date: Mon, 2 Mar 2026 10:24:10 +0100 Subject: [PATCH 03/11] add eol in error message --- src/t8_geometry/t8_geometry_base.hxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/t8_geometry/t8_geometry_base.hxx b/src/t8_geometry/t8_geometry_base.hxx index 4832e30ffc..c25e01b976 100644 --- a/src/t8_geometry/t8_geometry_base.hxx +++ b/src/t8_geometry/t8_geometry_base.hxx @@ -180,7 +180,7 @@ struct t8_geometry virtual bool get_tree_bounding_box ([[maybe_unused]] const t8_cmesh_t cmesh, [[maybe_unused]] double bounds[6]) const { - t8_errorf ("Tree bounding box function not implemented"); + t8_errorf ("Tree bounding box function not implemented\n"); return false; } From 4632cbfa0cd83d8299b8895f991664d950d7597e Mon Sep 17 00:00:00 2001 From: Sandro Elsweijer Date: Mon, 2 Mar 2026 11:01:28 +0100 Subject: [PATCH 04/11] add check for error messages --- .github/workflows/spell_check.yml | 5 +- scripts/internal/check_error_messages.sh | 66 ++++++++++++++++++++++++ scripts/pre-commit | 13 +++-- 3 files changed, 78 insertions(+), 6 deletions(-) create mode 100755 scripts/internal/check_error_messages.sh diff --git a/.github/workflows/spell_check.yml b/.github/workflows/spell_check.yml index 305b1af303..c0452cb8ab 100644 --- a/.github/workflows/spell_check.yml +++ b/.github/workflows/spell_check.yml @@ -38,11 +38,12 @@ jobs: - name: check macros run: | for file in $(git diff --name-only --diff-filter=A); do - ./scripts/internal/check_macros.sh "$file" &>> check_macros.txt + ./scripts/internal/check_macros.sh "$file" &>> error.txt + ./scripts/internal/check_error_messages.sh "$file" &>> error.txt done - name: Archive script output if: failure() uses: actions/upload-artifact@v6 with: name: t8code check macros report - path: check_macros.txt + path: error.txt diff --git a/scripts/internal/check_error_messages.sh b/scripts/internal/check_error_messages.sh new file mode 100755 index 0000000000..fbd27e1c72 --- /dev/null +++ b/scripts/internal/check_error_messages.sh @@ -0,0 +1,66 @@ +#!/bin/bash + +# This file is part of t8code. +# t8code is a C library to manage a collection (a forest) of multiple +# connected adaptive space-trees of general element classes in parallel. +# +# Copyright (C) 2025 the developers +# +# t8code is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# t8code is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with t8code; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +if [ "$#" -ne 1 ]; then + echo "Usage: $0 " + exit 1 +fi + +file_path=$1 + +echo "$file_path" + +if [[ "$file_path" -ef "src/t8_misc/t8_with_macro_error.h" ]] +then + echo The file \"src/t8_misc/t8_with_macro_error.h\" will be ignored by the check_macros.sh script. + exit 0 +fi + +# +# This script searches for lines containing a macro definition in the style of '#ifdef T8_ENABLE_' +# in the specified file and processes each matching line. +# It uses 'grep' to find all occurrences of '#ifdef T8_ENABLE_' in the file located +# at the path stored in the variable 'file_path'. The '-n' option with 'grep' +# ensures that the line numbers of the matching lines are included in the output. +# The output of 'grep' is then piped into a 'while' loop, which reads each line +# and splits it into the line number and the line content using ':' as the delimiter. +# Variables: +# - file_path: The path to the file to be searched. +# - line_number: The line number where the macro definition is found. +# - line: The content of the line where the macro definition is found. +# + +found_faulty_message=false +while IFS=: read -r line_number line; do + if message=$(echo "$line" | grep -oP '["`](?i:(warning|error))'); then + if ! echo "$line" | grep -qE '^[\"`](ERROR|WARNING)'; then + echo "Incorrect error/warning message found in $file_path on line $line_number: $message. Please use 'ERROR' or 'WARNING' instead." + found_faulty_message = true + fi + fi +done < "$file_path" + +if [ "$found_faulty_message"=true ]; then + exit 1 +else + exit 0 +fi diff --git a/scripts/pre-commit b/scripts/pre-commit index cf062bdace..a7d15fc99a 100755 --- a/scripts/pre-commit +++ b/scripts/pre-commit @@ -39,6 +39,7 @@ GIT_REPO_PATH=$(git rev-parse --show-toplevel) # Set paths to check scripts CHECK_INDENT=$GIT_REPO_PATH/scripts/check_if_file_indented.sh CHECK_MACROS=$GIT_REPO_PATH/scripts/internal/check_macros.sh +CHECK_ERROR_MESSAGES=$GIT_REPO_PATH/scripts/internal/check_error_messages.sh TYPOS=`which typos 2> /dev/null` TYPOS_CONFIG_FILE=./.typos.toml @@ -110,10 +111,14 @@ do # This script checks for the usage of #ifdef T8_ENABLE_ macros in the specified file. # If such macros are found, it suggests using #if T8_ENABLE_ instead and sets a flag to indicate the issue. - # - $CHECK_MACROS: Command or script to check the macros in the file. - # - $file: The file being checked. - # - status: The exit status of the $CHECK_MACROS command. - # - nocontinue: Flag set to 1 if the incorrect macro usage is found. + $CHECK_MACROS $file + status=$? + if test $status -ne 0 + then + nocontinue=1 + fi + + # This script checks if an error or warning message is not capitalized. $CHECK_MACROS $file status=$? if test $status -ne 0 From 52b916ab5c9242df20cc8ce97a572d3d480050a5 Mon Sep 17 00:00:00 2001 From: Sandro Elsweijer Date: Mon, 2 Mar 2026 11:01:56 +0100 Subject: [PATCH 05/11] use proper booleans instead of true false strings --- scripts/internal/check_macros.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/internal/check_macros.sh b/scripts/internal/check_macros.sh index 7597ea9c11..ee6697e1c2 100755 --- a/scripts/internal/check_macros.sh +++ b/scripts/internal/check_macros.sh @@ -49,23 +49,23 @@ fi # - line: The content of the line where the macro definition is found. # -found_macros=FALSE +found_macros=false # Check for #ifdef T8_ENABLE while IFS=: read -r line_number line; do macro_name=$(echo "$line" | grep -o 'T8_ENABLE_[^ ]*') echo "Incorrect macro found in $file_path on line $line_number: $macro_name. Please use '#if T8_ENABLE_' instead." - found_macros=TRUE + found_macros=true done < <(grep -n '#ifdef T8_ENABLE_' "$file_path") # Check for #ifdef T8_WITH or #if T8_WITH while IFS=: read -r line_number line; do macro_name=$(echo "$line" | grep -o 'T8_WITH_[^ ]*') echo "Incorrect macro found in $file_path on line $line_number: $macro_name. Please use '#if T8_ENABLE_' instead." - found_macros=TRUE + found_macros=true done < <(grep -E -n '#if T8_WITH_|#ifdef T8_WITH' "$file_path") -if [ "$found_macros" = "TRUE" ]; then +if [ "$found_macros"=true ]; then exit 1 else exit 0 From a3c41a01af75d3897735ba86439278985904f447 Mon Sep 17 00:00:00 2001 From: Sandro Elsweijer Date: Mon, 2 Mar 2026 14:58:47 +0100 Subject: [PATCH 06/11] Error -> ERROR --- benchmarks/t8_time_forest_partition.cxx | 2 +- example/IO/cmesh/gmsh/t8_read_msh_file.cxx | 2 +- example/IO/cmesh/t8_cmesh_load_save.cxx | 4 +- .../IO/cmesh/tetgen/t8_forest_from_tetgen.cxx | 2 +- .../IO/cmesh/tetgen/t8_read_tetgen_file.cxx | 4 +- .../cmesh/triangle/t8_read_triangle_file.cxx | 2 +- .../IO/cmesh/vtk/t8_cmesh_read_from_vtk.cxx | 2 +- example/advect/t8_advection.cxx | 2 +- .../t8_cmesh_internal/t8_cmesh_commit.cxx | 2 +- .../t8_cmesh_internal/t8_cmesh_copy.c | 2 +- .../t8_cmesh_internal/t8_cmesh_partition.cxx | 2 +- .../t8_cmesh_io/t8_cmesh_readmshfile.cxx | 40 ++--- src/t8_cmesh/t8_cmesh_io/t8_cmesh_save.cxx | 28 +-- .../t8_cmesh_io/t8_cmesh_triangle.cxx | 12 +- .../t8_cmesh_vertex_conn_tree_to_vertex.cxx | 2 +- src/t8_forest/t8_forest_adapt.cxx | 24 +-- src/t8_forest/t8_forest_ghost.cxx | 160 +++++++++--------- src/t8_forest/t8_forest_partition.cxx | 8 +- src/t8_vtk/t8_vtk_write_ASCII.cxx | 20 +-- src/t8_vtk/t8_vtk_writer.hxx | 2 +- src/t8_vtk/t8_with_vtk/t8_vtk_reader.cxx | 4 +- test/t8_cmesh/t8_gtest_cmesh_readmshfile.cxx | 2 +- test/t8_data/t8_gtest_shmem.cxx | 8 +- test/t8_forest/t8_gtest_ghost_exchange.cxx | 4 +- 24 files changed, 170 insertions(+), 170 deletions(-) diff --git a/benchmarks/t8_time_forest_partition.cxx b/benchmarks/t8_time_forest_partition.cxx index c50ebe9b11..936d14cc5f 100644 --- a/benchmarks/t8_time_forest_partition.cxx +++ b/benchmarks/t8_time_forest_partition.cxx @@ -264,7 +264,7 @@ t8_time_forest_create_cmesh (const char *msh_file, int mesh_dim, const char *cme /* Partition only if more than 1 input file */ partition = num_files > 1; } - SC_CHECK_ABORT (cmesh != NULL, "Error when creating cmesh.\n"); + SC_CHECK_ABORT (cmesh != NULL, "ERROR when creating cmesh.\n"); if (partition) { /* partition the cmesh uniformly */ diff --git a/example/IO/cmesh/gmsh/t8_read_msh_file.cxx b/example/IO/cmesh/gmsh/t8_read_msh_file.cxx index 49523f34e1..4dad39fc04 100644 --- a/example/IO/cmesh/gmsh/t8_read_msh_file.cxx +++ b/example/IO/cmesh/gmsh/t8_read_msh_file.cxx @@ -44,7 +44,7 @@ t8_read_msh_file_vtk (t8_cmesh_t cmesh, const char *prefix) t8_debugf ("Wrote to file %s\n", fileprefix); } else { - t8_debugf ("Error in writing cmesh vtk\n"); + t8_debugf ("ERROR in writing cmesh vtk\n"); } } diff --git a/example/IO/cmesh/t8_cmesh_load_save.cxx b/example/IO/cmesh/t8_cmesh_load_save.cxx index 1e3dfcf043..e24dcb5396 100644 --- a/example/IO/cmesh/t8_cmesh_load_save.cxx +++ b/example/IO/cmesh/t8_cmesh_load_save.cxx @@ -34,7 +34,7 @@ t8_cmesh_load_distribute (const char *fileprefix, int num_files, int no_vtk) cmesh = t8_cmesh_load_and_distribute (fileprefix, num_files, sc_MPI_COMM_WORLD, T8_LOAD_SIMPLE, -1); if (cmesh == NULL) { - t8_errorf ("Error when reading cmesh\n"); + t8_errorf ("ERROR when reading cmesh\n"); return; } else { @@ -75,7 +75,7 @@ t8_cmesh_save_cmesh (const char *mshfile, int dim) SC_CHECK_MPI (mpiret); ret = t8_cmesh_save (cmesh, "cmesh_saved"); if (ret == 0) { - t8_errorf ("Error when writing to file\n"); + t8_errorf ("ERROR when writing to file\n"); } else { t8_debugf ("Saved cmesh to %s\n", "cmesh_saved_RANK.cmesh"); diff --git a/example/IO/cmesh/tetgen/t8_forest_from_tetgen.cxx b/example/IO/cmesh/tetgen/t8_forest_from_tetgen.cxx index 6c708431a1..67f8856b5d 100644 --- a/example/IO/cmesh/tetgen/t8_forest_from_tetgen.cxx +++ b/example/IO/cmesh/tetgen/t8_forest_from_tetgen.cxx @@ -49,7 +49,7 @@ t8_cmesh_from_tetgen (const char *prefix, int do_partition) t8_debugf ("Wrote to file %s\n", fileprefix); } else { - t8_debugf ("Error in writing cmesh vtk\n"); + t8_debugf ("ERROR in writing cmesh vtk\n"); } } else { diff --git a/example/IO/cmesh/tetgen/t8_read_tetgen_file.cxx b/example/IO/cmesh/tetgen/t8_read_tetgen_file.cxx index a32826757b..9bc680628a 100644 --- a/example/IO/cmesh/tetgen/t8_read_tetgen_file.cxx +++ b/example/IO/cmesh/tetgen/t8_read_tetgen_file.cxx @@ -46,7 +46,7 @@ t8_read_tetgen_file_build_cmesh (const char *prefix, int do_dup, int do_partitio t8_debugf ("Wrote to file %s\n", fileprefix); } else { - t8_debugf ("Error in writing cmesh vtk\n"); + t8_debugf ("ERROR in writing cmesh vtk\n"); } if (do_partition) { t8_cmesh_t cmesh_partitioned; @@ -64,7 +64,7 @@ t8_read_tetgen_file_build_cmesh (const char *prefix, int do_dup, int do_partitio t8_debugf ("Wrote to file %s\n", fileprefix); } else { - t8_debugf ("Error in writing cmesh vtk\n"); + t8_debugf ("ERROR in writing cmesh vtk\n"); } t8_cmesh_unref (&cmesh_partitioned); } diff --git a/example/IO/cmesh/triangle/t8_read_triangle_file.cxx b/example/IO/cmesh/triangle/t8_read_triangle_file.cxx index 88f07314a4..6e5eba080f 100644 --- a/example/IO/cmesh/triangle/t8_read_triangle_file.cxx +++ b/example/IO/cmesh/triangle/t8_read_triangle_file.cxx @@ -61,7 +61,7 @@ t8_read_triangle_file_build_cmesh (const char *prefix, int do_dup, int do_partit t8_debugf ("Wrote to file %s\n", fileprefix); } else { - t8_debugf ("Error in writing cmesh vtk\n"); + t8_debugf ("ERROR in writing cmesh vtk\n"); } t8_cmesh_destroy (&cmesh); } diff --git a/example/IO/cmesh/vtk/t8_cmesh_read_from_vtk.cxx b/example/IO/cmesh/vtk/t8_cmesh_read_from_vtk.cxx index 72be87d3ad..965ec7258f 100644 --- a/example/IO/cmesh/vtk/t8_cmesh_read_from_vtk.cxx +++ b/example/IO/cmesh/vtk/t8_cmesh_read_from_vtk.cxx @@ -48,7 +48,7 @@ t8_forest_construct_from_vtk (const char *prefix, sc_MPI_Comm comm, const int va * Triangle-strips and polygons will be broken down to multiple triangles. */ t8_cmesh_t cmesh_in = t8_vtk_reader_cmesh (prefix, partition, 0, comm, vtk_file_type, user_package_id, 0); if (cmesh_in == NULL) { - t8_errorf ("Error reading file.\n"); + t8_errorf ("ERROR reading file.\n"); return; } char out_file[BUFSIZ]; diff --git a/example/advect/t8_advection.cxx b/example/advect/t8_advection.cxx index 3fcdd4a07d..3b0928cde4 100644 --- a/example/advect/t8_advection.cxx +++ b/example/advect/t8_advection.cxx @@ -1109,7 +1109,7 @@ t8_advect_write_vtk (t8_advect_problem_t *problem) snprintf (vtk_data[1].description, BUFSIZ, "Ana. Solution"); vtk_data[1].type = T8_VTK_SCALAR; vtk_data[1].data = u_and_phi_array[1]; - snprintf (vtk_data[2].description, BUFSIZ, "Error"); + snprintf (vtk_data[2].description, BUFSIZ, "ERROR"); vtk_data[2].type = T8_VTK_SCALAR; vtk_data[2].data = u_and_phi_array[2]; snprintf (vtk_data[3].description, BUFSIZ, "Flow"); diff --git a/src/t8_cmesh/t8_cmesh_internal/t8_cmesh_commit.cxx b/src/t8_cmesh/t8_cmesh_internal/t8_cmesh_commit.cxx index e9d8ebb3a9..0f37d56f8b 100644 --- a/src/t8_cmesh/t8_cmesh_internal/t8_cmesh_commit.cxx +++ b/src/t8_cmesh/t8_cmesh_internal/t8_cmesh_commit.cxx @@ -240,7 +240,7 @@ t8_cmesh_commit_partitioned_new (t8_cmesh_t cmesh, sc_MPI_Comm comm) /* TODO: reset cmesh */ return; } - SC_CHECK_ABORT (t8_shmem_init (comm) > 0, "Error in shared memory setup. Could not build Cmesh."); + SC_CHECK_ABORT (t8_shmem_init (comm) > 0, "ERROR in shared memory setup. Could not build Cmesh."); t8_cmesh_set_shmem_type (comm); /* TODO: do we actually need the shared array? */ t8_stash_attribute_sort (cmesh->stash); diff --git a/src/t8_cmesh/t8_cmesh_internal/t8_cmesh_copy.c b/src/t8_cmesh/t8_cmesh_internal/t8_cmesh_copy.c index 25e52c4320..b97737b48c 100644 --- a/src/t8_cmesh/t8_cmesh_internal/t8_cmesh_copy.c +++ b/src/t8_cmesh/t8_cmesh_internal/t8_cmesh_copy.c @@ -43,7 +43,7 @@ t8_cmesh_copy (t8_cmesh_t cmesh, const t8_cmesh_t cmesh_from, sc_MPI_Comm comm) T8_ASSERT (t8_cmesh_is_committed (cmesh_from)); if (t8_cmesh_uses_vertex_connectivity (cmesh_from)) { - SC_ABORT ("Error in t8_cmesh_copy: The given cmesh cannot be copied because it uses vertex connectivity, " + SC_ABORT ("ERROR in t8_cmesh_copy: The given cmesh cannot be copied because it uses vertex connectivity, " "see https://github.com/DLR-AMR/t8code/issues/1799.\n"); } diff --git a/src/t8_cmesh/t8_cmesh_internal/t8_cmesh_partition.cxx b/src/t8_cmesh/t8_cmesh_internal/t8_cmesh_partition.cxx index 58783c01b4..df040ff08b 100644 --- a/src/t8_cmesh/t8_cmesh_internal/t8_cmesh_partition.cxx +++ b/src/t8_cmesh/t8_cmesh_internal/t8_cmesh_partition.cxx @@ -194,7 +194,7 @@ t8_cmesh_gather_treecount_ext (const t8_cmesh_t cmesh, sc_MPI_Comm comm, const i tree_offset = cmesh->first_tree_shared ? -cmesh->first_tree - 1 : cmesh->first_tree; if (cmesh->tree_offsets == NULL) { - SC_CHECK_ABORT (t8_shmem_init (comm) > 0, "Error in shared memory setup."); + SC_CHECK_ABORT (t8_shmem_init (comm) > 0, "ERROR in shared memory setup."); t8_shmem_set_type (comm, T8_SHMEM_BEST_TYPE); /* Only allocate the shmem array, if it is not already allocated */ cmesh->tree_offsets = t8_cmesh_alloc_offsets (cmesh->mpisize, comm); diff --git a/src/t8_cmesh/t8_cmesh_io/t8_cmesh_readmshfile.cxx b/src/t8_cmesh/t8_cmesh_io/t8_cmesh_readmshfile.cxx index 7ecfaf3a43..1feb68673a 100644 --- a/src/t8_cmesh/t8_cmesh_io/t8_cmesh_readmshfile.cxx +++ b/src/t8_cmesh/t8_cmesh_io/t8_cmesh_readmshfile.cxx @@ -453,13 +453,13 @@ t8_msh_file_4_read_nodes (FILE *fp) for (long n_block = 0; n_block < lnum_blocks; ++n_block) { retval = t8_cmesh_msh_read_next_line (&line, &linen, fp); if (retval < 0) { - t8_global_errorf ("Error reading node file.\n"); + t8_global_errorf ("ERROR reading node file.\n"); free (line); return std::nullopt; } retval = sscanf (line, "%i %i %i %li", &entity_dim, &entity_tag, ¶metric, &num_nodes_in_block); if (retval != 4) { - t8_global_errorf ("Error reading block after node %li in $Nodes section.\n", (long) last_index); + t8_global_errorf ("ERROR reading block after node %li in $Nodes section.\n", (long) last_index); free (line); return std::nullopt; } @@ -468,13 +468,13 @@ t8_msh_file_4_read_nodes (FILE *fp) for (ln = 0; ln < num_nodes_in_block; ++ln) { retval = t8_cmesh_msh_read_next_line (&line, &linen, fp); if (retval < 0) { - t8_global_errorf ("Error reading node file.\n"); + t8_global_errorf ("ERROR reading node file.\n"); free (line); return std::nullopt; } retval = sscanf (line, "%li", &index_buffer[ln]); if (retval != 1) { - t8_global_errorf ("Error reading node file after node %li.\n", (long) last_index); + t8_global_errorf ("ERROR reading node file after node %li.\n", (long) last_index); free (line); return std::nullopt; } @@ -488,7 +488,7 @@ t8_msh_file_4_read_nodes (FILE *fp) * The coordinates followed by their parameters. */ retval = t8_cmesh_msh_read_next_line (&line, &linen, fp); if (retval < 0) { - t8_global_errorf ("Error reading node file\n"); + t8_global_errorf ("ERROR reading node file\n"); free (line); return std::nullopt; } @@ -496,7 +496,7 @@ t8_msh_file_4_read_nodes (FILE *fp) if (!parametric) { retval = sscanf (line, "%lf %lf %lf", &coords[0], &coords[1], &coords[2]); if (retval != 3) { - t8_global_errorf ("Error reading node file after node %li.\n", (long) last_index); + t8_global_errorf ("ERROR reading node file after node %li.\n", (long) last_index); free (line); return std::nullopt; } @@ -507,7 +507,7 @@ t8_msh_file_4_read_nodes (FILE *fp) case 1: retval = sscanf (line, "%lf %lf %lf %lf", &coords[0], &coords[1], &coords[2], ¶ms[0]); if (retval != 4) { - t8_global_errorf ("Error reading node file after node %li.\n", (long) last_index); + t8_global_errorf ("ERROR reading node file after node %li.\n", (long) last_index); free (line); return std::nullopt; } @@ -515,13 +515,13 @@ t8_msh_file_4_read_nodes (FILE *fp) case 2: retval = sscanf (line, "%lf %lf %lf %lf %lf", &coords[0], &coords[1], &coords[2], ¶ms[0], ¶ms[1]); if (retval != 5) { - t8_global_errorf ("Error reading node file after node %li.\n", (long) last_index); + t8_global_errorf ("ERROR reading node file after node %li.\n", (long) last_index); free (line); return std::nullopt; } break; default: - t8_global_errorf ("Error reading node file after node %li.\n", (long) last_index); + t8_global_errorf ("ERROR reading node file after node %li.\n", (long) last_index); free (line); return std::nullopt; } @@ -793,7 +793,7 @@ t8_cmesh_process_tree_geometry (const t8_cmesh_t cmesh, const t8_eclass_t eclass } if (!reference_parameters_on_surface.has_value ()) { - t8_global_errorf ("Error during mesh-cad recombination: Reference parameters on surface not found.\n"); + t8_global_errorf ("ERROR during mesh-cad recombination: Reference parameters on surface not found.\n"); return 0; } @@ -1003,7 +1003,7 @@ t8_cmesh_process_tree_geometry (const t8_cmesh_t cmesh, const t8_eclass_t eclass if (face_geometries[t8_edge_to_face[eclass][i_tree_edges][i_adjacent_face]] > 0) { if (!cad_geometry->get_cad_manager ()->t8_geom_is_edge_on_face ( edge_geometry_tag, face_geometries[t8_edge_to_face[eclass][i_tree_edges][i_adjacent_face]])) { - t8_global_errorf ("Error during mesh-cad recombination: Adjacent edge and face of a tree carry " + t8_global_errorf ("ERROR during mesh-cad recombination: Adjacent edge and face of a tree carry " "incompatible geometries.\n"); return 0; } @@ -1020,13 +1020,13 @@ t8_cmesh_process_tree_geometry (const t8_cmesh_t cmesh, const t8_eclass_t eclass for (const auto &edge_node : edge_nodes) { /* Some error checking */ if (edge_node.entity_dim == 2) { - t8_global_errorf ("Error during mesh-cad recombination: Node %li should lie on a vertex or an edge, " + t8_global_errorf ("ERROR during mesh-cad recombination: Node %li should lie on a vertex or an edge, " "but it lies on a surface.\n", edge_node.index); return 0; } if (edge_node.entity_dim == 1 && edge_node.entity_tag != edge_geometry_tag) { - t8_global_errorf ("Error during mesh-cad recombination: Node %li should lie on a specific edge, " + t8_global_errorf ("ERROR during mesh-cad recombination: Node %li should lie on a specific edge, " "but it lies on another edge.\n", edge_node.index); return 0; @@ -1034,7 +1034,7 @@ t8_cmesh_process_tree_geometry (const t8_cmesh_t cmesh, const t8_eclass_t eclass if (edge_node.entity_dim == 0) { if (!cad_geometry->get_cad_manager ()->t8_geom_is_vertex_on_edge (edge_node.entity_tag, edge_geometry_tag)) { t8_global_errorf ( - "Error during mesh-cad recombination: Node %li should lie on a vertex which lies on an edge, " + "ERROR during mesh-cad recombination: Node %li should lie on a vertex which lies on an edge, " "but the vertex does not lie on that edge.\n", edge_node.index); return 0; @@ -1062,7 +1062,7 @@ t8_cmesh_process_tree_geometry (const t8_cmesh_t cmesh, const t8_eclass_t eclass } if (!reference_param.has_value ()) { - t8_global_errorf ("Error during mesh-cad recombination: Reference parameter on curve not found.\n"); + t8_global_errorf ("ERROR during mesh-cad recombination: Reference parameter on curve not found.\n"); return 0; } @@ -1107,7 +1107,7 @@ t8_cmesh_process_tree_geometry (const t8_cmesh_t cmesh, const t8_eclass_t eclass for (const auto &edge_node : edge_nodes) { /* Some error checking */ if (edge_node.entity_dim == 2 && edge_node.entity_tag != edge_geometry_tag) { - t8_global_errorf ("Error during mesh-cad recombination: Node %li should lie on a specific face, but it lies " + t8_global_errorf ("ERROR during mesh-cad recombination: Node %li should lie on a specific face, but it lies " "on another face.\n", edge_node.index); return 0; @@ -1115,7 +1115,7 @@ t8_cmesh_process_tree_geometry (const t8_cmesh_t cmesh, const t8_eclass_t eclass if (edge_node.entity_dim == 0) { if (!cad_geometry->get_cad_manager ()->t8_geom_is_vertex_on_face (edge_node.entity_tag, edge_geometry_tag)) { t8_global_errorf ( - "Error during mesh-cad recombination: Node %li should lie on a vertex which lies on a face, " + "ERROR during mesh-cad recombination: Node %li should lie on a vertex which lies on a face, " "but the vertex does not lie on that face.\n", edge_node.index); return 0; @@ -1124,7 +1124,7 @@ t8_cmesh_process_tree_geometry (const t8_cmesh_t cmesh, const t8_eclass_t eclass if (edge_node.entity_dim == 1) { if (!cad_geometry->get_cad_manager ()->t8_geom_is_edge_on_face (edge_node.entity_tag, edge_geometry_tag)) { t8_global_errorf ( - "Error during mesh-cad recombination: Node %li should lie on an edge which lies on a face, " + "ERROR during mesh-cad recombination: Node %li should lie on an edge which lies on a face, " "but the edge does not lie on that face.\n", edge_node.index); return 0; @@ -1160,7 +1160,7 @@ t8_cmesh_process_tree_geometry (const t8_cmesh_t cmesh, const t8_eclass_t eclass } if (!reference_params.has_value ()) { - t8_global_errorf ("Error during mesh-cad recombination: Reference parameter on curve not found.\n"); + t8_global_errorf ("ERROR during mesh-cad recombination: Reference parameter on curve not found.\n"); return 0; } @@ -1297,7 +1297,7 @@ t8_cmesh_msh_file_4_read_eles (t8_cmesh_t cmesh, FILE *fp, const t8_msh_node_tab retval = sscanf (line, "%i %li %i %li", &entity_dim, &entity_tag, &ele_type, &num_ele_in_block); /* Checking for read/write error */ if (retval != 4) { - t8_global_errorf ("Error while reading element block information.\n"); + t8_global_errorf ("ERROR while reading element block information.\n"); t8_debugf ("The line is %s", line); free (line); t8_cmesh_destroy (&cmesh); diff --git a/src/t8_cmesh/t8_cmesh_io/t8_cmesh_save.cxx b/src/t8_cmesh/t8_cmesh_io/t8_cmesh_save.cxx index c4d14ebc53..d380712719 100644 --- a/src/t8_cmesh/t8_cmesh_io/t8_cmesh_save.cxx +++ b/src/t8_cmesh/t8_cmesh_io/t8_cmesh_save.cxx @@ -532,7 +532,7 @@ t8_cmesh_save (const t8_cmesh_t cmesh, const char *fileprefix) } if (!has_linear_geom) { /* This cmesh does not have the linear geometry for all trees. */ - t8_errorf ("Error when saving cmesh. Cmesh has more than one geometry or the geometry is not linear.\n"); + t8_errorf ("ERROR when saving cmesh. Cmesh has more than one geometry or the geometry is not linear.\n"); return 0; } @@ -544,35 +544,35 @@ t8_cmesh_save (const t8_cmesh_t cmesh, const char *fileprefix) fp = fopen (filename, "w"); if (fp == NULL) { /* Could not open file */ - t8_errorf ("Error when opening file %s.\n", filename); + t8_errorf ("ERROR when opening file %s.\n", filename); return 0; } /* Write all metadata of the cmesh */ if (!t8_cmesh_save_header (cmesh, fp)) { - t8_errorf ("Error when opening file %s.\n", filename); + t8_errorf ("ERROR when opening file %s.\n", filename); return 0; } /* Write all metadata of the trees */ if (!t8_cmesh_save_trees (cmesh, fp)) { - t8_errorf ("Error when opening file %s.\n", filename); + t8_errorf ("ERROR when opening file %s.\n", filename); return 0; } if (cmesh->set_partition) { /* Write all ghost metadata */ if (!t8_cmesh_save_ghosts (cmesh, fp)) { - t8_errorf ("Error when opening file %s.\n", filename); + t8_errorf ("ERROR when opening file %s.\n", filename); return 0; } } if (!t8_cmesh_save_tree_attribute (cmesh, fp)) { /* Write all tree attributes */ - t8_errorf ("Error when opening file %s.\n", filename); + t8_errorf ("ERROR when opening file %s.\n", filename); return 0; } if (cmesh->set_partition) { /* Write all ghost neighbor data */ if (!t8_cmesh_save_ghost_neighbors (cmesh, fp)) { - t8_errorf ("Error when opening file %s.\n", filename); + t8_errorf ("ERROR when opening file %s.\n", filename); return 0; } } @@ -594,40 +594,40 @@ t8_cmesh_load (const char *filename, sc_MPI_Comm comm) fp = fopen (filename, "r"); if (fp == NULL) { /* Could not open file */ - t8_errorf ("Error when opening file %s.\n", filename); + t8_errorf ("ERROR when opening file %s.\n", filename); return NULL; } t8_cmesh_init (&cmesh); /* Read all metadata of the cmesh */ if (!t8_cmesh_load_header (cmesh, fp)) { - t8_errorf ("Error when opening file %s.\n", filename); + t8_errorf ("ERROR when opening file %s.\n", filename); t8_cmesh_destroy (&cmesh); return NULL; } /* Read all metadata of the trees */ if (!t8_cmesh_load_trees (cmesh, fp)) { - t8_errorf ("Error when opening file %s.\n", filename); + t8_errorf ("ERROR when opening file %s.\n", filename); t8_cmesh_destroy (&cmesh); return NULL; } if (cmesh->set_partition) { /* Write all ghost metadata */ if (!t8_cmesh_load_ghosts (cmesh, fp)) { - t8_errorf ("Error when opening file %s.\n", filename); + t8_errorf ("ERROR when opening file %s.\n", filename); t8_cmesh_destroy (&cmesh); return NULL; } } t8_cmesh_trees_finish_part (cmesh->trees, 0); if (!t8_cmesh_load_tree_attributes (cmesh, fp)) { - t8_errorf ("Error when opening file %s.\n", filename); + t8_errorf ("ERROR when opening file %s.\n", filename); t8_cmesh_destroy (&cmesh); return NULL; } if (cmesh->set_partition) { /* Write all ghost metadata */ if (!t8_cmesh_load_ghost_attributes (cmesh, fp)) { - t8_errorf ("Error when opening file %s.\n", filename); + t8_errorf ("ERROR when opening file %s.\n", filename); t8_cmesh_destroy (&cmesh); return NULL; } @@ -831,7 +831,7 @@ t8_cmesh_load_and_distribute (const char *fileprefix, const int num_files, sc_MP T8_ASSERT (mpisize >= num_files); /* Try to set the comm type */ - SC_CHECK_ABORT (t8_shmem_init (comm) > 0, "Error in shared memory setup. Could not load cmesh."); + SC_CHECK_ABORT (t8_shmem_init (comm) > 0, "ERROR in shared memory setup. Could not load cmesh."); t8_shmem_set_type (comm, T8_SHMEM_BEST_TYPE); /* Use cmesh_bcast, if only one process loads the cmesh: */ diff --git a/src/t8_cmesh/t8_cmesh_io/t8_cmesh_triangle.cxx b/src/t8_cmesh/t8_cmesh_io/t8_cmesh_triangle.cxx index 916f6d4af3..d7b68d0f2d 100644 --- a/src/t8_cmesh/t8_cmesh_io/t8_cmesh_triangle.cxx +++ b/src/t8_cmesh/t8_cmesh_io/t8_cmesh_triangle.cxx @@ -523,7 +523,7 @@ t8_cmesh_from_tetgen_or_triangle_file (char *fileprefix, int partition, sc_MPI_C snprintf (current_file, BUFSIZ, "%s.node", fileprefix); retval = t8_cmesh_triangle_read_nodes (cmesh, current_file, &vertices, &num_vertices, dim); if (retval != 0 && retval != 1) { - t8_global_errorf ("Error while parsing file %s.\n", current_file); + t8_global_errorf ("ERROR while parsing file %s.\n", current_file); t8_cmesh_unref (&cmesh); return NULL; } @@ -538,7 +538,7 @@ t8_cmesh_from_tetgen_or_triangle_file (char *fileprefix, int partition, sc_MPI_C #endif ); if (retval != 0 && retval != 1) { - t8_global_errorf ("Error while parsing file %s.\n", current_file); + t8_global_errorf ("ERROR while parsing file %s.\n", current_file); t8_cmesh_unref (&cmesh); return NULL; } @@ -547,7 +547,7 @@ t8_cmesh_from_tetgen_or_triangle_file (char *fileprefix, int partition, sc_MPI_C snprintf (current_file, BUFSIZ, "%s.neigh", fileprefix); retval = t8_cmesh_triangle_read_neigh (cmesh, corner_offset, current_file, dim); if (retval != 0) { - t8_global_errorf ("Error while parsing file %s.\n", current_file); + t8_global_errorf ("ERROR while parsing file %s.\n", current_file); t8_cmesh_unref (&cmesh); return NULL; } @@ -603,7 +603,7 @@ t8_cmesh_from_tetgen_or_triangle_file_time (char *fileprefix, int partition, sc_ snprintf (current_file, BUFSIZ, "%s.node", fileprefix); retval = t8_cmesh_triangle_read_nodes (cmesh, current_file, &vertices, &num_vertices, dim); if (retval != 0 && retval != 1) { - t8_global_errorf ("Error while parsing file %s.\n", current_file); + t8_global_errorf ("ERROR while parsing file %s.\n", current_file); t8_cmesh_unref (&cmesh); return NULL; } @@ -618,7 +618,7 @@ t8_cmesh_from_tetgen_or_triangle_file_time (char *fileprefix, int partition, sc_ #endif ); if (retval != 0 && retval != 1) { - t8_global_errorf ("Error while parsing file %s.\n", current_file); + t8_global_errorf ("ERROR while parsing file %s.\n", current_file); t8_cmesh_unref (&cmesh); return NULL; } @@ -627,7 +627,7 @@ t8_cmesh_from_tetgen_or_triangle_file_time (char *fileprefix, int partition, sc_ snprintf (current_file, BUFSIZ, "%s.neigh", fileprefix); retval = t8_cmesh_triangle_read_neigh (cmesh, corner_offset, current_file, dim); if (retval != 0) { - t8_global_errorf ("Error while parsing file %s.\n", current_file); + t8_global_errorf ("ERROR while parsing file %s.\n", current_file); t8_cmesh_unref (&cmesh); } } diff --git a/src/t8_cmesh/t8_cmesh_vertex_connectivity/t8_cmesh_vertex_conn_tree_to_vertex.cxx b/src/t8_cmesh/t8_cmesh_vertex_connectivity/t8_cmesh_vertex_conn_tree_to_vertex.cxx index 157f453f1c..0619da4aa3 100644 --- a/src/t8_cmesh/t8_cmesh_vertex_connectivity/t8_cmesh_vertex_conn_tree_to_vertex.cxx +++ b/src/t8_cmesh/t8_cmesh_vertex_connectivity/t8_cmesh_vertex_conn_tree_to_vertex.cxx @@ -80,7 +80,7 @@ t8_cmesh_vertex_conn_tree_to_vertex::t8_cmesh_vertex_conn_tree_to_vertex ( tree_indices.size () == (size_t) num_tree_vertices, "ERROR. Number of mapped local tree vertices for tree %i does not equal number of tree vertices. %zu != %i\n", itree, tree_indices.size (), num_tree_vertices); - /* We now build the array of global indices of this tree, sorted + /* We now build the array of global indices of this tree, sorted * by the trees local indices. */ t8_gloidx_t *global_tree_indices = T8_ALLOC (t8_gloidx_t, num_tree_vertices); for (int ivertex = 0; ivertex < num_tree_vertices; ++ivertex) { diff --git a/src/t8_forest/t8_forest_adapt.cxx b/src/t8_forest/t8_forest_adapt.cxx index b6f6486e77..2c9830554f 100644 --- a/src/t8_forest/t8_forest_adapt.cxx +++ b/src/t8_forest/t8_forest_adapt.cxx @@ -35,17 +35,17 @@ T8_EXTERN_C_BEGIN (); #if T8_ENABLE_DEBUG /** Return zero if the first \a num_elements in \a elements are not a (sub)family. - * \param [in] scheme The element scheme for current local tree + * \param [in] scheme The element scheme for current local tree * where the elements are from. * \param [in] tree_class The eclass of tree the elements are part of. * \param [in] elements The elements array. * \param [in] num_elements The first \a num_elements to be checked in \a elements. - * \return 0 if the first \a num_elements in \a elements are + * \return 0 if the first \a num_elements in \a elements are * not a (sub)family. * \note If the first element has level 0, the return is 0. * \note This test does not compare with the elements before and after the elements * given by \a elements in the current forest. A non-zero return is therefore - * not valid. + * not valid. */ static int t8_forest_is_family_callback (const t8_scheme *scheme, t8_eclass_t tree_class, const int num_elements, @@ -100,7 +100,7 @@ t8_forest_is_family_callback (const t8_scheme *scheme, t8_eclass_t tree_class, c * \param [in] telements_pos The index of an element in \a telement * array which could be coarsened recursively. * \return The index of the first family member whose family is - * defined by \a telements_pos in \a telement. + * defined by \a telements_pos in \a telement. * \note The element with index \a telements_pos must be the last child in its family. * \see t8_forest_adapt_coarsen_recursive. * \note If the element with index \a telements_pos in \a telement can not be coarsened @@ -125,7 +125,7 @@ t8_forest_pos (t8_forest_t forest, t8_eclass_t tree_class, const t8_scheme *sche const int child_id = scheme->element_get_child_id (tree_class, element); /* Left if condition: * If child_id is not last, elements cannot be coarsened recursively. - * But elements (vertex) whose family consist of exactly one element do + * But elements (vertex) whose family consist of exactly one element do * also not get coarsened recursively. * Right if condition: * Elements with level 0 cannot be further coarsened. */ @@ -136,7 +136,7 @@ t8_forest_pos (t8_forest_t forest, t8_eclass_t tree_class, const t8_scheme *sche T8_ASSERT (level_current > 0); } - /* If the forest is complete, the family is also complete. + /* If the forest is complete, the family is also complete. * Thus, the index of the first member can be determined. */ if (!forest->incomplete_trees) { return telements_pos - (t8_locidx_t) num_siblings - 1; @@ -149,8 +149,8 @@ t8_forest_pos (t8_forest_t forest, t8_eclass_t tree_class, const t8_scheme *sche /* Get parent of a family member by coarsening last member. */ scheme->element_get_parent (tree_class, element, element_parent); - /* Loop backward over all possible family members until we hit an - * element that is not part of the family or we have reached the + /* Loop backward over all possible family members until we hit an + * element that is not part of the family or we have reached the * maximum number of member. */ t8_locidx_t el_iter; /* Loop running variable */ t8_locidx_t pos = -1; @@ -171,12 +171,12 @@ t8_forest_pos (t8_forest_t forest, t8_eclass_t tree_class, const t8_scheme *sche } } - /* If the current set of considered elements is smaller in size than a possible + /* If the current set of considered elements is smaller in size than a possible * family, check if the first element along the space-filling-curve next to the * considered elements is overlapped when set is coarsened. */ if (el_iter < (t8_locidx_t) num_siblings && el_iter < elements_in_array) { int level_compare = scheme->element_get_level (tree_class, element_compare); - /* Only elements with higher level then level of elements in family, can get + /* Only elements with higher level then level of elements in family, can get * potentially be overlapped. */ if (level_compare > level_current) { /* Compare ancestors */ @@ -194,7 +194,7 @@ t8_forest_pos (t8_forest_t forest, t8_eclass_t tree_class, const t8_scheme *sche scheme->element_destroy (tree_class, 1, &element_parent_compare); #if T8_ENABLE_MPI - /* The first element on process rank must have child_id 0, otherwise other + /* The first element on process rank must have child_id 0, otherwise other * family members could be on process rank-1. */ if (pos == 0 && forest->mpirank > 0) { const t8_element_t *element_boarder = t8_element_array_index_locidx (telements, pos); @@ -660,7 +660,7 @@ t8_forest_adapt (t8_forest_t forest) t8_forest_comm_global_num_leaf_elements (forest); /* Updating other processes about local (in)complete trees. - * If the old forest already contained incomplete trees, + * If the old forest already contained incomplete trees, * this step is not necessary. */ if (!forest_from->incomplete_trees) { T8_ASSERT (element_removed == 1 || element_removed == 0); diff --git a/src/t8_forest/t8_forest_ghost.cxx b/src/t8_forest/t8_forest_ghost.cxx index bf65cfe9f9..605839180e 100644 --- a/src/t8_forest/t8_forest_ghost.cxx +++ b/src/t8_forest/t8_forest_ghost.cxx @@ -49,8 +49,8 @@ typedef struct char *buffer; /**< The send buffer. */ } t8_ghost_mpi_send_info_t; -/** - * The information stored for the ghost trees +/** + * The information stored for the ghost trees */ typedef struct { @@ -61,7 +61,7 @@ typedef struct } t8_ghost_tree_t; /** - * The data structure stored in the global_tree_to_ghost_tree hash table. + * The data structure stored in the global_tree_to_ghost_tree hash table. */ typedef struct { @@ -70,7 +70,7 @@ typedef struct } t8_ghost_gtree_hash_t; /** - * The data structure stored in the process_offsets array. + * The data structure stored in the process_offsets array. */ typedef struct { @@ -82,7 +82,7 @@ typedef struct /** * The information stored for the remote trees. - * Each remote process stores an array of these + * Each remote process stores an array of these */ typedef struct { @@ -104,13 +104,13 @@ typedef struct sc_array_t remote_trees; /**< Array of the remote trees of this process */ } t8_ghost_remote_t; -/** +/** * The hash function for the global tree hash. - * As hash value we just return the global tree id. - * + * As hash value we just return the global tree id. + * * \param[in] ghost_gtree_hash Global tree hash. - * \param[in] data Unused dummy Argument to allow passing this function to sc_hash_new. - * + * \param[in] data Unused dummy Argument to allow passing this function to sc_hash_new. + * * \return The global tree id. */ static unsigned @@ -124,11 +124,11 @@ t8_ghost_gtree_hash_function (const void *ghost_gtree_hash, [[maybe_unused]] con /** * The equal function for two global tree hash objects. * Two t8_ghost_gtree_hash_t are considered equal if their global tree ids are the same. - * + * * \param[in] ghost_gtreea Global tree hash object A * \param[in] ghost_gtreeb Global tree hash object B - * \param[in] user Unused dummy Argument to allow passing this function to sc_hash_new. - * + * \param[in] user Unused dummy Argument to allow passing this function to sc_hash_new. + * * \return 1 if equal, 0 otherwise. */ static int @@ -141,14 +141,14 @@ t8_ghost_gtree_equal_function (const void *ghost_gtreea, const void *ghost_gtree return objecta->global_id == objectb->global_id; } -/** - * The hash value for an entry of the process_offsets hash is the processes mpirank. - * +/** + * The hash value for an entry of the process_offsets hash is the processes mpirank. + * * \param[in] process_data Process data as void pointer. - * \param[in] user_data Unused dummy Argument to allow passing this function to sc_hash_new. - * + * \param[in] user_data Unused dummy Argument to allow passing this function to sc_hash_new. + * * \return The process' MPI rank. - * + * */ static unsigned t8_ghost_process_hash_function (const void *process_data, [[maybe_unused]] const void *user_data) @@ -158,14 +158,14 @@ t8_ghost_process_hash_function (const void *process_data, [[maybe_unused]] const return process->mpirank; } -/** +/** * The equal function for the process_offsets array. - * Two entries are the same if their mpiranks are equal. - * + * Two entries are the same if their mpiranks are equal. + * * \param[in] process_dataa Process offset array A * \param[in] process_datab Process offset array B - * \param[in] user Unused dummy Argument to allow passing this function to sc_hash_new. - * + * \param[in] user Unused dummy Argument to allow passing this function to sc_hash_new. + * * \return 1 if equal, 0 if not. */ static int @@ -178,13 +178,13 @@ t8_ghost_process_equal_function (const void *process_dataa, const void *process_ return processa->mpirank == processb->mpirank; } -/** +/** * The hash function for the remote_ghosts hash table. * The hash value for an mpirank is just the rank. - * + * * \param[in] remote_data The remote ghost data as void pointer. * \param[in] user_data Unused dummy Argument to allow passing this function to sc_hash_new. - * + * * \return The mpi rank. */ static unsigned @@ -197,12 +197,12 @@ t8_ghost_remote_hash_function (const void *remote_data, [[maybe_unused]] const v /** * The equal function for the remote hash table. - * Two entries are the same if they have the same rank. - * + * Two entries are the same if they have the same rank. + * * \param[in] remote_dataa Remote hash table A. * \param[in] remote_datab Remote hash table B. - * \param[in] user Unused dummy Argument to allow passing this function to sc_hash_new. - * + * \param[in] user Unused dummy Argument to allow passing this function to sc_hash_new. + * * \return 1 if the two have the same rank, 0 if not. */ static int @@ -214,7 +214,7 @@ t8_ghost_remote_equal_function (const void *remote_dataa, const void *remote_dat return remotea->remote_rank == remoteb->remote_rank; } -/** +/** * This struct is used during a ghost data exchange. * Since we use asynchronous communication, we store the * send buffers and mpi requests until we end the communication. @@ -260,12 +260,12 @@ t8_forest_ghost_init (t8_forest_ghost_t *pghost, t8_ghost_type_t ghost_type) ghost->remote_processes = sc_array_new (sizeof (int)); } -/** - * Return the remote struct of a given remote rank - * +/** + * Return the remote struct of a given remote rank + * * \param[in] forest A committed forest. * \param[in] remote The rank of the remote process. - * + * * \return The remote struct of the rank as \see t8_ghost_remote_t pointer. */ static t8_ghost_remote_t * @@ -290,12 +290,12 @@ t8_forest_ghost_get_remote (t8_forest_t forest, int remote) return (t8_ghost_remote_t *) sc_array_index (&forest->ghosts->remote_ghosts->a, index); } -/** - * Return a remote processes info about the stored ghost elements - * +/** + * Return a remote processes info about the stored ghost elements + * * \param[in] forest A committed forest. * \param[in] remote The rank of the remote. - * + * * \return The remote process info about the stored ghost elements, as \see t8_ghost_process_hash_t. */ static t8_ghost_process_hash_t * @@ -337,12 +337,12 @@ t8_forest_ghost_num_trees (const t8_forest_t forest) return forest->ghosts->ghost_trees->elem_count; } -/** - * Given an index into the ghost_trees array return the ghost tree - * +/** + * Given an index into the ghost_trees array return the ghost tree + * * \param[in] forest A committed forest. * \param[in] lghost_tree Index of the tree within the ghost_trees array. - * + * * \return The ghost tree. */ static t8_ghost_tree_t * @@ -447,12 +447,12 @@ t8_forest_ghost_get_leaf_element (t8_forest_t forest, t8_locidx_t lghost_tree, t } /** Initialize a t8_ghost_remote_tree_t. - * + * * \param[in] forest The forest. * \param[in] gtreeid The global ID of the remote tree. * \param[in] remote_rank The rank of the reomte process holding the tree. * \param[in] tree_class The eclass of the remote tree. - * \param[in, out] remote_tree A pointer to the t8_ghost_remote_tree_t to be initialized. + * \param[in, out] remote_tree A pointer to the t8_ghost_remote_tree_t to be initialized. * Has to be non-NULL on input. On output, it is initialized. */ static void @@ -475,11 +475,11 @@ t8_ghost_init_remote_tree (t8_forest_t forest, t8_gloidx_t gtreeid, int remote_r sc_array_init (&remote_tree->element_indices, sizeof (t8_locidx_t)); } -/** +/** * Add a new element to the remote hash table (if not already in it). * Must be called for elements in linear order * element_index is the tree local index of this element. - * + * * \param[in] forest The forest. * \param[in] ghost The ghost structure. * \param[in] remote_rank The remote rank. @@ -589,7 +589,7 @@ typedef struct * we store for each face the lower and upper bounds of the owners at * this face. We also store bounds for the element's owners. * Each entry is an array of 2 * (max_num_faces + 1) integers, - | * face_0 low | face_0 high | ... | face_n low | face_n high | owner low | owner high | + | * face_0 low | face_0 high | ... | face_n low | face_n high | owner low | owner high | */ sc_array_t face_owners; /**< Temporary storage for all owners at a leaf's face. */ const t8_scheme *scheme; /**< The scheme. */ @@ -608,14 +608,14 @@ typedef struct /** * This function is used as callback search function within \ref t8_forest_search to check whether the neighbors of * the current element are on another rank. If so, add the element to the ghost structures. - * + * * \param[in] forest The forest. * \param[in] ltreeid Local ID of the ghost tree. * \param[in] element The current element. * \param[in] is_leaf Switch indicating whether \a element is a leaf. * \param[in] leaves The array of leaves (used for debug purposes only). * \param[in] tree_leaf_index If the element is a leaf, its tree-local id. - * + * * \return 0 if the element and its face neighbors are completely owned by the current rank; 1 otherwise. */ static int @@ -730,7 +730,7 @@ t8_forest_ghost_search_boundary (t8_forest_t forest, t8_locidx_t ltreeid, const } } /* end face loop */ if (faces_totally_owned && element_is_owned) { - /* The element only has local descendants and all of its face neighbors are local as well. + /* The element only has local descendants and all of its face neighbors are local as well. * We do not continue the search */ #if T8_ENABLE_DEBUG if (tree_leaf_index < 0) { @@ -743,13 +743,13 @@ t8_forest_ghost_search_boundary (t8_forest_t forest, t8_locidx_t ltreeid, const return 1; } -/** +/** * Fill the remote ghosts of a ghost structure. * We iterate through all elements and check if their neighbors * lie on remote processes. If so, we add the element to the * remote_ghosts array of ghost. * We also fill the remote_processes here. - * + * * \param[in,out] forest the forest. */ static void @@ -787,7 +787,7 @@ t8_forest_ghost_fill_remote_v3 (t8_forest_t forest) #endif } -/** +/** * Fill the remote ghosts of a ghost structure. * We iterate through all elements and check if their neighbors * lie on remote processes. If so, we add the element to the @@ -796,7 +796,7 @@ t8_forest_ghost_fill_remote_v3 (t8_forest_t forest) * If ghost_method is 0, then we assume a balanced forest and * construct the remote processes by looking at the half neighbors of an element. * Otherwise, we use the owners_at_face method. - * + * * \param[in] forest The forest. * \param[in] ghost The forest's ghost. * \param[in] ghost_method Switch indicating the ghost type. @@ -925,17 +925,17 @@ t8_forest_ghost_fill_remote (t8_forest_t forest, t8_forest_ghost_t ghost, int gh } } -/** +/** * Begin sending the ghost elements from the remote ranks * using non-blocking communication. * Afterwards, * t8_forest_ghost_send_end * must be called to end the communication. - * + * * \param[in] forest The forest. * \param[in] ghost The forest's ghost. * \param[out] requests The send requests as an array of pointers to sc_MPI_Requests. - * + * * \return An array of mpi_send_info_t, holding one entry for each remote rank. */ static t8_ghost_mpi_send_info_t * @@ -1056,12 +1056,12 @@ t8_forest_ghost_send_start (t8_forest_t forest, t8_forest_ghost_t ghost, sc_MPI_ /** * End the communication of the ghost element sends and receives. - * - * \param[in] forest A committed forest. + * + * \param[in] forest A committed forest. * \param[in] ghost The ghost data. * \param[in, out] send_info The send information array. On output, its memory is freed. * \param[in, out] requests The array of MPI requests. On output, its memory is freed. - * + * */ static void t8_forest_ghost_send_end ([[maybe_unused]] t8_forest_t forest, t8_forest_ghost_t ghost, @@ -1090,13 +1090,13 @@ t8_forest_ghost_send_end ([[maybe_unused]] t8_forest_t forest, t8_forest_ghost_t /** * Receive a single message from a remote process, after the message was successfully probed. - * Returns the allocated receive buffer and the number of bytes received - * + * Returns the allocated receive buffer and the number of bytes received + * * \param[in] recv_rank The receiving rank. * \param[in] comm The MPI communicator. * \param[in] status The sc_MPI_Status. * \param[in] recv_bytes The number of bytes to be received. - * + * * \return The allocated receive buffer and the number of bytes received. */ static char * @@ -1134,8 +1134,8 @@ t8_forest_ghost_receive_message (int recv_rank, sc_MPI_Comm comm, sc_MPI_Status * of the next ghost tree to be inserted. * When called with the first message, current_element_offset must be set to 0. * - * Currently we expect that the messages arrive in order of the sender's rank. - * + * Currently we expect that the messages arrive in order of the sender's rank. + * * \param[in] forest The forest. * \param[in] ghost The forest's ghost. * \param[in, out] current_element_offset The current element offset. Has to be zero on input and is updated in each step. @@ -1273,7 +1273,7 @@ t8_forest_ghost_parse_received_message (t8_forest_t forest, t8_forest_ghost_t gh /** * In forest_ghost_receive we need a lookup table to give us the position * of a process in the ghost->remote_processes array, given the rank of a process. - * We implement this via a hash table with the following struct as entry. + * We implement this via a hash table with the following struct as entry. */ typedef struct t8_recv_list_entry_struct { @@ -1303,8 +1303,8 @@ t8_recv_list_entry_equal (const void *v1, const void *v2, [[maybe_unused]] const /** * Probe for all incoming messages from the remote ranks and receive them. * We receive the message in the order in which they arrive. To achieve this, - * we have to use polling. - * + * we have to use polling. + * * \param[in] forest The forest. * \param[in] ghost The forest's ghost. */ @@ -1727,13 +1727,13 @@ t8_forest_ghost_remote_first_elem (t8_forest_t forest, int remote) /** * Fill the send buffer for a ghost data exchange for on remote rank. - * + * * \param[in] forest The forest. * \param[in] remote The remote rank to send to. * \param[out] pbuffer The send buffer, allocated within this function. * \param[in] element_data The element data. - * - * \return The number of bytes in the buffer. + * + * \return The number of bytes in the buffer. */ static size_t t8_forest_ghost_exchange_fill_send_buffer (t8_forest_t forest, int remote, char **pbuffer, sc_array_t *element_data) @@ -1800,10 +1800,10 @@ t8_forest_ghost_exchange_fill_send_buffer (t8_forest_t forest, int remote, char /** * Begin the ghost data exchange communication. - * + * * \param[in] forest A committed forest. * \param[in] element_data The element data array. - * + * * \return The ghost data exchange type, as pointer to \see t8_ghost_data_exchange_t. */ static t8_ghost_data_exchange_t * @@ -1900,10 +1900,10 @@ t8_forest_ghost_exchange_begin (t8_forest_t forest, sc_array_t *element_data) /** * Free the memory of the ghost data exchange. - * - * After all associated communication has terminated, this function is used to free the + * + * After all associated communication has terminated, this function is used to free the * allocated memory of the send and receive buffers. - * + * * \param[in] data_exchange The ghost data exchange type to free memory for. */ static void @@ -2019,8 +2019,8 @@ t8_forest_ghost_print (t8_forest_t forest) } /** - * Completely destroy a ghost structure - * + * Completely destroy a ghost structure + * * \param[in,out] pghost The ghost structure to be destroyed. */ static void diff --git a/src/t8_forest/t8_forest_partition.cxx b/src/t8_forest/t8_forest_partition.cxx index b777f6985c..a7d24efb32 100644 --- a/src/t8_forest/t8_forest_partition.cxx +++ b/src/t8_forest/t8_forest_partition.cxx @@ -146,7 +146,7 @@ t8_forest_partition_create_offsets (t8_forest_t forest) t8_debugf ("Building offsets for forest %p\n", (void *) forest); comm = forest->mpicomm; /* Set the shmem array type of comm */ - SC_CHECK_ABORT (t8_shmem_init (comm) > 0, "Error in shared memory setup. Could not partition forest."); + SC_CHECK_ABORT (t8_shmem_init (comm) > 0, "ERROR in shared memory setup. Could not partition forest."); t8_shmem_set_type (comm, T8_SHMEM_BEST_TYPE); /* Initialize the offset array as a shmem array * holding mpisize+1 many t8_gloidx_t */ @@ -322,7 +322,7 @@ t8_forest_partition_create_first_desc (t8_forest_t forest) if (forest->global_first_desc == NULL) { /* Set the shmem array type of comm */ - SC_CHECK_ABORT (t8_shmem_init (comm) > 0, "Error in shared memory setup. Could not partition forest."); + SC_CHECK_ABORT (t8_shmem_init (comm) > 0, "ERROR in shared memory setup. Could not partition forest."); t8_shmem_set_type (comm, T8_SHMEM_BEST_TYPE); /* Initialize the offset array as a shmem array * holding mpisize+1 many t8_linearidx_t to store the elements linear ids */ @@ -425,7 +425,7 @@ t8_forest_partition_create_tree_offsets (t8_forest_t forest) if (forest->tree_offsets == NULL) { /* Set the shmem array type of comm */ - SC_CHECK_ABORT (t8_shmem_init (comm) > 0, "Error in shared memory setup. Could not partition forest."); + SC_CHECK_ABORT (t8_shmem_init (comm) > 0, "ERROR in shared memory setup. Could not partition forest."); t8_shmem_set_type (comm, T8_SHMEM_BEST_TYPE); /* Only allocate the shmem array, if it is not already allocated */ t8_shmem_array_init (&forest->tree_offsets, sizeof (t8_gloidx_t), forest->mpisize + 1, comm); @@ -498,7 +498,7 @@ t8_forest_partition_compute_new_offset (t8_forest_t forest) T8_ASSERT (forest->element_offsets == NULL); /* Set the shmem array type to comm */ - SC_CHECK_ABORT (t8_shmem_init (comm) > 0, "Error in shared memory setup. Could not partition forest."); + SC_CHECK_ABORT (t8_shmem_init (comm) > 0, "ERROR in shared memory setup. Could not partition forest."); t8_shmem_set_type (comm, T8_SHMEM_BEST_TYPE); t8_shmem_array_init (&forest->element_offsets, sizeof (t8_gloidx_t), mpisize + 1, comm); diff --git a/src/t8_vtk/t8_vtk_write_ASCII.cxx b/src/t8_vtk/t8_vtk_write_ASCII.cxx index f1ad7c0aed..cd8205d832 100644 --- a/src/t8_vtk/t8_vtk_write_ASCII.cxx +++ b/src/t8_vtk/t8_vtk_write_ASCII.cxx @@ -703,7 +703,7 @@ t8_forest_vtk_write_cells (t8_forest_t forest, FILE *vtufile, const int write_tr return 1; t8_forest_vtk_cell_failure: /* Something went wrong */ - t8_errorf ("Error when writing cell data to forest vtk file.\n"); + t8_errorf ("ERROR when writing cell data to forest vtk file.\n"); return 0; } @@ -783,7 +783,7 @@ t8_forest_vtk_write_points (t8_forest_t forest, FILE *vtufile, const int write_g return 1; t8_forest_vtk_cell_failure: /* Something went wrong */ - t8_errorf ("Error when writing cell data to forest vtk file.\n"); + t8_errorf ("ERROR when writing cell data to forest vtk file.\n"); return 0; } @@ -810,7 +810,7 @@ t8_forest_vtk_write_ASCII (t8_forest_t forest, const char *fileprefix, const int if (forest->mpirank == 0) { if (t8_write_pvtu (fileprefix, forest->mpisize, write_treeid, write_mpirank, write_level, write_element_id, num_data, data)) { - t8_errorf ("Error when writing file %s.pvtu\n", fileprefix); + t8_errorf ("ERROR when writing file %s.pvtu\n", fileprefix); goto t8_forest_vtk_failure; } } @@ -826,14 +826,14 @@ t8_forest_vtk_write_ASCII (t8_forest_t forest, const char *fileprefix, const int /* The filename for this processes file */ freturn = snprintf (vtufilename, BUFSIZ, "%s_%04d.vtu", fileprefix, forest->mpirank); if (freturn >= BUFSIZ) { - t8_errorf ("Error when writing vtu file. Filename too long.\n"); + t8_errorf ("ERROR when writing vtu file. Filename too long.\n"); goto t8_forest_vtk_failure; } /* Open the vtufile to write to */ vtufile = fopen (vtufilename, "w"); if (vtufile == NULL) { - t8_errorf ("Error when opening file %s\n", vtufilename); + t8_errorf ("ERROR when opening file %s\n", vtufilename); goto t8_forest_vtk_failure; } /* Write the header information in the .vtu file. @@ -889,7 +889,7 @@ t8_forest_vtk_write_ASCII (t8_forest_t forest, const char *fileprefix, const int if (freturn != 0) { /* Closing failed, this usually means that the final write operation could * not be completed. */ - t8_global_errorf ("Error when closing file %s\n", vtufilename); + t8_global_errorf ("ERROR when closing file %s\n", vtufilename); goto t8_forest_vtk_failure; } /* Writing was successful */ @@ -898,7 +898,7 @@ t8_forest_vtk_write_ASCII (t8_forest_t forest, const char *fileprefix, const int if (vtufile != NULL) { fclose (vtufile); } - t8_errorf ("Error when writing vtk file.\n"); + t8_errorf ("ERROR when writing vtk file.\n"); return 0; } @@ -948,7 +948,7 @@ t8_cmesh_vtk_write_file_ext (const t8_cmesh_t cmesh, const char *fileprefix, con /* Write the pvtu header file. */ int num_ranks_that_write = cmesh->set_partition ? cmesh->mpisize : 1; if (t8_write_pvtu (fileprefix, num_ranks_that_write, 1, 1, 0, 0, 0, NULL)) { - SC_ABORTF ("Error when writing file %s.pvtu\n", fileprefix); + SC_ABORTF ("ERROR when writing file %s.pvtu\n", fileprefix); } } /* If the cmesh is replicated only rank 0 prints it, @@ -1003,7 +1003,7 @@ t8_cmesh_vtk_write_file_ext (const t8_cmesh_t cmesh, const char *fileprefix, con /* TODO: Use new geometry here. Need cmesh_get_reference coords function. */ vertices = t8_cmesh_get_tree_vertices (cmesh, tree->treeid); if (vertices == nullptr) { - t8_errorf ("Error in writing file %s. Could not read vertex coordinates for cmesh tree %i.\n", vtufilename, + t8_errorf ("ERROR in writing file %s. Could not read vertex coordinates for cmesh tree %i.\n", vtufilename, tree->treeid); fclose (vtufile); return write_failure; @@ -1031,7 +1031,7 @@ t8_cmesh_vtk_write_file_ext (const t8_cmesh_t cmesh, const char *fileprefix, con /* Get a pointer to this ghosts vertices */ vertices = (double *) t8_cmesh_get_attribute (cmesh, t8_get_package_id (), 0, ighost + num_loc_trees); if (vertices == nullptr) { - t8_errorf ("Error in writing file %s. Could not read vertex coordinates for cmesh tree %i.\n", vtufilename, + t8_errorf ("ERROR in writing file %s. Could not read vertex coordinates for cmesh tree %i.\n", vtufilename, tree->treeid); fclose (vtufile); return write_failure; diff --git a/src/t8_vtk/t8_vtk_writer.hxx b/src/t8_vtk/t8_vtk_writer.hxx index f3dea0f20c..804914cfd7 100644 --- a/src/t8_vtk/t8_vtk_writer.hxx +++ b/src/t8_vtk/t8_vtk_writer.hxx @@ -560,7 +560,7 @@ struct vtk_writer return true; } else { - t8_errorf ("Error when writing vtk file.\n"); + t8_errorf ("ERROR when writing vtk file.\n"); } /* Return whether writing was successful */ diff --git a/src/t8_vtk/t8_with_vtk/t8_vtk_reader.cxx b/src/t8_vtk/t8_with_vtk/t8_vtk_reader.cxx index 9dc53b0b57..27b993c696 100644 --- a/src/t8_vtk/t8_with_vtk/t8_vtk_reader.cxx +++ b/src/t8_vtk/t8_with_vtk/t8_vtk_reader.cxx @@ -259,7 +259,7 @@ t8_vtk_partition (t8_cmesh_t cmesh, const int mpirank, const int mpisize, t8_glo t8_gloidx_t first_tree = 0; t8_gloidx_t last_tree = 1; /* Compute the global id of the first tree on each proc. */ - SC_CHECK_ABORT (t8_shmem_init (comm) > 0, "Error in shared memory setup in vtk output."); + SC_CHECK_ABORT (t8_shmem_init (comm) > 0, "ERROR in shared memory setup in vtk output."); t8_shmem_set_type (comm, T8_SHMEM_BEST_TYPE); t8_shmem_array_t offsets = NULL; t8_shmem_array_init (&offsets, sizeof (t8_gloidx_t), mpisize + 1, comm); @@ -445,7 +445,7 @@ t8_vtk_reader_cmesh ([[maybe_unused]] const char *filename, [[maybe_unused]] con return cmesh; } else { - t8_global_errorf ("Error translating file \n"); + t8_global_errorf ("ERROR translating file \n"); return NULL; } } diff --git a/test/t8_cmesh/t8_gtest_cmesh_readmshfile.cxx b/test/t8_cmesh/t8_gtest_cmesh_readmshfile.cxx index b983413a37..950db8c12a 100644 --- a/test/t8_cmesh/t8_gtest_cmesh_readmshfile.cxx +++ b/test/t8_cmesh/t8_gtest_cmesh_readmshfile.cxx @@ -67,5 +67,5 @@ TEST (t8_cmesh_readmshfile, test_msh_file_vers4_bin) t8_cmesh_t cmesh = t8_cmesh_from_msh_file (fileprefix, 1, sc_MPI_COMM_WORLD, 2, 0, 0); ASSERT_TRUE (cmesh == NULL) << "Expected fail of reading binary msh file v.4, but did not fail."; - t8_debugf ("Error handling successful.\n"); + t8_debugf ("ERROR handling successful.\n"); } diff --git a/test/t8_data/t8_gtest_shmem.cxx b/test/t8_data/t8_gtest_shmem.cxx index 43771f8efd..1431c651cf 100644 --- a/test/t8_data/t8_gtest_shmem.cxx +++ b/test/t8_data/t8_gtest_shmem.cxx @@ -60,7 +60,7 @@ TEST_P (shmem, test_shmem_init_finalize) /* setup shared memory usage */ const int intrasize_from_init = t8_shmem_init (comm); - ASSERT_GT (intrasize_from_init, 0) << "Error in t8_shmem_init. No intranode communicator set."; + ASSERT_GT (intrasize_from_init, 0) << "ERROR in t8_shmem_init. No intranode communicator set."; /* Get intranode and internode comm */ sc_mpi_comm_get_node_comms (comm, &intranode, &internode); @@ -324,7 +324,7 @@ TEST_P (shmem, test_shmem_array) /* Write into array */ /* In the first half we use the t8_shmem_array_set_gloidx function, - * we then use a standard store to write + * we then use a standard store to write * and at the end we use t8_shmem_array_index_for_writing. */ if (t8_shmem_array_start_writing (shmem_array)) { @@ -369,7 +369,7 @@ TEST_P (shmem, test_shmem_array) /** * Comparison function for binary search. - * + * * \param[in] array The shared memory array to search in. * \param[in] guess The current guess index. * \param[in] value The value to search for. @@ -386,7 +386,7 @@ compare (t8_shmem_array_t array, const int guess, const t8_gloidx_t value) } /** - * Test the binary search function of the shared memory array. + * Test the binary search function of the shared memory array. * Creates an array with values 0 to array_length - 1 and searches for each value. * Also searches for values not in the array and checks that -1 is returned. */ diff --git a/test/t8_forest/t8_gtest_ghost_exchange.cxx b/test/t8_forest/t8_gtest_ghost_exchange.cxx index 2286603032..adaf0be326 100644 --- a/test/t8_forest/t8_gtest_ghost_exchange.cxx +++ b/test/t8_forest/t8_gtest_ghost_exchange.cxx @@ -131,7 +131,7 @@ t8_test_ghost_exchange_data_id (t8_forest_t forest) = scheme->element_get_linear_id (tree_class, elem, scheme->element_get_level (tree_class, elem)); /* Compare this id with the entry in the element_data array */ const t8_linearidx_t ghost_entry = *(t8_linearidx_t *) sc_array_index (&element_data, array_pos); - ASSERT_EQ (ghost_id, ghost_entry) << "Error when exchanging ghost data. Received wrong element id.\n"; + ASSERT_EQ (ghost_id, ghost_entry) << "ERROR when exchanging ghost data. Received wrong element id.\n"; /* Since array pos ended with the last element in the loop above, we can * continue counting for the ghost elements */ array_pos++; @@ -166,7 +166,7 @@ t8_test_ghost_exchange_data_int (t8_forest_t forest) for (t8_locidx_t ielem = 0; ielem < num_ghosts; ielem++) { /* Get the integer for this ghost */ int ghost_int = *(int *) t8_sc_array_index_locidx (&element_data, num_elements + ielem); - ASSERT_EQ (ghost_int, 42) << "Error when exchanging ghost data. Received wrong data.\n"; + ASSERT_EQ (ghost_int, 42) << "ERROR when exchanging ghost data. Received wrong data.\n"; } /* clean-up */ sc_array_reset (&element_data); From 020e27080eab6a88c5df2d9d05d5a7afbbaadc72 Mon Sep 17 00:00:00 2001 From: Sandro Elsweijer Date: Tue, 3 Mar 2026 18:49:16 +0100 Subject: [PATCH 07/11] bigfix in error script --- scripts/internal/check_error_messages.sh | 42 +++++++----------------- 1 file changed, 11 insertions(+), 31 deletions(-) diff --git a/scripts/internal/check_error_messages.sh b/scripts/internal/check_error_messages.sh index fbd27e1c72..b329b50d02 100755 --- a/scripts/internal/check_error_messages.sh +++ b/scripts/internal/check_error_messages.sh @@ -4,7 +4,7 @@ # t8code is a C library to manage a collection (a forest) of multiple # connected adaptive space-trees of general element classes in parallel. # -# Copyright (C) 2025 the developers +# Copyright (C) 2026 the developers # # t8code is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -26,40 +26,20 @@ if [ "$#" -ne 1 ]; then fi file_path=$1 - -echo "$file_path" - -if [[ "$file_path" -ef "src/t8_misc/t8_with_macro_error.h" ]] -then - echo The file \"src/t8_misc/t8_with_macro_error.h\" will be ignored by the check_macros.sh script. - exit 0 -fi - -# -# This script searches for lines containing a macro definition in the style of '#ifdef T8_ENABLE_' -# in the specified file and processes each matching line. -# It uses 'grep' to find all occurrences of '#ifdef T8_ENABLE_' in the file located -# at the path stored in the variable 'file_path'. The '-n' option with 'grep' -# ensures that the line numbers of the matching lines are included in the output. -# The output of 'grep' is then piped into a 'while' loop, which reads each line -# and splits it into the line number and the line content using ':' as the delimiter. -# Variables: -# - file_path: The path to the file to be searched. -# - line_number: The line number where the macro definition is found. -# - line: The content of the line where the macro definition is found. -# - found_faulty_message=false + +# Check if a warning or error message is not capitalized while IFS=: read -r line_number line; do - if message=$(echo "$line" | grep -oP '["`](?i:(warning|error))'); then - if ! echo "$line" | grep -qE '^[\"`](ERROR|WARNING)'; then - echo "Incorrect error/warning message found in $file_path on line $line_number: $message. Please use 'ERROR' or 'WARNING' instead." - found_faulty_message = true - fi + if ! echo "$line" | grep -qE "[\"'](WARNING|ERROR)"; then + printf '\033[38;5;196m%s\n%s\n%s\n\033[0m\n' \ + "Incorrect error/warning message found in $file_path" \ + "Line $line_number: $line" \ + "Please use 'ERROR' or 'WARNING' instead." + found_faulty_message=true fi -done < "$file_path" +done < <(grep -nP '["`](?i:(warning|error))' "$file_path") -if [ "$found_faulty_message"=true ]; then +if [ "$found_faulty_message" == true ]; then exit 1 else exit 0 From 7e887944c74995c117d6043fdffdf7821d84c9d4 Mon Sep 17 00:00:00 2001 From: Sandro Elsweijer Date: Tue, 3 Mar 2026 18:49:38 +0100 Subject: [PATCH 08/11] simplify script and make output more readable --- scripts/internal/check_macros.sh | 34 +++++++++++++++++--------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/scripts/internal/check_macros.sh b/scripts/internal/check_macros.sh index ee6697e1c2..f18341dcfc 100755 --- a/scripts/internal/check_macros.sh +++ b/scripts/internal/check_macros.sh @@ -4,7 +4,7 @@ # t8code is a C library to manage a collection (a forest) of multiple # connected adaptive space-trees of general element classes in parallel. # -# Copyright (C) 2025 the developers +# Copyright (C) 2026 the developers # # t8code is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -27,11 +27,8 @@ fi file_path=$1 -echo "$file_path" - if [[ "$file_path" -ef "src/t8_misc/t8_with_macro_error.h" ]] then - echo The file \"src/t8_misc/t8_with_macro_error.h\" will be ignored by the check_macros.sh script. exit 0 fi @@ -51,21 +48,26 @@ fi found_macros=false -# Check for #ifdef T8_ENABLE -while IFS=: read -r line_number line; do - macro_name=$(echo "$line" | grep -o 'T8_ENABLE_[^ ]*') - echo "Incorrect macro found in $file_path on line $line_number: $macro_name. Please use '#if T8_ENABLE_' instead." - found_macros=true -done < <(grep -n '#ifdef T8_ENABLE_' "$file_path") - -# Check for #ifdef T8_WITH or #if T8_WITH +# Check for #ifdef and T8_WITH while IFS=: read -r line_number line; do - macro_name=$(echo "$line" | grep -o 'T8_WITH_[^ ]*') - echo "Incorrect macro found in $file_path on line $line_number: $macro_name. Please use '#if T8_ENABLE_' instead." + printf '\033[38;5;196m%s\n%s\n\033[0m' \ + "Incorrect macro found in $file_path" \ + "Line $line_number: $line" + # Print message for #ifdef + if echo $line | grep -q '#ifdef'; then + printf '\033[38;5;196m%s\n\033[0m' \ + "Please do not use #ifdef with T8_ENABLE macros. Use #if instead." + fi + # Print message for T8_WITH + if echo $line | grep -q 'T8_WITH'; then + printf '\033[38;5;196m%s\n\033[0m' \ + "T8_WITH macros are not longer supported. Use T8_ENABLE instead." + fi + printf "\n" found_macros=true -done < <(grep -E -n '#if T8_WITH_|#ifdef T8_WITH' "$file_path") +done < <(grep -nE '(#ifdef T8_ENABLE|T8_WITH_)' "$file_path") -if [ "$found_macros"=true ]; then +if [ "$found_macros" == true ]; then exit 1 else exit 0 From d016f67e9eb842114e5d947e00c9a1ae421bdaae Mon Sep 17 00:00:00 2001 From: Sandro Elsweijer Date: Tue, 3 Mar 2026 18:49:53 +0100 Subject: [PATCH 09/11] update readme --- scripts/README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/README.md b/scripts/README.md index 6fc8c255bd..4c011b904b 100644 --- a/scripts/README.md +++ b/scripts/README.md @@ -34,7 +34,9 @@ This script indents all t8code source files at once. This script should only be #### pre-commit -This script should be copied to your `.git/hooks` folder. `git` then automatically checks the indentation of committed files and prevents you from committing wrongly indented files. See [Git indentation workflow](https://github.com/DLR-AMR/t8code/wiki/Coding-Guideline#git-indentation-workflow). +This script checks for common mistakes like indentation, typos, wrong macros and error messages. +Create a link to this script via `ln -s ../../scripts/pre-commit .git/hooks/pre-commit`. +`git` then automatically checks added files and prevents you from committing files with mistakes which will not pass the CI. #### check_valgrind.sh From 60fbfcd2af82967dabc5ca632a0b7c2215f8e88a Mon Sep 17 00:00:00 2001 From: Sandro Elsweijer Date: Tue, 3 Mar 2026 18:50:24 +0100 Subject: [PATCH 10/11] improve pre-commit script --- scripts/pre-commit | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/scripts/pre-commit b/scripts/pre-commit index a7d15fc99a..6bf1c8d9f6 100755 --- a/scripts/pre-commit +++ b/scripts/pre-commit @@ -4,7 +4,7 @@ # t8code is a C library to manage a collection (a forest) of multiple # connected adaptive space-trees of general element classes in parallel. # -# Copyright (C) 2023 the developers +# Copyright (C) 2026 the developers # # t8code is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -23,16 +23,14 @@ # # A hook script to verify what is about to be committed. -# This hook checks whether the code is properly indented using -# the provided indent script. -# Move into .git/hooks folder and name it "pre-commit". -# Called by "git commit" with no arguments. The hook should +# This hook checks for typos, indentation, wrong macros and error messages. +# Create a symbolic link in .git/hooks via +# ln -s ../../scripts/pre-commit .git/hooks/pre-commit +# Called by "git commit" with no arguments. The hook should # exit with non-zero status after issuing an appropriate message if # it wants to stop the commit. # -# This is the indent script in the project's directory - # Determine base directory of git repo GIT_REPO_PATH=$(git rev-parse --show-toplevel) @@ -101,6 +99,8 @@ do if [ $FILE_ENDING = "c" -o $FILE_ENDING = "h" -o $FILE_ENDING = "cxx" -o $FILE_ENDING = "hxx" ] then echo "Checking file $file" + + $CHECK_INDENT $file > /dev/null 2>&1 status=$? if test $status -ne 0 @@ -119,7 +119,7 @@ do fi # This script checks if an error or warning message is not capitalized. - $CHECK_MACROS $file + $CHECK_ERROR_MESSAGES $file status=$? if test $status -ne 0 then From 258b961cec6f410948d5e11ac3fdb9458d18a5c8 Mon Sep 17 00:00:00 2001 From: Sandro Elsweijer Date: Tue, 3 Mar 2026 18:53:36 +0100 Subject: [PATCH 11/11] update comment --- .github/workflows/spell_check.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/spell_check.yml b/.github/workflows/spell_check.yml index c0452cb8ab..4a1d54a75f 100644 --- a/.github/workflows/spell_check.yml +++ b/.github/workflows/spell_check.yml @@ -35,7 +35,7 @@ jobs: uses: actions/checkout@v6 - name: Check spelling uses: crate-ci/typos@master - - name: check macros + - name: check macros and error messages run: | for file in $(git diff --name-only --diff-filter=A); do ./scripts/internal/check_macros.sh "$file" &>> error.txt @@ -45,5 +45,5 @@ jobs: if: failure() uses: actions/upload-artifact@v6 with: - name: t8code check macros report + name: macro_and_error_report path: error.txt