Skip to content

Commit

Permalink
Merge pull request #3722 from vicentebolea/fix-clang-format
Browse files Browse the repository at this point in the history
format,ci: update clang-format to clang16
  • Loading branch information
vicentebolea authored Jul 31, 2023
2 parents 0783bdc + 448da10 commit d29e89c
Show file tree
Hide file tree
Showing 691 changed files with 22,386 additions and 34,210 deletions.
2 changes: 1 addition & 1 deletion .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ CompactNamespaces: false
ConstructorInitializerAllOnOneLineOrOnePerLine: false
FixNamespaceComments: false
Standard: Cpp11
ColumnLimit: 80
ColumnLimit: 100
AllowAllParametersOfDeclarationOnNextLine: true
AlignEscapedNewlines: Right
AlignAfterOpenBracket: Align
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/everything.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ jobs:

runs-on: ubuntu-latest
container:
image: ornladios/adios2:ci-formatting
image: ghcr.io/ornladios/adios2:ci-formatting

steps:
- uses: actions/checkout@v3
Expand Down
78 changes: 28 additions & 50 deletions bindings/C/adios2/c/adios2_c_adios.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,15 @@ adios2::ArrayOrdering adios2_ToArrayOrdering(const adios2_arrayordering Corder)
return order;
}

adios2_adios *adios2_init_config_glue_serial(const char *config_file,
const char *host_language)
adios2_adios *adios2_init_config_glue_serial(const char *config_file, const char *host_language)
{
adios2_adios *adios = nullptr;
try
{
adios2::helper::CheckForNullptr(
config_file,
"for config_file, in call to adios2_init or adios2_init_config");
adios = reinterpret_cast<adios2_adios *>(
new adios2::core::ADIOS(config_file, host_language));
config_file, "for config_file, in call to adios2_init or adios2_init_config");
adios =
reinterpret_cast<adios2_adios *>(new adios2::core::ADIOS(config_file, host_language));
}
catch (...)
{
Expand All @@ -60,10 +58,7 @@ adios2_adios *adios2_init_config_glue_serial(const char *config_file,
return adios;
}

adios2_adios *adios2_init_serial()
{
return adios2_init_config_glue_serial("", "C");
}
adios2_adios *adios2_init_serial() { return adios2_init_config_glue_serial("", "C"); }

adios2_adios *adios2_init_config_serial(const char *config_file)
{
Expand All @@ -75,8 +70,7 @@ adios2_io *adios2_declare_io(adios2_adios *adios, const char *name)
adios2_io *io = nullptr;
try
{
adios2::helper::CheckForNullptr(
adios, "for adios2_adios, in call to adios2_declare_io");
adios2::helper::CheckForNullptr(adios, "for adios2_adios, in call to adios2_declare_io");
io = reinterpret_cast<adios2_io *>(
&reinterpret_cast<adios2::core::ADIOS *>(adios)->DeclareIO(name));
}
Expand All @@ -93,8 +87,7 @@ adios2_io *adios2_declare_io_order(adios2_adios *adios, const char *name,
adios2_io *io = nullptr;
try
{
adios2::helper::CheckForNullptr(
adios, "for adios2_adios, in call to adios2_declare_io");
adios2::helper::CheckForNullptr(adios, "for adios2_adios, in call to adios2_declare_io");
io = reinterpret_cast<adios2_io *>(
&reinterpret_cast<adios2::core::ADIOS *>(adios)->DeclareIO(
name, adios2_ToArrayOrdering(order)));
Expand All @@ -111,8 +104,7 @@ adios2_io *adios2_at_io(adios2_adios *adios, const char *name)
adios2_io *io = nullptr;
try
{
adios2::helper::CheckForNullptr(
adios, "for adios2_adios, in call to adios2_at_io");
adios2::helper::CheckForNullptr(adios, "for adios2_adios, in call to adios2_at_io");
io = reinterpret_cast<adios2_io *>(
&reinterpret_cast<adios2::core::ADIOS *>(adios)->AtIO(name));
}
Expand All @@ -123,17 +115,15 @@ adios2_io *adios2_at_io(adios2_adios *adios, const char *name)
return io;
}

adios2_operator *adios2_define_operator(adios2_adios *adios, const char *name,
const char *type)
adios2_operator *adios2_define_operator(adios2_adios *adios, const char *name, const char *type)
{
adios2_operator *op = nullptr;
try
{
adios2::helper::CheckForNullptr(
adios, "for adios2_adios, in call to adios2_define_operator");
adios2::helper::CheckForNullptr(adios,
"for adios2_adios, in call to adios2_define_operator");
op = reinterpret_cast<adios2_operator *>(
&reinterpret_cast<adios2::core::ADIOS *>(adios)->DefineOperator(
name, type));
&reinterpret_cast<adios2::core::ADIOS *>(adios)->DefineOperator(name, type));
}
catch (...)
{
Expand All @@ -147,11 +137,10 @@ adios2_operator *adios2_inquire_operator(adios2_adios *adios, const char *name)
adios2_operator *op = nullptr;
try
{
adios2::helper::CheckForNullptr(
adios, "for adios2_adios, in call to adios2_inquire_operator");
adios2::helper::CheckForNullptr(adios,
"for adios2_adios, in call to adios2_inquire_operator");
op = reinterpret_cast<adios2_operator *>(
reinterpret_cast<adios2::core::ADIOS *>(adios)->InquireOperator(
name));
reinterpret_cast<adios2::core::ADIOS *>(adios)->InquireOperator(name));
}
catch (...)
{
Expand All @@ -164,66 +153,57 @@ adios2_error adios2_flush_all(adios2_adios *adios)
{
try
{
adios2::helper::CheckForNullptr(
adios, "for adios2_adios, in call to adios2_flush_all");
adios2::helper::CheckForNullptr(adios, "for adios2_adios, in call to adios2_flush_all");
reinterpret_cast<adios2::core::ADIOS *>(adios)->FlushAll();
return adios2_error_none;
}
catch (...)
{
return static_cast<adios2_error>(
adios2::helper::ExceptionToError("adios2_flush_all"));
return static_cast<adios2_error>(adios2::helper::ExceptionToError("adios2_flush_all"));
}
}

adios2_error adios2_remove_io(adios2_bool *result, adios2_adios *adios,
const char *name)
adios2_error adios2_remove_io(adios2_bool *result, adios2_adios *adios, const char *name)
{
try
{
adios2::helper::CheckForNullptr(
adios, "for adios2_adios, in call to adios2_remove_io");
const bool resultCpp =
reinterpret_cast<adios2::core::ADIOS *>(adios)->RemoveIO(name);
adios2::helper::CheckForNullptr(adios, "for adios2_adios, in call to adios2_remove_io");
const bool resultCpp = reinterpret_cast<adios2::core::ADIOS *>(adios)->RemoveIO(name);
*result = resultCpp ? adios2_true : adios2_false;
return adios2_error_none;
}
catch (...)
{
return static_cast<adios2_error>(
adios2::helper::ExceptionToError("adios2_remove_io"));
return static_cast<adios2_error>(adios2::helper::ExceptionToError("adios2_remove_io"));
}
}

adios2_error adios2_remove_all_ios(adios2_adios *adios)
{
try
{
adios2::helper::CheckForNullptr(
adios, "for adios2_adios, in call to adios2_remove_all_ios");
adios2::helper::CheckForNullptr(adios,
"for adios2_adios, in call to adios2_remove_all_ios");
reinterpret_cast<adios2::core::ADIOS *>(adios)->RemoveAllIOs();
return adios2_error_none;
}
catch (...)
{
return static_cast<adios2_error>(
adios2::helper::ExceptionToError("adios2_remove_all_ios"));
return static_cast<adios2_error>(adios2::helper::ExceptionToError("adios2_remove_all_ios"));
}
}

adios2_error adios2_finalize(adios2_adios *adios)
{
try
{
adios2::helper::CheckForNullptr(
adios, "for adios2_adios, in call to adios2_finalize");
adios2::helper::CheckForNullptr(adios, "for adios2_adios, in call to adios2_finalize");
delete reinterpret_cast<adios2::core::ADIOS *>(adios);
return adios2_error_none;
}
catch (...)
{
return static_cast<adios2_error>(
adios2::helper::ExceptionToError("adios2_finalize"));
return static_cast<adios2_error>(adios2::helper::ExceptionToError("adios2_finalize"));
}
}

Expand All @@ -234,8 +214,7 @@ adios2_error adios2_enter_computation_block(adios2_adios *adios)
try
{
adios2::helper::CheckForNullptr(
adios,
"for adios2_adios, in call to adios2_enter_computation_block");
adios, "for adios2_adios, in call to adios2_enter_computation_block");
reinterpret_cast<adios2::core::ADIOS *>(adios)->EnterComputationBlock();
return adios2_error_none;
}
Expand All @@ -253,8 +232,7 @@ adios2_error adios2_exit_computation_block(adios2_adios *adios)
try
{
adios2::helper::CheckForNullptr(
adios,
"for adios2_adios, in call to adios2_exit_computation_block");
adios, "for adios2_adios, in call to adios2_exit_computation_block");
reinterpret_cast<adios2::core::ADIOS *>(adios)->ExitComputationBlock();
return adios2_error_none;
}
Expand Down
9 changes: 3 additions & 6 deletions bindings/C/adios2/c/adios2_c_adios.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ extern "C" {

#if ADIOS2_USE_MPI
#define adios2_init(comm) adios2_init_mpi(comm)
#define adios2_init_config(config_file, comm) \
adios2_init_config_mpi(config_file, comm)
#define adios2_init_config(config_file, comm) adios2_init_config_mpi(config_file, comm)

/**
* Starting point for MPI apps. Creates an ADIOS handler.
Expand Down Expand Up @@ -97,8 +96,7 @@ adios2_io *adios2_at_io(adios2_adios *adios, const char *name);
* @param type supported ADIOS2 operator type: zfp, sz
* @return success: handler, failure: NULL
*/
adios2_operator *adios2_define_operator(adios2_adios *adios, const char *name,
const char *type);
adios2_operator *adios2_define_operator(adios2_adios *adios, const char *name, const char *type);

/**
* Retrieves a previously defined operator handler
Expand Down Expand Up @@ -136,8 +134,7 @@ adios2_error adios2_finalize(adios2_adios *adios);
* @param name input unique identifier for io to be removed
* @return adios2_error 0: success, see enum adios2_error for errors
*/
adios2_error adios2_remove_io(adios2_bool *result, adios2_adios *adios,
const char *name);
adios2_error adios2_remove_io(adios2_bool *result, adios2_adios *adios, const char *name);

/**
* DANGER ZONE: removes all ios created with adios2_declare_io.
Expand Down
15 changes: 5 additions & 10 deletions bindings/C/adios2/c/adios2_c_adios_mpi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,17 @@
extern "C" {

// to be called from other languages, hidden from the public apis
adios2_adios *adios2_init_config_glue_mpi(const char *config_file,
MPI_Comm comm,
adios2_adios *adios2_init_config_glue_mpi(const char *config_file, MPI_Comm comm,
const char *host_language)
{
adios2_adios *adios = nullptr;

try
{
adios2::helper::CheckForNullptr(
config_file,
"for config_file, in call to adios2_init or adios2_init_config");
adios = reinterpret_cast<adios2_adios *>(new adios2::core::ADIOS(
config_file, adios2::helper::CommDupMPI(comm), host_language));
config_file, "for config_file, in call to adios2_init or adios2_init_config");
adios = reinterpret_cast<adios2_adios *>(
new adios2::core::ADIOS(config_file, adios2::helper::CommDupMPI(comm), host_language));
}
catch (...)
{
Expand All @@ -36,10 +34,7 @@ adios2_adios *adios2_init_config_glue_mpi(const char *config_file,
return adios;
}

adios2_adios *adios2_init_mpi(MPI_Comm comm)
{
return adios2_init_config_glue_mpi("", comm, "C");
}
adios2_adios *adios2_init_mpi(MPI_Comm comm) { return adios2_init_config_glue_mpi("", comm, "C"); }

adios2_adios *adios2_init_config_mpi(const char *config_file, MPI_Comm comm)
{
Expand Down
Loading

0 comments on commit d29e89c

Please sign in to comment.