Skip to content

Commit

Permalink
Linter fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
acdemiralp committed Oct 20, 2023
1 parent e860aea commit 17db1a2
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
8 changes: 4 additions & 4 deletions include/mpi/core/type/data_type.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ class data_type
std::array<aint , 2> extent () const
{
std::array<aint, 2> result {};
MPI_CHECK_ERROR_CODE(MPI_Type_get_extent, (native_, &result[0], &result[1]))
MPI_CHECK_ERROR_CODE(MPI_Type_get_extent, (native_, result.data(), &result[1]))
MPI_CHECK_UNDEFINED (MPI_Type_get_extent, result[0])
MPI_CHECK_UNDEFINED (MPI_Type_get_extent, result[1])
return result;
Expand All @@ -184,7 +184,7 @@ class data_type
std::array<count, 2> extent_x () const
{
std::array<count, 2> result {};
MPI_CHECK_ERROR_CODE(MPI_Type_get_extent_x, (native_, &result[0], &result[1]))
MPI_CHECK_ERROR_CODE(MPI_Type_get_extent_x, (native_, result.data(), &result[1]))
MPI_CHECK_UNDEFINED (MPI_Type_get_extent_x, result[0])
MPI_CHECK_UNDEFINED (MPI_Type_get_extent_x, result[1])
return result;
Expand All @@ -193,7 +193,7 @@ class data_type
std::array<aint , 2> true_extent () const
{
std::array<aint, 2> result {};
MPI_CHECK_ERROR_CODE(MPI_Type_get_true_extent, (native_, &result[0], &result[1]))
MPI_CHECK_ERROR_CODE(MPI_Type_get_true_extent, (native_, result.data(), &result[1]))
MPI_CHECK_UNDEFINED (MPI_Type_get_true_extent, result[0])
MPI_CHECK_UNDEFINED (MPI_Type_get_true_extent, result[1])
return result;
Expand All @@ -202,7 +202,7 @@ class data_type
std::array<count, 2> true_extent_x () const
{
std::array<count, 2> result {};
MPI_CHECK_ERROR_CODE(MPI_Type_get_true_extent_x, (native_, &result[0], &result[1]))
MPI_CHECK_ERROR_CODE(MPI_Type_get_true_extent_x, (native_, result.data(), &result[1]))
MPI_CHECK_UNDEFINED (MPI_Type_get_true_extent_x, result[0])
MPI_CHECK_UNDEFINED (MPI_Type_get_true_extent_x, result[1])
return result;
Expand Down
2 changes: 1 addition & 1 deletion include/mpi/core/version.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ constexpr std::int32_t sub_version = MPI_SUBVERSION;
inline std::array<std::int32_t, 2> get_version ()
{
std::array<std::int32_t, 2> result {};
MPI_CHECK_ERROR_CODE(MPI_Get_version, (&result[0], &result[1]))
MPI_CHECK_ERROR_CODE(MPI_Get_version, (result.data(), &result[1]))
return result;
}
inline std::string get_library_version()
Expand Down
6 changes: 3 additions & 3 deletions include/mpi/io/data_representation.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@ class data_representation
{
MPI_CHECK_ERROR_CODE(MPI_Register_datarep, (
name_.c_str(),
[ ] (void* buffer, MPI_Datatype data_type, std::int32_t count , void* file_buffer, offset position, void* extra_state)
[ ] (void* buffer, const MPI_Datatype data_type, const std::int32_t count , void* file_buffer, const offset position, void* extra_state)
{
return static_cast<data_representation*>(extra_state)->read_function_ (buffer, mpi::data_type(data_type), count, file_buffer, position);
},
[ ] (void* buffer, MPI_Datatype data_type, std::int32_t count , void* file_buffer, offset position, void* extra_state)
[ ] (void* buffer, const MPI_Datatype data_type, const std::int32_t count , void* file_buffer, const offset position, void* extra_state)
{
return static_cast<data_representation*>(extra_state)->write_function_(buffer, mpi::data_type(data_type), count, file_buffer, position);
},
[ ] ( MPI_Datatype data_type, aint* extent , void* extra_state)
[ ] ( const MPI_Datatype data_type, aint* extent , void* extra_state)
{
return static_cast<data_representation*>(extra_state)->extent_function_( mpi::data_type(data_type), extent);
},
Expand Down
2 changes: 1 addition & 1 deletion include/mpi/tool/structs/control_variable.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ struct control_variable
explicit control_variable (const std::int32_t index) : index(index)
{
auto name_size(0), description_size(0);
auto enum_type (MPI_T_ENUM_NULL );
MPI_Datatype raw_data_type(MPI_DATATYPE_NULL);
MPI_T_enum enum_type (MPI_T_ENUM_NULL );

MPI_CHECK_ERROR_CODE(MPI_T_cvar_get_info, (
index ,
Expand Down
2 changes: 1 addition & 1 deletion include/mpi/tool/structs/performance_variable.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ struct performance_variable
explicit performance_variable (const std::int32_t index) : index(index)
{
auto name_size(0), description_size(0);
auto enum_type (MPI_T_ENUM_NULL );
MPI_Datatype raw_data_type(MPI_DATATYPE_NULL);
MPI_T_enum enum_type (MPI_T_ENUM_NULL );

MPI_CHECK_ERROR_CODE(MPI_T_pvar_get_info, (
index ,
Expand Down
6 changes: 3 additions & 3 deletions tests/c_interface_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ TEST_CASE("C Interface")
MPI_Type_commit (&position_data_type);

MPI_Datatype particle_data_type;
std::array<std::int32_t, 2> block_lengths {1, 1};
std::array<MPI_Aint , 2> displacements {0, sizeof (std::uint64_t)};
std::array<MPI_Datatype, 2> data_types {MPI_UINT64_T, position_data_type};
std::array block_lengths {1, 1};
std::array<MPI_Aint, 2> displacements {0, sizeof (std::uint64_t)};
std::array data_types {MPI_UINT64_T, position_data_type};
MPI_Type_struct (2, block_lengths.data(), displacements.data(), data_types.data(), &particle_data_type);
MPI_Type_commit (&particle_data_type);

Expand Down

0 comments on commit 17db1a2

Please sign in to comment.