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

Splines fixes #224

Merged
merged 4 commits into from
Nov 13, 2023
Merged
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
22 changes: 11 additions & 11 deletions benchmarks/splines.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,13 +179,13 @@ static void characteristics_advection(benchmark::State& state)

#ifdef KOKKOS_ENABLE_CUDA
std::string chip = "gpu";
int cols_per_par_chunk_ref = 1024;
int par_chunks_per_seq_chunk_ref = 160;
int cols_per_par_chunk_ref = 65535;
int par_chunks_per_seq_chunk_ref = 1;
unsigned int preconditionner_max_block_size_ref = 1u;
#elif defined(KOKKOS_ENABLE_OPENMP)
std::string chip = "cpu";
int cols_per_par_chunk_ref = 512;
int par_chunks_per_seq_chunk_ref = 160;
int par_chunks_per_seq_chunk_ref = Kokkos::OpenMP().concurrency();
unsigned int preconditionner_max_block_size_ref = 8u;
#elif defined(KOKKOS_ENABLE_SERIAL)
std::string chip = "cpu";
Expand All @@ -197,29 +197,29 @@ unsigned int preconditionner_max_block_size_ref = 8u;
BENCHMARK(characteristics_advection)
->RangeMultiplier(2)
->Ranges(
{{100, 1000},
{{64, 1024},
{100, 500000},
{cols_per_par_chunk_ref, cols_per_par_chunk_ref},
{par_chunks_per_seq_chunk_ref, par_chunks_per_seq_chunk_ref},
{preconditionner_max_block_size_ref, preconditionner_max_block_size_ref}})
->MinTime(3);
->MinTime(3)->UseRealTime();
/*
BENCHMARK(characteristics_advection)
->RangeMultiplier(2)
->Ranges({{100, 1000}, {100000, 100000}, {64,65535}, {par_chunks_per_seq_chunk_ref, par_chunks_per_seq_chunk_ref}, {preconditionner_max_block_size_ref, preconditionner_max_block_size_ref}})
->MinTime(3);
->Ranges({{64, 1024}, {100000, 100000}, {64,65535}, {par_chunks_per_seq_chunk_ref, par_chunks_per_seq_chunk_ref}, {preconditionner_max_block_size_ref, preconditionner_max_block_size_ref}})
->MinTime(3)->UseRealTime();
*/
/*
BENCHMARK(characteristics_advection)
->RangeMultiplier(2)
->Ranges({{100, 1000}, {100000, 100000}, {cols_per_par_chunk_ref, cols_per_par_chunk_ref}, {1, 10000}, {preconditionner_max_block_size_ref, preconditionner_max_block_size_ref}})
->MinTime(3);
->Ranges({{64, 1024}, {100000, 100000}, {cols_per_par_chunk_ref, cols_per_par_chunk_ref}, {1, 10000}, {preconditionner_max_block_size_ref, preconditionner_max_block_size_ref}})
->MinTime(3)->UseRealTime();
*/
/*
BENCHMARK(characteristics_advection)
->RangeMultiplier(2)
->Ranges({{100, 1000}, {100000, 100000}, {cols_per_par_chunk_ref, cols_per_par_chunk_ref}, {par_chunks_per_seq_chunk_ref, par_chunks_per_seq_chunk_ref}, {1, 32}})
->MinTime(3);
->Ranges({{64, 1024}, {100000, 100000}, {cols_per_par_chunk_ref, cols_per_par_chunk_ref}, {par_chunks_per_seq_chunk_ref, par_chunks_per_seq_chunk_ref}, {1, 32}})
->MinTime(3)->UseRealTime();
*/

int main(int argc, char** argv)
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/splines_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
bandwidth = [group_data["bytes_per_second"][i] for i in range(len(ny))]
plt.plot(ny, bandwidth, marker='o', markersize=5, label=f'nx={nx}')

x = np.linspace(min(ny), 10*min(ny))
x = np.linspace(min(ny), 20*min(ny))
plt.plot(x, np.mean([data_groups[nx]["bytes_per_second"][0] for nx in nx_values])/min(ny)*x, linestyle='--', color='black', label='perfect scaling')

# Plotting the data
Expand Down
8 changes: 4 additions & 4 deletions include/ddc/kernels/splines/matrix_sparse.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,12 @@ class Matrix_Sparse : public Matrix
#endif
#ifdef KOKKOS_ENABLE_CUDA
if (std::is_same_v<ExecSpace, Kokkos::Cuda>) {
m_cols_per_par_chunk = 1024;
m_cols_per_par_chunk = 65535;
}
#endif
#ifdef KOKKOS_ENABLE_HIP
if (std::is_same_v<ExecSpace, Kokkos::HIP>) {
m_cols_per_par_chunk = 1024;
m_cols_per_par_chunk = 65535;
}
#endif
}
Expand All @@ -101,12 +101,12 @@ class Matrix_Sparse : public Matrix
#endif
#ifdef KOKKOS_ENABLE_CUDA
if (std::is_same_v<ExecSpace, Kokkos::Cuda>) {
m_par_chunks_per_seq_chunk = Kokkos::DefaultHostExecutionSpace().concurrency();
m_par_chunks_per_seq_chunk = 1;
}
#endif
#ifdef KOKKOS_ENABLE_HIP
if (std::is_same_v<ExecSpace, Kokkos::HIP>) {
m_par_chunks_per_seq_chunk = Kokkos::DefaultHostExecutionSpace().concurrency();
m_par_chunks_per_seq_chunk = 1;
}
#endif
}
Expand Down
2 changes: 1 addition & 1 deletion include/ddc/misc/ginkgo_executors.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ inline std::shared_ptr<gko::Executor> create_gko_exec()
#endif
#ifdef KOKKOS_ENABLE_HIP
if (std::is_same_v<ExecSpace, Kokkos::HIP>) {
return gko::CudaExecutor::create(0, create_default_host_executor());
return gko::HipExecutor::create(0, create_default_host_executor());
}
#endif
}