diff --git a/.clang-format b/.clang-format index 0bcc049..7a540c3 100644 --- a/.clang-format +++ b/.clang-format @@ -7,3 +7,6 @@ BinPackParameters: true IndentWidth: 4 SpacesInParentheses: true BreakConstructorInitializersBeforeComma: true +PointerAlignment: Right +AlwaysBreakAfterReturnType: None +KeepEmptyLinesAtTheStartOfBlocks: false diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index ec200e9..61d04fa 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -9,4 +9,4 @@ jobs: - name: Run clang-format style check uses: jidicula/clang-format-action@v4.6.2 with: - clang-format-version: '10' + clang-format-version: '14' diff --git a/bin/main.cpp b/bin/main.cpp index c85e356..98371d5 100644 --- a/bin/main.cpp +++ b/bin/main.cpp @@ -58,7 +58,6 @@ // This main file is simply a driver int main( int argc, char *argv[] ) { - MPI_Init( &argc, &argv ); { diff --git a/cmake/FindCLANG_FORMAT.cmake b/cmake/FindCLANG_FORMAT.cmake index 763f3c7..25ca0d2 100644 --- a/cmake/FindCLANG_FORMAT.cmake +++ b/cmake/FindCLANG_FORMAT.cmake @@ -18,17 +18,7 @@ find_program(CLANG_FORMAT_EXECUTABLE NAMES clang-format - clang-format-7 - clang-format-6.0 - clang-format-5.0 - clang-format-4.0 - clang-format-3.9 - clang-format-3.8 - clang-format-3.7 - clang-format-3.6 - clang-format-3.5 - clang-format-3.4 - clang-format-3.3 + clang-format-14 DOC "clang-format executable") mark_as_advanced(CLANG_FORMAT_EXECUTABLE) @@ -38,11 +28,11 @@ if(CLANG_FORMAT_EXECUTABLE) OUTPUT_VARIABLE clang_format_version ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE) - if(clang_format_version MATCHES "^clang-format version .*") + if(clang_format_version MATCHES "^.*clang-format version .*") # clang_format_version sample: "clang-format version 3.9.1-4ubuntu3~16.04.1 # (tags/RELEASE_391/rc2)" string(REGEX - REPLACE "clang-format version ([.0-9]+).*" + REPLACE "^.*clang-format version ([.0-9]+).*" "\\1" CLANG_FORMAT_VERSION "${clang_format_version}") diff --git a/src/comm_mpi.h b/src/comm_mpi.h index 05ff61c..13e4156 100644 --- a/src/comm_mpi.h +++ b/src/comm_mpi.h @@ -323,7 +323,6 @@ class Comm KOKKOS_INLINE_FUNCTION void operator()( const TagHaloPBC, const T_INT &i ) const { - switch ( phase ) { case 0: diff --git a/src/comm_mpi_impl.h b/src/comm_mpi_impl.h index 0a1983e..d72a1a0 100644 --- a/src/comm_mpi_impl.h +++ b/src/comm_mpi_impl.h @@ -191,7 +191,6 @@ void Comm::reduce_min_float( T_FLOAT *vals, T_INT count ) template void Comm::exchange() { - Kokkos::Profiling::pushRegion( "Comm::exchange" ); N_local = system->N_local; @@ -277,7 +276,6 @@ void Comm::exchange() template void Comm::exchange_halo() { - Kokkos::Profiling::pushRegion( "Comm::exchange_halo" ); N_local = system->N_local; @@ -367,7 +365,6 @@ void Comm::exchange_halo() template void Comm::update_halo() { - Kokkos::Profiling::pushRegion( "Comm::update_halo" ); N_local = system->N_local; @@ -409,7 +406,6 @@ void Comm::update_halo() template void Comm::update_force() { - Kokkos::Profiling::pushRegion( "Comm::update_force" ); N_local = system->N_local; diff --git a/src/inputFile_impl.h b/src/inputFile_impl.h index 4023615..e5803f4 100644 --- a/src/inputFile_impl.h +++ b/src/inputFile_impl.h @@ -60,10 +60,10 @@ std::vector split( const std::string &line ) std::sregex_token_iterator first{ line.begin(), line.end(), re, -1 }, last; std::vector words{ first, last }; // Remove empty - words.erase( - std::remove_if( words.begin(), words.end(), - []( std::string const &s ) { return s.empty(); } ), - words.end() ); + words.erase( std::remove_if( words.begin(), words.end(), + []( std::string const &s ) + { return s.empty(); } ), + words.end() ); return words; } diff --git a/src/output.h b/src/output.h index e709986..ce810ae 100644 --- a/src/output.h +++ b/src/output.h @@ -27,7 +27,7 @@ void log( t_stream &stream, t_last &&last ) } template -void log( t_stream &stream, t_head &&head, t_tail &&... tail ) +void log( t_stream &stream, t_head &&head, t_tail &&...tail ) { if ( print_rank() ) stream << head; @@ -46,7 +46,7 @@ void log_err( t_stream &stream, t_last &&last ) } template -void log_err( t_stream &stream, t_head &&head, t_tail &&... tail ) +void log_err( t_stream &stream, t_head &&head, t_tail &&...tail ) { if ( print_rank() ) stream << head;