Skip to content

Commit

Permalink
report results before exit on error
Browse files Browse the repository at this point in the history
  • Loading branch information
mkstoyanov committed Dec 10, 2024
1 parent eb00cde commit e2fe75f
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions benchmarks/speed3d.h
Original file line number Diff line number Diff line change
Expand Up @@ -213,17 +213,6 @@ void benchmark_fft(std::array<int,3> size_fft, std::deque<std::string> const &ar
precision_type mpi_max_err = 0.0;
MPI_Allreduce(&err, &mpi_max_err, 1, mpi::type_from<precision_type>(), MPI_MAX, fft_comm);

if (mpi_max_err > precision<std::complex<precision_type>>::tolerance){
// benchmark failed, the error is too much
if (me == 0){
cout << "------------------------------- \n"
<< "ERROR: observed error after heFFTe benchmark exceeds the tolerance\n"
<< " tolerance: " << precision<std::complex<precision_type>>::tolerance
<< " error: " << mpi_max_err << endl;
}
return;
}

// Print results
if(me==0){
t_max = t_max / (2.0 * ntest);
Expand All @@ -250,6 +239,17 @@ void benchmark_fft(std::array<int,3> size_fft, std::deque<std::string> const &ar
cout << "Max error: " << mpi_max_err << "\n";
cout << endl;
}

if (mpi_max_err > precision<std::complex<precision_type>>::tolerance){
// benchmark failed, the error is too much
if (me == 0){
cout << "------------------------------- \n"
<< "ERROR: observed error after heFFTe benchmark exceeds the tolerance\n"
<< " tolerance: " << precision<std::complex<precision_type>>::tolerance
<< " error: " << mpi_max_err << endl;
}
return;
}
}

template<typename backend_tag>
Expand Down

0 comments on commit e2fe75f

Please sign in to comment.