Skip to content

Commit

Permalink
uncommenting tests
Browse files Browse the repository at this point in the history
  • Loading branch information
K20shores committed Nov 11, 2024
1 parent 96fbfd0 commit 09c4df2
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 124 deletions.
64 changes: 20 additions & 44 deletions test/integration/cuda/test_cuda_analytical_rosenbrock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,24 +144,19 @@ TEST(AnalyticalExamplesCudaRosenbrock, BranchedSuperStiffButAnalytical)

TEST(AnalyticalExamplesCudaRosenbrock, Robertson)
{
auto rosenbrock_solver = [](auto params)
{
return builderType1Cell(params);
};

auto solver = rosenbrock_solver(micm::RosenbrockSolverParameters::TwoStageRosenbrockParameters());
auto solver = builderType1Cell(micm::RosenbrockSolverParameters::TwoStageRosenbrockParameters());
test_analytical_robertson<builderType1Cell, stateType1Cell>(solver, 2e-1, copy_to_device, copy_to_host);

solver = rosenbrock_solver(micm::RosenbrockSolverParameters::ThreeStageRosenbrockParameters());
solver = builderType1Cell(micm::RosenbrockSolverParameters::ThreeStageRosenbrockParameters());
test_analytical_robertson<builderType1Cell, stateType1Cell>(solver, 2e-1, copy_to_device, copy_to_host);

solver = rosenbrock_solver(micm::RosenbrockSolverParameters::FourStageRosenbrockParameters());
solver = builderType1Cell(micm::RosenbrockSolverParameters::FourStageRosenbrockParameters());
test_analytical_robertson<builderType1Cell, stateType1Cell>(solver, 2e-1, copy_to_device, copy_to_host);

solver = rosenbrock_solver(micm::RosenbrockSolverParameters::FourStageDifferentialAlgebraicRosenbrockParameters());
solver = builderType1Cell(micm::RosenbrockSolverParameters::FourStageDifferentialAlgebraicRosenbrockParameters());
test_analytical_robertson<builderType1Cell, stateType1Cell>(solver, 2e-1, copy_to_device, copy_to_host);

solver = rosenbrock_solver(micm::RosenbrockSolverParameters::SixStageDifferentialAlgebraicRosenbrockParameters());
solver = builderType1Cell(micm::RosenbrockSolverParameters::SixStageDifferentialAlgebraicRosenbrockParameters());
test_analytical_robertson<builderType1Cell, stateType1Cell>(solver, 2e-1, copy_to_device, copy_to_host);
}

Expand All @@ -174,75 +169,56 @@ TEST(AnalyticalExamplesCudaRosenbrock, SurfaceRxn)
test_analytical_surface_rxn<builderType1Cell, stateType1Cell>(six_da_1_cell, 1e-7, copy_to_device, copy_to_host);
}

//Commented out the following tests as it is failing to copy State to Device
//Will uncomment them once we have a plan how to deal with state (relative tolearnce and absolute tolerance) on GPU
/*
TEST(AnalyticalExamplesCudaRosenbrock, E5)
{
auto rosenbrock_solver = [](auto params)
{
return builderType1Cell(params);
};
auto solver = rosenbrock_solver(micm::RosenbrockSolverParameters::TwoStageRosenbrockParameters());
auto solver = builderType1Cell(micm::RosenbrockSolverParameters::TwoStageRosenbrockParameters());
test_analytical_e5<builderType1Cell, stateType1Cell>(solver, 1e-3, copy_to_device, copy_to_host);

solver = rosenbrock_solver(micm::RosenbrockSolverParameters::ThreeStageRosenbrockParameters());
solver = builderType1Cell(micm::RosenbrockSolverParameters::ThreeStageRosenbrockParameters());
test_analytical_e5<builderType1Cell, stateType1Cell>(solver, 1e-3, copy_to_device, copy_to_host);

solver = rosenbrock_solver(micm::RosenbrockSolverParameters::FourStageRosenbrockParameters());
solver = builderType1Cell(micm::RosenbrockSolverParameters::FourStageRosenbrockParameters());
test_analytical_e5<builderType1Cell, stateType1Cell>(solver, 1e-3, copy_to_device, copy_to_host);

solver = rosenbrock_solver(micm::RosenbrockSolverParameters::FourStageDifferentialAlgebraicRosenbrockParameters());
solver = builderType1Cell(micm::RosenbrockSolverParameters::FourStageDifferentialAlgebraicRosenbrockParameters());
test_analytical_e5<builderType1Cell, stateType1Cell>(solver, 1e-3, copy_to_device, copy_to_host);

solver = rosenbrock_solver(micm::RosenbrockSolverParameters::SixStageDifferentialAlgebraicRosenbrockParameters());
solver = builderType1Cell(micm::RosenbrockSolverParameters::SixStageDifferentialAlgebraicRosenbrockParameters());
test_analytical_e5<builderType1Cell, stateType1Cell>(solver, 1e-3, copy_to_device, copy_to_host);
}

TEST(AnalyticalExamplesCudaRosenbrock, Oregonator)
{
auto rosenbrock_solver = [](auto params)
{
return builderType1Cell(params);
};
auto solver = rosenbrock_solver(micm::RosenbrockSolverParameters::TwoStageRosenbrockParameters());
auto solver = builderType1Cell(micm::RosenbrockSolverParameters::TwoStageRosenbrockParameters());
test_analytical_oregonator<builderType1Cell, stateType1Cell>(solver, 2e-3, copy_to_device, copy_to_host);

solver = rosenbrock_solver(micm::RosenbrockSolverParameters::ThreeStageRosenbrockParameters());
solver = builderType1Cell(micm::RosenbrockSolverParameters::ThreeStageRosenbrockParameters());
test_analytical_oregonator<builderType1Cell, stateType1Cell>(solver, 2e-3, copy_to_device, copy_to_host);

solver = rosenbrock_solver(micm::RosenbrockSolverParameters::FourStageRosenbrockParameters());
solver = builderType1Cell(micm::RosenbrockSolverParameters::FourStageRosenbrockParameters());
test_analytical_oregonator<builderType1Cell, stateType1Cell>(solver, 2e-3, copy_to_device, copy_to_host);

solver = rosenbrock_solver(micm::RosenbrockSolverParameters::FourStageDifferentialAlgebraicRosenbrockParameters());
solver = builderType1Cell(micm::RosenbrockSolverParameters::FourStageDifferentialAlgebraicRosenbrockParameters());
test_analytical_oregonator<builderType1Cell, stateType1Cell>(solver, 2e-3, copy_to_device, copy_to_host);

solver = rosenbrock_solver(micm::RosenbrockSolverParameters::SixStageDifferentialAlgebraicRosenbrockParameters());
solver = builderType1Cell(micm::RosenbrockSolverParameters::SixStageDifferentialAlgebraicRosenbrockParameters());
test_analytical_oregonator<builderType1Cell, stateType1Cell>(solver, 2e-3, copy_to_device, copy_to_host);
}

TEST(AnalyticalExamplesCudaRosenbrock, HIRES)
{
auto rosenbrock_solver = [](auto params)
{
return builderType1Cell(params);
};
auto solver = rosenbrock_solver(micm::RosenbrockSolverParameters::TwoStageRosenbrockParameters());
auto solver = builderType1Cell(micm::RosenbrockSolverParameters::TwoStageRosenbrockParameters());
test_analytical_hires<builderType1Cell, stateType1Cell>(solver, 1e-6, copy_to_device, copy_to_host);

solver = rosenbrock_solver(micm::RosenbrockSolverParameters::ThreeStageRosenbrockParameters());
solver = builderType1Cell(micm::RosenbrockSolverParameters::ThreeStageRosenbrockParameters());
test_analytical_hires<builderType1Cell, stateType1Cell>(solver, 1e-7, copy_to_device, copy_to_host);

solver = rosenbrock_solver(micm::RosenbrockSolverParameters::FourStageRosenbrockParameters());
solver = builderType1Cell(micm::RosenbrockSolverParameters::FourStageRosenbrockParameters());
test_analytical_hires<builderType1Cell, stateType1Cell>(solver, 1e-7, copy_to_device, copy_to_host);

solver = rosenbrock_solver(micm::RosenbrockSolverParameters::FourStageDifferentialAlgebraicRosenbrockParameters());
solver = builderType1Cell(micm::RosenbrockSolverParameters::FourStageDifferentialAlgebraicRosenbrockParameters());
test_analytical_hires<builderType1Cell, stateType1Cell>(solver, 1e-6, copy_to_device, copy_to_host);

solver = rosenbrock_solver(micm::RosenbrockSolverParameters::SixStageDifferentialAlgebraicRosenbrockParameters());
solver = builderType1Cell(micm::RosenbrockSolverParameters::SixStageDifferentialAlgebraicRosenbrockParameters());
test_analytical_hires<builderType1Cell, stateType1Cell>(solver, 1e-6, copy_to_device, copy_to_host);
}
*/
60 changes: 20 additions & 40 deletions test/integration/jit/test_jit_analytical_rosenbrock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,24 +146,19 @@ TEST(AnalyticalExamplesJitRosenbrock, BranchedSuperStiffButAnalytical)

TEST(AnalyticalExamplesJitRosenbrock, Robertson)
{
auto rosenbrock_solver = [](auto params)
{
return BuilderType<1>(params);
};

auto solver = rosenbrock_solver(micm::RosenbrockSolverParameters::TwoStageRosenbrockParameters());
auto solver = BuilderType<1>(micm::RosenbrockSolverParameters::TwoStageRosenbrockParameters());
test_analytical_robertson<BuilderType<1>, StateType<1>>(solver, 1e-1);

solver = rosenbrock_solver(micm::RosenbrockSolverParameters::ThreeStageRosenbrockParameters());
solver = BuilderType<1>(micm::RosenbrockSolverParameters::ThreeStageRosenbrockParameters());
test_analytical_robertson<BuilderType<1>, StateType<1>>(solver, 1e-1);

solver = rosenbrock_solver(micm::RosenbrockSolverParameters::FourStageRosenbrockParameters());
solver = BuilderType<1>(micm::RosenbrockSolverParameters::FourStageRosenbrockParameters());
test_analytical_robertson<BuilderType<1>, StateType<1>>(solver, 1e-1);

solver = rosenbrock_solver(micm::RosenbrockSolverParameters::FourStageDifferentialAlgebraicRosenbrockParameters());
solver = BuilderType<1>(micm::RosenbrockSolverParameters::FourStageDifferentialAlgebraicRosenbrockParameters());
test_analytical_robertson<BuilderType<1>, StateType<1>>(solver, 1e-1);

solver = rosenbrock_solver(micm::RosenbrockSolverParameters::SixStageDifferentialAlgebraicRosenbrockParameters());
solver = BuilderType<1>(micm::RosenbrockSolverParameters::SixStageDifferentialAlgebraicRosenbrockParameters());
test_analytical_robertson<BuilderType<1>, StateType<1>>(solver, 1e-1);
}

Expand All @@ -178,69 +173,54 @@ TEST(AnalyticalExamplesJitRosenbrock, SurfaceRxn)

TEST(AnalyticalExamplesJitRosenbrock, E5)
{
auto rosenbrock_solver = [](auto params)
{
return BuilderType<1>(params);
};

auto solver = rosenbrock_solver(micm::RosenbrockSolverParameters::TwoStageRosenbrockParameters());
auto solver = BuilderType<1>(micm::RosenbrockSolverParameters::TwoStageRosenbrockParameters());
test_analytical_e5<BuilderType<1>, StateType<1>>(solver, 1e-3);

solver = rosenbrock_solver(micm::RosenbrockSolverParameters::ThreeStageRosenbrockParameters());
solver = BuilderType<1>(micm::RosenbrockSolverParameters::ThreeStageRosenbrockParameters());
test_analytical_e5<BuilderType<1>, StateType<1>>(solver, 1e-3);

solver = rosenbrock_solver(micm::RosenbrockSolverParameters::FourStageRosenbrockParameters());
solver = BuilderType<1>(micm::RosenbrockSolverParameters::FourStageRosenbrockParameters());
test_analytical_e5<BuilderType<1>, StateType<1>>(solver, 1e-3);

solver = rosenbrock_solver(micm::RosenbrockSolverParameters::FourStageDifferentialAlgebraicRosenbrockParameters());
solver = BuilderType<1>(micm::RosenbrockSolverParameters::FourStageDifferentialAlgebraicRosenbrockParameters());
test_analytical_e5<BuilderType<1>, StateType<1>>(solver, 1e-3);

solver = rosenbrock_solver(micm::RosenbrockSolverParameters::SixStageDifferentialAlgebraicRosenbrockParameters());
solver = BuilderType<1>(micm::RosenbrockSolverParameters::SixStageDifferentialAlgebraicRosenbrockParameters());
test_analytical_e5<BuilderType<1>, StateType<1>>(solver, 1e-3);
}

TEST(AnalyticalExamplesJitRosenbrock, Oregonator)
{
auto rosenbrock_solver = [](auto params)
{
return BuilderType<1>(params);
};

auto solver = rosenbrock_solver(micm::RosenbrockSolverParameters::TwoStageRosenbrockParameters());
auto solver = BuilderType<1>(micm::RosenbrockSolverParameters::TwoStageRosenbrockParameters());
test_analytical_oregonator<BuilderType<1>, StateType<1>>(solver, 4e-4);

solver = rosenbrock_solver(micm::RosenbrockSolverParameters::ThreeStageRosenbrockParameters());
solver = BuilderType<1>(micm::RosenbrockSolverParameters::ThreeStageRosenbrockParameters());
test_analytical_oregonator<BuilderType<1>, StateType<1>>(solver, 4e-4);

solver = rosenbrock_solver(micm::RosenbrockSolverParameters::FourStageRosenbrockParameters());
solver = BuilderType<1>(micm::RosenbrockSolverParameters::FourStageRosenbrockParameters());
test_analytical_oregonator<BuilderType<1>, StateType<1>>(solver, 4e-4);

solver = rosenbrock_solver(micm::RosenbrockSolverParameters::FourStageDifferentialAlgebraicRosenbrockParameters());
solver = BuilderType<1>(micm::RosenbrockSolverParameters::FourStageDifferentialAlgebraicRosenbrockParameters());
test_analytical_oregonator<BuilderType<1>, StateType<1>>(solver, 4e-4);

solver = rosenbrock_solver(micm::RosenbrockSolverParameters::SixStageDifferentialAlgebraicRosenbrockParameters());
solver = BuilderType<1>(micm::RosenbrockSolverParameters::SixStageDifferentialAlgebraicRosenbrockParameters());
test_analytical_oregonator<BuilderType<1>, StateType<1>>(solver, 4e-4);
}

TEST(AnalyticalExamplesJitRosenbrock, HIRES)
{
auto rosenbrock_solver = [](auto params)
{
return BuilderType<1>(params);
};

auto solver = rosenbrock_solver(micm::RosenbrockSolverParameters::TwoStageRosenbrockParameters());
auto solver = BuilderType<1>(micm::RosenbrockSolverParameters::TwoStageRosenbrockParameters());
test_analytical_hires<BuilderType<1>, StateType<1>>(solver, 1e-6);

solver = rosenbrock_solver(micm::RosenbrockSolverParameters::ThreeStageRosenbrockParameters());
solver = BuilderType<1>(micm::RosenbrockSolverParameters::ThreeStageRosenbrockParameters());
test_analytical_hires<BuilderType<1>, StateType<1>>(solver, 1e-7);

solver = rosenbrock_solver(micm::RosenbrockSolverParameters::FourStageRosenbrockParameters());
solver = BuilderType<1>(micm::RosenbrockSolverParameters::FourStageRosenbrockParameters());
test_analytical_hires<BuilderType<1>, StateType<1>>(solver, 1e-7);

solver = rosenbrock_solver(micm::RosenbrockSolverParameters::FourStageDifferentialAlgebraicRosenbrockParameters());
solver = BuilderType<1>(micm::RosenbrockSolverParameters::FourStageDifferentialAlgebraicRosenbrockParameters());
test_analytical_hires<BuilderType<1>, StateType<1>>(solver, 1e-6);

solver = rosenbrock_solver(micm::RosenbrockSolverParameters::SixStageDifferentialAlgebraicRosenbrockParameters());
solver = BuilderType<1>(micm::RosenbrockSolverParameters::SixStageDifferentialAlgebraicRosenbrockParameters());
test_analytical_hires<BuilderType<1>, StateType<1>>(solver, 1e-6);
}
60 changes: 20 additions & 40 deletions test/integration/test_analytical_rosenbrock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,70 +196,55 @@ TEST(AnalyticalExamples, BranchedSuperStiffButAnalytical)

TEST(AnalyticalExamples, Robertson)
{
auto rosenbrock_solver = [](auto params)
{
return BuilderType(params);
};

auto solver = rosenbrock_solver(micm::RosenbrockSolverParameters::TwoStageRosenbrockParameters());
auto solver = BuilderType(micm::RosenbrockSolverParameters::TwoStageRosenbrockParameters());
test_analytical_robertson<BuilderType, StateType>(solver, 1e-1);

solver = rosenbrock_solver(micm::RosenbrockSolverParameters::ThreeStageRosenbrockParameters());
solver = BuilderType(micm::RosenbrockSolverParameters::ThreeStageRosenbrockParameters());
test_analytical_robertson<BuilderType, StateType>(solver, 1e-1);

solver = rosenbrock_solver(micm::RosenbrockSolverParameters::FourStageRosenbrockParameters());
solver = BuilderType(micm::RosenbrockSolverParameters::FourStageRosenbrockParameters());
test_analytical_robertson<BuilderType, StateType>(solver, 1e-1);

solver = rosenbrock_solver(micm::RosenbrockSolverParameters::FourStageDifferentialAlgebraicRosenbrockParameters());
solver = BuilderType(micm::RosenbrockSolverParameters::FourStageDifferentialAlgebraicRosenbrockParameters());
test_analytical_robertson<BuilderType, StateType>(solver, 1e-1);

solver = rosenbrock_solver(micm::RosenbrockSolverParameters::SixStageDifferentialAlgebraicRosenbrockParameters());
solver = BuilderType(micm::RosenbrockSolverParameters::SixStageDifferentialAlgebraicRosenbrockParameters());
test_analytical_robertson<BuilderType, StateType>(solver, 1e-1);
}

TEST(AnalyticalExamples, E5)
{
auto rosenbrock_solver = [](auto params)
{
return BuilderType(params);
};

auto solver = rosenbrock_solver(micm::RosenbrockSolverParameters::TwoStageRosenbrockParameters());
auto solver = BuilderType(micm::RosenbrockSolverParameters::TwoStageRosenbrockParameters());
test_analytical_e5<BuilderType, StateType>(solver, 1e-3);

solver = rosenbrock_solver(micm::RosenbrockSolverParameters::ThreeStageRosenbrockParameters());
solver = BuilderType(micm::RosenbrockSolverParameters::ThreeStageRosenbrockParameters());
test_analytical_e5<BuilderType, StateType>(solver, 1e-3);

solver = rosenbrock_solver(micm::RosenbrockSolverParameters::FourStageRosenbrockParameters());
solver = BuilderType(micm::RosenbrockSolverParameters::FourStageRosenbrockParameters());
test_analytical_e5<BuilderType, StateType>(solver, 1e-3);

solver = rosenbrock_solver(micm::RosenbrockSolverParameters::FourStageDifferentialAlgebraicRosenbrockParameters());
solver = BuilderType(micm::RosenbrockSolverParameters::FourStageDifferentialAlgebraicRosenbrockParameters());
test_analytical_e5<BuilderType, StateType>(solver, 1e-3);

solver = rosenbrock_solver(micm::RosenbrockSolverParameters::SixStageDifferentialAlgebraicRosenbrockParameters());
solver = BuilderType(micm::RosenbrockSolverParameters::SixStageDifferentialAlgebraicRosenbrockParameters());
test_analytical_e5<BuilderType, StateType>(solver, 1e-3);
}

TEST(AnalyticalExamples, Oregonator)
{
auto rosenbrock_solver = [](auto params)
{
return micm::CpuSolverBuilder<micm::RosenbrockSolverParameters>(params);
};

auto solver = rosenbrock_solver(micm::RosenbrockSolverParameters::TwoStageRosenbrockParameters());
auto solver = BuilderType(micm::RosenbrockSolverParameters::TwoStageRosenbrockParameters());
test_analytical_oregonator(solver, 4e-6);

solver = rosenbrock_solver(micm::RosenbrockSolverParameters::ThreeStageRosenbrockParameters());
solver = BuilderType(micm::RosenbrockSolverParameters::ThreeStageRosenbrockParameters());
test_analytical_oregonator(solver, 4e-6);

solver = rosenbrock_solver(micm::RosenbrockSolverParameters::FourStageRosenbrockParameters());
solver = BuilderType(micm::RosenbrockSolverParameters::FourStageRosenbrockParameters());
test_analytical_oregonator(solver, 4e-6);

solver = rosenbrock_solver(micm::RosenbrockSolverParameters::FourStageDifferentialAlgebraicRosenbrockParameters());
solver = BuilderType(micm::RosenbrockSolverParameters::FourStageDifferentialAlgebraicRosenbrockParameters());
test_analytical_oregonator(solver, 4e-6);

solver = rosenbrock_solver(micm::RosenbrockSolverParameters::SixStageDifferentialAlgebraicRosenbrockParameters());
solver = BuilderType(micm::RosenbrockSolverParameters::SixStageDifferentialAlgebraicRosenbrockParameters());
test_analytical_oregonator(solver, 4e-6);
}

Expand All @@ -274,23 +259,18 @@ TEST(AnalyticalExamples, SurfaceRxn)

TEST(AnalyticalExamples, HIRES)
{
auto rosenbrock_solver = [](auto params)
{
return micm::CpuSolverBuilder<micm::RosenbrockSolverParameters>(params);
};

auto solver = rosenbrock_solver(micm::RosenbrockSolverParameters::TwoStageRosenbrockParameters());
auto solver = BuilderType(micm::RosenbrockSolverParameters::TwoStageRosenbrockParameters());
test_analytical_hires(solver, 1e-6);

solver = rosenbrock_solver(micm::RosenbrockSolverParameters::ThreeStageRosenbrockParameters());
solver = BuilderType(micm::RosenbrockSolverParameters::ThreeStageRosenbrockParameters());
test_analytical_hires(solver, 1e-7);

solver = rosenbrock_solver(micm::RosenbrockSolverParameters::FourStageRosenbrockParameters());
solver = BuilderType(micm::RosenbrockSolverParameters::FourStageRosenbrockParameters());
test_analytical_hires(solver, 1e-7);

solver = rosenbrock_solver(micm::RosenbrockSolverParameters::FourStageDifferentialAlgebraicRosenbrockParameters());
solver = BuilderType(micm::RosenbrockSolverParameters::FourStageDifferentialAlgebraicRosenbrockParameters());
test_analytical_hires(solver, 1e-6);

solver = rosenbrock_solver(micm::RosenbrockSolverParameters::SixStageDifferentialAlgebraicRosenbrockParameters());
solver = BuilderType(micm::RosenbrockSolverParameters::SixStageDifferentialAlgebraicRosenbrockParameters());
test_analytical_hires(solver, 1e-6);
}

0 comments on commit 09c4df2

Please sign in to comment.