Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update format #117

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@ BinPackParameters: true
IndentWidth: 4
SpacesInParentheses: true
BreakConstructorInitializersBeforeComma: true
PointerAlignment: Right
AlwaysBreakAfterReturnType: None
KeepEmptyLinesAtTheStartOfBlocks: false
2 changes: 1 addition & 1 deletion .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ jobs:
- name: Run clang-format style check
uses: jidicula/[email protected]
with:
clang-format-version: '10'
clang-format-version: '14'
streeve marked this conversation as resolved.
Show resolved Hide resolved
1 change: 0 additions & 1 deletion bin/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@
// This main file is simply a driver
int main( int argc, char *argv[] )
{

MPI_Init( &argc, &argv );

{
Expand Down
16 changes: 3 additions & 13 deletions cmake/FindCLANG_FORMAT.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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}")
Expand Down
1 change: 0 additions & 1 deletion src/comm_mpi.h
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,6 @@ class Comm
KOKKOS_INLINE_FUNCTION
void operator()( const TagHaloPBC, const T_INT &i ) const
{

switch ( phase )
{
case 0:
Expand Down
4 changes: 0 additions & 4 deletions src/comm_mpi_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,6 @@ void Comm<t_System>::reduce_min_float( T_FLOAT *vals, T_INT count )
template <class t_System>
void Comm<t_System>::exchange()
{

Kokkos::Profiling::pushRegion( "Comm::exchange" );

N_local = system->N_local;
Expand Down Expand Up @@ -277,7 +276,6 @@ void Comm<t_System>::exchange()
template <class t_System>
void Comm<t_System>::exchange_halo()
{

Kokkos::Profiling::pushRegion( "Comm::exchange_halo" );

N_local = system->N_local;
Expand Down Expand Up @@ -367,7 +365,6 @@ void Comm<t_System>::exchange_halo()
template <class t_System>
void Comm<t_System>::update_halo()
{

Kokkos::Profiling::pushRegion( "Comm::update_halo" );

N_local = system->N_local;
Expand Down Expand Up @@ -409,7 +406,6 @@ void Comm<t_System>::update_halo()
template <class t_System>
void Comm<t_System>::update_force()
{

Kokkos::Profiling::pushRegion( "Comm::update_force" );

N_local = system->N_local;
Expand Down
8 changes: 4 additions & 4 deletions src/inputFile_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@ std::vector<std::string> split( const std::string &line )
std::sregex_token_iterator first{ line.begin(), line.end(), re, -1 }, last;
std::vector<std::string> 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;
}

Expand Down
4 changes: 2 additions & 2 deletions src/output.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ void log( t_stream &stream, t_last &&last )
}

template <class t_stream, class t_head, class... t_tail>
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;
Expand All @@ -46,7 +46,7 @@ void log_err( t_stream &stream, t_last &&last )
}

template <class t_stream, class t_head, class... t_tail>
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;
Expand Down
Loading