From 0a64c2b8a42d766e5a893fcab2d4573b33cca74f Mon Sep 17 00:00:00 2001 From: Luca Fedeli Date: Tue, 8 Mar 2022 18:38:25 +0100 Subject: Make error and info messages visually uniform (#2939) * initial work to add msg formatter * wip * replace AMREX_ALWAYS_ASSERT_WITH_MESSAGE with WarpX equivalent --- Source/FieldSolver/SpectralSolver/WrapCuFFT.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'Source/FieldSolver/SpectralSolver/WrapCuFFT.cpp') diff --git a/Source/FieldSolver/SpectralSolver/WrapCuFFT.cpp b/Source/FieldSolver/SpectralSolver/WrapCuFFT.cpp index f612143be..676d4a5bb 100644 --- a/Source/FieldSolver/SpectralSolver/WrapCuFFT.cpp +++ b/Source/FieldSolver/SpectralSolver/WrapCuFFT.cpp @@ -7,6 +7,8 @@ #include "AnyFFT.H" +#include "Utils/TextMsg.H" + namespace AnyFFT { @@ -35,7 +37,7 @@ namespace AnyFFT result = cufftPlan2d( &(fft_plan.m_plan), real_size[1], real_size[0], VendorR2C); } else { - amrex::Abort("only dim=2 and dim=3 have been implemented"); + amrex::Abort(Utils::TextMsg::Err("only dim=2 and dim=3 have been implemented")); } } else { if (dim == 3) { @@ -45,13 +47,14 @@ namespace AnyFFT result = cufftPlan2d( &(fft_plan.m_plan), real_size[1], real_size[0], VendorC2R); } else { - amrex::Abort("only dim=2 and dim=3 have been implemented"); + amrex::Abort(Utils::TextMsg::Err("only dim=2 and dim=3 have been implemented")); } } if ( result != CUFFT_SUCCESS ) { - amrex::Print() << " cufftplan failed! Error: " << - cufftErrorToString(result) << "\n"; + amrex::Print() << Utils::TextMsg::Err( + "cufftplan failed! Error: " + + cufftErrorToString(result)); } // Store meta-data in fft_plan @@ -89,8 +92,9 @@ namespace AnyFFT amrex::Abort("direction must be AnyFFT::direction::R2C or AnyFFT::direction::C2R"); } if ( result != CUFFT_SUCCESS ) { - amrex::Print() << " forward transform using cufftExec failed ! Error: " << - cufftErrorToString(result) << "\n"; + amrex::Print() << Utils::TextMsg::Err( + "forward transform using cufftExec failed ! Error: " + +cufftErrorToString(result)); } } -- cgit v1.2.3