From 222f619f1f4466a01c4456bffa9514870d7338db Mon Sep 17 00:00:00 2001 From: Kyle Shores Date: Fri, 27 Sep 2024 14:07:25 -0600 Subject: [PATCH] changing cuda tolerances --- .../cuda/test_cuda_analytical_rosenbrock.cpp | 116 +++++++++--------- 1 file changed, 58 insertions(+), 58 deletions(-) diff --git a/test/integration/cuda/test_cuda_analytical_rosenbrock.cpp b/test/integration/cuda/test_cuda_analytical_rosenbrock.cpp index d2543561c..c7258d7a1 100644 --- a/test/integration/cuda/test_cuda_analytical_rosenbrock.cpp +++ b/test/integration/cuda/test_cuda_analytical_rosenbrock.cpp @@ -36,47 +36,47 @@ auto copy_to_host = [](auto& state) -> void { state.SyncOutputsToHost(); }; TEST(AnalyticalExamplesCudaRosenbrock, Troe) { - test_analytical_troe(two, 2e-3, copy_to_device, copy_to_host); - test_analytical_troe(three, 2e-7, copy_to_device, copy_to_host); - test_analytical_troe(four, 2e-7, copy_to_device, copy_to_host); - test_analytical_troe(four_da, 2e-7, copy_to_device, copy_to_host); - test_analytical_troe(six_da, 2e-7, copy_to_device, copy_to_host); + test_analytical_troe(two, 1e-10, copy_to_device, copy_to_host); + test_analytical_troe(three, 1e-10, copy_to_device, copy_to_host); + test_analytical_troe(four, 1e-10, copy_to_device, copy_to_host); + test_analytical_troe(four_da, 1e-10, copy_to_device, copy_to_host); + test_analytical_troe(six_da, 1e-10, copy_to_device, copy_to_host); } TEST(AnalyticalExamplesCudaRosenbrock, TroeSuperStiffButAnalytical) { - test_analytical_stiff_troe(two, 1e-3, copy_to_device, copy_to_host); - test_analytical_stiff_troe(three, 1e-3, copy_to_device, copy_to_host); - test_analytical_stiff_troe(four, 1e-3, copy_to_device, copy_to_host); - test_analytical_stiff_troe(four_da, 1e-3, copy_to_device, copy_to_host); - test_analytical_stiff_troe(six_da, 1e-3, copy_to_device, copy_to_host); + test_analytical_stiff_troe(two, 1e-5, copy_to_device, copy_to_host); + test_analytical_stiff_troe(three, 1e-5, copy_to_device, copy_to_host); + test_analytical_stiff_troe(four, 1e-5, copy_to_device, copy_to_host); + test_analytical_stiff_troe(four_da, 1e-5, copy_to_device, copy_to_host); + test_analytical_stiff_troe(six_da, 1e-5, copy_to_device, copy_to_host); } TEST(AnalyticalExamplesCudaRosenbrock, Photolysis) { - test_analytical_photolysis(two, 1e-2, copy_to_device, copy_to_host); - test_analytical_photolysis(three, 1e-6, copy_to_device, copy_to_host); - test_analytical_photolysis(four, 1e-8, copy_to_device, copy_to_host); - test_analytical_photolysis(four_da, 1e-6, copy_to_device, copy_to_host); - test_analytical_photolysis(six_da, 1e-8, copy_to_device, copy_to_host); + test_analytical_photolysis(two, 2e-6, copy_to_device, copy_to_host); + test_analytical_photolysis(three, 2e-6, copy_to_device, copy_to_host); + test_analytical_photolysis(four, 2e-8, copy_to_device, copy_to_host); + test_analytical_photolysis(four_da, 2e-6, copy_to_device, copy_to_host); + test_analytical_photolysis(six_da, 2e-6, copy_to_device, copy_to_host); } TEST(AnalyticalExamplesCudaRosenbrock, PhotolysisSuperStiffButAnalytical) { - test_analytical_stiff_photolysis(two, 2e-2, copy_to_device, copy_to_host); - test_analytical_stiff_photolysis(three, 2e-4, copy_to_device, copy_to_host); - test_analytical_stiff_photolysis(four, 2e-4, copy_to_device, copy_to_host); - test_analytical_stiff_photolysis(four_da, 2e-4, copy_to_device, copy_to_host); - test_analytical_stiff_photolysis(six_da, 2e-4, copy_to_device, copy_to_host); + test_analytical_stiff_photolysis(two, 2e-5, copy_to_device, copy_to_host); + test_analytical_stiff_photolysis(three, 2e-5, copy_to_device, copy_to_host); + test_analytical_stiff_photolysis(four, 2e-5, copy_to_device, copy_to_host); + test_analytical_stiff_photolysis(four_da, 2e-5, copy_to_device, copy_to_host); + test_analytical_stiff_photolysis(six_da, 2e-5, copy_to_device, copy_to_host); } TEST(AnalyticalExamplesCudaRosenbrock, TernaryChemicalActivation) { - test_analytical_ternary_chemical_activation(two, 1e-3, copy_to_device, copy_to_host); - test_analytical_ternary_chemical_activation(three, 2e-4, copy_to_device, copy_to_host); - test_analytical_ternary_chemical_activation(four, 1e-4, copy_to_device, copy_to_host); - test_analytical_ternary_chemical_activation(four_da, 1e-4, copy_to_device, copy_to_host); - test_analytical_ternary_chemical_activation(six_da, 1e-4, copy_to_device, copy_to_host); + test_analytical_ternary_chemical_activation(two, 1e-8, copy_to_device, copy_to_host); + test_analytical_ternary_chemical_activation(three, 1e-8, copy_to_device, copy_to_host); + test_analytical_ternary_chemical_activation(four, 1e-8, copy_to_device, copy_to_host); + test_analytical_ternary_chemical_activation(four_da, 1e-8, copy_to_device, copy_to_host); + test_analytical_ternary_chemical_activation(six_da, 1e-8, copy_to_device, copy_to_host); } TEST(AnalyticalExamplesCudaRosenbrock, TernaryChemicalActivationSuperStiffButAnalytical) @@ -90,47 +90,47 @@ TEST(AnalyticalExamplesCudaRosenbrock, TernaryChemicalActivationSuperStiffButAna TEST(AnalyticalExamplesCudaRosenbrock, Tunneling) { - test_analytical_tunneling(two, 1e-1, copy_to_device, copy_to_host); - test_analytical_tunneling(three, 1e-5, copy_to_device, copy_to_host); + test_analytical_tunneling(two, 2e-5, copy_to_device, copy_to_host); + test_analytical_tunneling(three, 1e-6, copy_to_device, copy_to_host); test_analytical_tunneling(four, 1e-6, copy_to_device, copy_to_host); - test_analytical_tunneling(four_da, 1e-5, copy_to_device, copy_to_host); + test_analytical_tunneling(four_da, 1e-6, copy_to_device, copy_to_host); test_analytical_tunneling(six_da, 1e-6, copy_to_device, copy_to_host); } TEST(AnalyticalExamplesCudaRosenbrock, TunnelingSuperStiffButAnalytical) { - test_analytical_stiff_tunneling(two, 1e-1, copy_to_device, copy_to_host); - test_analytical_stiff_tunneling(three, 2e-4, copy_to_device, copy_to_host); - test_analytical_stiff_tunneling(four, 2e-4, copy_to_device, copy_to_host); - test_analytical_stiff_tunneling(four_da, 2e-4, copy_to_device, copy_to_host); - test_analytical_stiff_tunneling(six_da, 2e-4, copy_to_device, copy_to_host); + test_analytical_stiff_tunneling(two, 1e-4, copy_to_device, copy_to_host); + test_analytical_stiff_tunneling(three, 1e-4, copy_to_device, copy_to_host); + test_analytical_stiff_tunneling(four, 1e-4, copy_to_device, copy_to_host); + test_analytical_stiff_tunneling(four_da, 1e-4, copy_to_device, copy_to_host); + test_analytical_stiff_tunneling(six_da, 1e-4, copy_to_device, copy_to_host); } TEST(AnalyticalExamplesCudaRosenbrock, Arrhenius) { - test_analytical_arrhenius(two, 1e-4, copy_to_device, copy_to_host); - test_analytical_arrhenius(three, 1e-8, copy_to_device, copy_to_host); - test_analytical_arrhenius(four, 1e-8, copy_to_device, copy_to_host); - test_analytical_arrhenius(four_da, 1e-8, copy_to_device, copy_to_host); - test_analytical_arrhenius(six_da, 1e-8, copy_to_device, copy_to_host); + test_analytical_arrhenius(two, 4e-6, copy_to_device, copy_to_host); + test_analytical_arrhenius(three, 1e-9, copy_to_device, copy_to_host); + test_analytical_arrhenius(four, 1e-9, copy_to_device, copy_to_host); + test_analytical_arrhenius(four_da, 1e-9, copy_to_device, copy_to_host); + test_analytical_arrhenius(six_da, 1e-9, copy_to_device, copy_to_host); } TEST(AnalyticalExamplesCudaRosenbrock, ArrheniusSuperStiffButAnalytical) { - test_analytical_stiff_arrhenius(two, 1e-3, copy_to_device, copy_to_host); - test_analytical_stiff_arrhenius(three, 1e-3, copy_to_device, copy_to_host); - test_analytical_stiff_arrhenius(four, 1e-3, copy_to_device, copy_to_host); - test_analytical_stiff_arrhenius(four_da, 1e-3, copy_to_device, copy_to_host); - test_analytical_stiff_arrhenius(six_da, 1e-3, copy_to_device, copy_to_host); + test_analytical_stiff_arrhenius(two, 1e-4, copy_to_device, copy_to_host); + test_analytical_stiff_arrhenius(three, 2e-5, copy_to_device, copy_to_host); + test_analytical_stiff_arrhenius(four, 2e-5, copy_to_device, copy_to_host); + test_analytical_stiff_arrhenius(four_da, 2e-5, copy_to_device, copy_to_host); + test_analytical_stiff_arrhenius(six_da, 1e-5, copy_to_device, copy_to_host); } TEST(AnalyticalExamplesCudaRosenbrock, Branched) { - test_analytical_branched(two, 1e-4, copy_to_device, copy_to_host); - test_analytical_branched(three, 1e-5, copy_to_device, copy_to_host); - test_analytical_branched(four, 1e-5, copy_to_device, copy_to_host); - test_analytical_branched(four_da, 1e-5, copy_to_device, copy_to_host); - test_analytical_branched(six_da, 1e-5, copy_to_device, copy_to_host); + test_analytical_branched(two, 1e-10, copy_to_device, copy_to_host); + test_analytical_branched(three, 1e-13, copy_to_device, copy_to_host); + test_analytical_branched(four, 1e-13, copy_to_device, copy_to_host); + test_analytical_branched(four_da, 1e-13, copy_to_device, copy_to_host); + test_analytical_branched(six_da, 1e-13, copy_to_device, copy_to_host); } TEST(AnalyticalExamplesCudaRosenbrock, BranchedSuperStiffButAnalytical) @@ -218,19 +218,19 @@ TEST(AnalyticalExamplesCudaRosenbrock, Oregonator) }; auto solver = rosenbrock_solver(micm::RosenbrockSolverParameters::TwoStageRosenbrockParameters()); - test_analytical_oregonator(solver, 1e-3, copy_to_device, copy_to_host); + test_analytical_oregonator(solver, 4e-6, copy_to_device, copy_to_host); solver = rosenbrock_solver(micm::RosenbrockSolverParameters::ThreeStageRosenbrockParameters()); - test_analytical_oregonator(solver, 1e-3, copy_to_device, copy_to_host); + test_analytical_oregonator(solver, 4e-6, copy_to_device, copy_to_host); solver = rosenbrock_solver(micm::RosenbrockSolverParameters::FourStageRosenbrockParameters()); - test_analytical_oregonator(solver, 1e-3, copy_to_device, copy_to_host); + test_analytical_oregonator(solver, 4e-6, copy_to_device, copy_to_host); solver = rosenbrock_solver(micm::RosenbrockSolverParameters::FourStageDifferentialAlgebraicRosenbrockParameters()); - test_analytical_oregonator(solver, 1e-3, copy_to_device, copy_to_host); + test_analytical_oregonator(solver, 4e-6, copy_to_device, copy_to_host); solver = rosenbrock_solver(micm::RosenbrockSolverParameters::SixStageDifferentialAlgebraicRosenbrockParameters()); - test_analytical_oregonator(solver, 1e-3, copy_to_device, copy_to_host); + test_analytical_oregonator(solver, 4e-6, copy_to_device, copy_to_host); } TEST(AnalyticalExamplesCudaRosenbrock, HIRES) @@ -243,17 +243,17 @@ TEST(AnalyticalExamplesCudaRosenbrock, HIRES) }; auto solver = rosenbrock_solver(micm::RosenbrockSolverParameters::TwoStageRosenbrockParameters()); - test_analytical_hires(solver, 1e-4, copy_to_device, copy_to_host); + test_analytical_hires(solver, 1e-6, copy_to_device, copy_to_host); solver = rosenbrock_solver(micm::RosenbrockSolverParameters::ThreeStageRosenbrockParameters()); - test_analytical_hires(solver, 1e-3, copy_to_device, copy_to_host); + test_analytical_hires(solver, 1e-7, copy_to_device, copy_to_host); solver = rosenbrock_solver(micm::RosenbrockSolverParameters::FourStageRosenbrockParameters()); - test_analytical_hires(solver, 1e-3, copy_to_device, copy_to_host); + test_analytical_hires(solver, 1e-7, copy_to_device, copy_to_host); solver = rosenbrock_solver(micm::RosenbrockSolverParameters::FourStageDifferentialAlgebraicRosenbrockParameters()); - test_analytical_hires(solver, 1e-3, copy_to_device, copy_to_host); + test_analytical_hires(solver, 1e-6, copy_to_device, copy_to_host); solver = rosenbrock_solver(micm::RosenbrockSolverParameters::SixStageDifferentialAlgebraicRosenbrockParameters()); - test_analytical_hires(solver, 1e-3, copy_to_device, copy_to_host); + test_analytical_hires(solver, 1e-6, copy_to_device, copy_to_host); } \ No newline at end of file