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

Maintenance/arkode UI #459

Merged
merged 44 commits into from
May 7, 2024
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
14d817b
Updated ARKODE header files in alignment with this proposal -- need t…
drreynolds Apr 15, 2024
cedc127
Added shared set of ARKODE UI routines, and set existing stepper-spec…
drreynolds Apr 18, 2024
6ad80b7
Ported all exampls to use new shared ARKODE UI functions; fixed some …
drreynolds Apr 18, 2024
f7b9e40
Ported all unit tests and benchmark codes to use new shared ARKODE UI…
drreynolds Apr 18, 2024
23e6e39
Merge ../develop into maintenance/arkode-ui
drreynolds Apr 19, 2024
fbdead5
Updated new ark_test_mass.c test to use new ARKODE API
drreynolds Apr 19, 2024
37f5611
Updated signature of ARKTimeStepFree function pointer to only require…
drreynolds Apr 19, 2024
7f7e007
Ran clang-format on all ARKODE files, examples, tests, and benchmarks
drreynolds Apr 22, 2024
32b5260
re-ran clang-format after reinstalling version 17
drreynolds Apr 22, 2024
ddfcc33
Fixed workspace lengths in .out files
drreynolds Apr 22, 2024
05290be
Initial pass at updated ARKODE documentation
drreynolds Apr 24, 2024
6d633d6
Finished first pass at revised ARKODE documentation
drreynolds Apr 24, 2024
01b7d1a
Applied suggestion from code review regarding internal ARKODE routine…
drreynolds Apr 25, 2024
92eb0b9
Updated one .out file to match new workspace sizes
drreynolds Apr 26, 2024
5ecb883
Apply suggestions from code review
drreynolds Apr 26, 2024
62f786b
Apply suggestions from code review
drreynolds Apr 26, 2024
8549ed6
Apply suggestions from code review
drreynolds Apr 26, 2024
fa63d11
Apply suggestions from code review
drreynolds Apr 27, 2024
dbbc816
Apply suggestions from code review
drreynolds Apr 27, 2024
24e7e8f
Ran formatter
drreynolds Apr 27, 2024
e0814d3
Deprecated ARKStepWriteButcher
drreynolds Apr 27, 2024
51ff840
Renamed step_supports_algebraic as step_supports_implicit
drreynolds Apr 27, 2024
71de286
Fixed inconsistencies in reporting ARK_ILL_INPUT instead of ARK_STEPP…
drreynolds Apr 27, 2024
d8ca04b
Ran formatter
drreynolds Apr 27, 2024
3e8f67b
Updated RecentChanges.rst and CHANGELOG.md
drreynolds Apr 27, 2024
e4af306
Added step_getestlocalerrors function to ARKODE v-table; ran code for…
drreynolds Apr 29, 2024
58ac0bc
Fixed copy/paste error
drreynolds Apr 29, 2024
abf334f
Set guards on ARKodeGetTolScaleFactor
drreynolds Apr 29, 2024
1eb2b41
Set guards on ARKodeGetErrWeights
drreynolds Apr 29, 2024
7fcfafb
Deprecated ARKStepSetOptimalParams
drreynolds Apr 30, 2024
31ace7b
Applied suggestions from code review discussion
drreynolds Apr 30, 2024
2e86b60
Updated CHANGELOG and RecentChanges files to note deprecation of ARKS…
drreynolds Apr 30, 2024
3b22f47
Fixed erroneous table directive
drreynolds May 2, 2024
0e8ca29
Applied changes from PR review
drreynolds May 6, 2024
391d30d
Apply suggestions from code review
drreynolds May 6, 2024
f98ac0d
Fixed nrmfac, and added default interpolation type for SPRKStep
drreynolds May 6, 2024
6f6c26a
Merge branch 'maintenance/arkode-ui' of github.com:LLNL/sundials into…
drreynolds May 6, 2024
57b00ed
Update doc/arkode/guide/source/Usage/ERKStep_c_interface/User_callabl…
drreynolds May 6, 2024
faa93b6
Merge branch 'develop' into maintenance/arkode-ui
gardner48 May 6, 2024
c11d38c
Updated integer workspace sizes in a few more .out files
drreynolds May 6, 2024
d544246
Merge branch 'maintenance/arkode-ui' of github.com:LLNL/sundials into…
drreynolds May 6, 2024
ab88805
update answers commit
gardner48 May 6, 2024
1f62f48
Updated a couple of Fortran .out files
drreynolds May 6, 2024
564618b
Merge branch 'develop' into maintenance/arkode-ui
gardner48 May 7, 2024
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
200 changes: 91 additions & 109 deletions benchmarks/advection_reaction_3D/kokkos/arkode_driver.cpp

Large diffs are not rendered by default.

200 changes: 91 additions & 109 deletions benchmarks/advection_reaction_3D/raja/arkode_driver.cpp

Large diffs are not rendered by default.

58 changes: 29 additions & 29 deletions benchmarks/diffusion_2D/main_arkode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -245,49 +245,49 @@ int main(int argc, char* argv[])
if (check_flag((void*)arkode_mem, "ARKStepCreate", 0)) { return 1; }

// Specify tolerances
flag = ARKStepSStolerances(arkode_mem, uopts.rtol, uopts.atol);
if (check_flag(&flag, "ARKStepSStolerances", 1)) { return 1; }
flag = ARKodeSStolerances(arkode_mem, uopts.rtol, uopts.atol);
if (check_flag(&flag, "ARKodeSStolerances", 1)) { return 1; }

// Attach user data
flag = ARKStepSetUserData(arkode_mem, (void*)&udata);
if (check_flag(&flag, "ARKStepSetUserData", 1)) { return 1; }
flag = ARKodeSetUserData(arkode_mem, (void*)&udata);
if (check_flag(&flag, "ARKodeSetUserData", 1)) { return 1; }

// Attach linear solver
flag = ARKStepSetLinearSolver(arkode_mem, LS, A);
if (check_flag(&flag, "ARKStepSetLinearSolver", 1)) { return 1; }
flag = ARKodeSetLinearSolver(arkode_mem, LS, A);
if (check_flag(&flag, "ARKodeSetLinearSolver", 1)) { return 1; }

#if defined(USE_SUPERLU_DIST)
if (uopts.ls == "sludist")
{
ARKStepSetJacFn(arkode_mem, diffusion_jac);
if (check_flag(&flag, "ARKStepSetJacFn", 1)) return 1;
ARKodeSetJacFn(arkode_mem, diffusion_jac);
if (check_flag(&flag, "ARKodeSetJacFn", 1)) return 1;
}
#endif

if (uopts.preconditioning)
{
// Attach preconditioner
flag = ARKStepSetPreconditioner(arkode_mem, PSetup, PSolve);
if (check_flag(&flag, "ARKStepSetPreconditioner", 1)) { return 1; }
flag = ARKodeSetPreconditioner(arkode_mem, PSetup, PSolve);
if (check_flag(&flag, "ARKodeSetPreconditioner", 1)) { return 1; }

// Set linear solver setup frequency (update preconditioner)
flag = ARKStepSetLSetupFrequency(arkode_mem, uopts.msbp);
if (check_flag(&flag, "ARKStepSetLSetupFrequency", 1)) { return 1; }
flag = ARKodeSetLSetupFrequency(arkode_mem, uopts.msbp);
if (check_flag(&flag, "ARKodeSetLSetupFrequency", 1)) { return 1; }
}

// Set linear solver tolerance factor
flag = ARKStepSetEpsLin(arkode_mem, uopts.epslin);
if (check_flag(&flag, "ARKStepSetEpsLin", 1)) { return 1; }
flag = ARKodeSetEpsLin(arkode_mem, uopts.epslin);
if (check_flag(&flag, "ARKodeSetEpsLin", 1)) { return 1; }

// Select method order
flag = ARKStepSetOrder(arkode_mem, uopts.order);
if (check_flag(&flag, "ARKStepSetOrder", 1)) { return 1; }
flag = ARKodeSetOrder(arkode_mem, uopts.order);
if (check_flag(&flag, "ARKodeSetOrder", 1)) { return 1; }

// Set fixed step size or adaptivity method
if (uopts.hfixed > ZERO)
{
flag = ARKStepSetFixedStep(arkode_mem, uopts.hfixed);
if (check_flag(&flag, "ARKStepSetFixedStep", 1)) { return 1; }
flag = ARKodeSetFixedStep(arkode_mem, uopts.hfixed);
if (check_flag(&flag, "ARKodeSetFixedStep", 1)) { return 1; }
}
else
{
Expand All @@ -299,17 +299,17 @@ int main(int argc, char* argv[])
// Specify linearly implicit non-time-dependent RHS
if (uopts.linear)
{
flag = ARKStepSetLinear(arkode_mem, 0);
if (check_flag(&flag, "ARKStepSetLinear", 1)) { return 1; }
flag = ARKodeSetLinear(arkode_mem, 0);
if (check_flag(&flag, "ARKodeSetLinear", 1)) { return 1; }
}

// Set max steps between outputs
flag = ARKStepSetMaxNumSteps(arkode_mem, uopts.maxsteps);
if (check_flag(&flag, "ARKStepSetMaxNumSteps", 1)) { return 1; }
flag = ARKodeSetMaxNumSteps(arkode_mem, uopts.maxsteps);
if (check_flag(&flag, "ARKodeSetMaxNumSteps", 1)) { return 1; }

// Set stopping time
flag = ARKStepSetStopTime(arkode_mem, udata.tf);
if (check_flag(&flag, "ARKStepSetStopTime", 1)) { return 1; }
flag = ARKodeSetStopTime(arkode_mem, udata.tf);
if (check_flag(&flag, "ARKodeSetStopTime", 1)) { return 1; }

// -----------------------
// Loop over output times
Expand Down Expand Up @@ -341,8 +341,8 @@ int main(int argc, char* argv[])
SUNDIALS_MARK_BEGIN(prof, "Evolve");

// Evolve in time
flag = ARKStepEvolve(arkode_mem, tout, u, &t, stepmode);
if (check_flag(&flag, "ARKStepEvolve", 1)) { break; }
flag = ARKodeEvolve(arkode_mem, tout, u, &t, stepmode);
if (check_flag(&flag, "ARKodeEvolve", 1)) { break; }

SUNDIALS_MARK_END(prof, "Evolve");

Expand All @@ -367,8 +367,8 @@ int main(int argc, char* argv[])
if (outproc)
{
cout << "Final integrator statistics:" << endl;
flag = ARKStepPrintAllStats(arkode_mem, stdout, SUN_OUTPUTFORMAT_TABLE);
if (check_flag(&flag, "ARKStepPrintAllStats", 1)) { return 1; }
flag = ARKodePrintAllStats(arkode_mem, stdout, SUN_OUTPUTFORMAT_TABLE);
if (check_flag(&flag, "ARKodePrintAllStats", 1)) { return 1; }
}

// ---------
Expand All @@ -378,7 +378,7 @@ int main(int argc, char* argv[])
// Free MPI Cartesian communicator
MPI_Comm_free(&(udata.comm_c));

ARKStepFree(&arkode_mem);
ARKodeFree(&arkode_mem);
SUNLinSolFree(LS);

// Free the SuperLU_DIST structures (also frees user allocated arrays
Expand Down
112 changes: 56 additions & 56 deletions examples/arkode/CXX_parallel/ark_brusselator1D_task_local_nls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -246,20 +246,20 @@ int EvolveProblemIMEX(SUNContext ctx, N_Vector y, UserData* udata,
if (check_retval((void*)arkode_mem, "ARKStepCreate", 0)) { return 1; }

/* Select the method order */
retval = ARKStepSetOrder(arkode_mem, uopt->order);
if (check_retval(&retval, "ARKStepSetOrder", 1)) { return 1; }
retval = ARKodeSetOrder(arkode_mem, uopt->order);
if (check_retval(&retval, "ARKodeSetOrder", 1)) { return 1; }

/* Attach user data */
retval = ARKStepSetUserData(arkode_mem, (void*)udata);
if (check_retval(&retval, "ARKStepSetUserData*", 1)) { return 1; }
retval = ARKodeSetUserData(arkode_mem, (void*)udata);
if (check_retval(&retval, "ARKodeSetUserData*", 1)) { return 1; }

/* Specify tolerances */
retval = ARKStepSStolerances(arkode_mem, uopt->rtol, uopt->atol);
if (check_retval(&retval, "ARKStepSStolerances", 1)) { return 1; }
retval = ARKodeSStolerances(arkode_mem, uopt->rtol, uopt->atol);
if (check_retval(&retval, "ARKodeSStolerances", 1)) { return 1; }

/* Increase the max number of steps allowed between outputs */
retval = ARKStepSetMaxNumSteps(arkode_mem, 100000);
if (check_retval(&retval, "ARKStepSetMaxNumSteps", 1)) { return 1; }
retval = ARKodeSetMaxNumSteps(arkode_mem, 100000);
if (check_retval(&retval, "ARKodeSetMaxNumSteps", 1)) { return 1; }

/* Create the (non)linear solver */
if (uopt->global)
Expand All @@ -269,20 +269,20 @@ int EvolveProblemIMEX(SUNContext ctx, N_Vector y, UserData* udata,
if (check_retval((void*)NLS, "SUNNonlinSol_Newton", 0)) { return 1; }

/* Attach nonlinear solver */
retval = ARKStepSetNonlinearSolver(arkode_mem, NLS);
if (check_retval(&retval, "ARKStepSetNonlinearSolver", 1)) { return 1; }
retval = ARKodeSetNonlinearSolver(arkode_mem, NLS);
if (check_retval(&retval, "ARKodeSetNonlinearSolver", 1)) { return 1; }

/* Create linear solver */
LS = SUNLinSol_SPGMR(y, SUN_PREC_LEFT, 0, ctx);
if (check_retval((void*)LS, "SUNLinSol_SPGMR", 0)) { return 1; }

/* Attach linear solver */
retval = ARKStepSetLinearSolver(arkode_mem, LS, NULL);
if (check_retval(&retval, "ARKStepSetLinearSolver", 1)) { return 1; }
retval = ARKodeSetLinearSolver(arkode_mem, LS, NULL);
if (check_retval(&retval, "ARKodeSetLinearSolver", 1)) { return 1; }

/* Attach preconditioner */
retval = ARKStepSetPreconditioner(arkode_mem, NULL, PSolve);
if (check_retval(&retval, "ARKStepSetPreconditioner", 1)) { return 1; }
retval = ARKodeSetPreconditioner(arkode_mem, NULL, PSolve);
if (check_retval(&retval, "ARKodeSetPreconditioner", 1)) { return 1; }
}
else
{
Expand All @@ -292,8 +292,8 @@ int EvolveProblemIMEX(SUNContext ctx, N_Vector y, UserData* udata,
if (check_retval((void*)NLS, "TaskLocalNewton", 0)) { return 1; }

/* Attach nonlinear solver */
retval = ARKStepSetNonlinearSolver(arkode_mem, NLS);
if (check_retval(&retval, "ARKStepSetNonlinearSolver", 1)) { return 1; }
retval = ARKodeSetNonlinearSolver(arkode_mem, NLS);
if (check_retval(&retval, "ARKodeSetNonlinearSolver", 1)) { return 1; }
}

/* Output initial condition */
Expand All @@ -313,8 +313,8 @@ int EvolveProblemIMEX(SUNContext ctx, N_Vector y, UserData* udata,

do {
/* Integrate to output time */
retval = ARKStepEvolve(arkode_mem, tout, y, &t, ARK_NORMAL);
if (check_retval(&retval, "ARKStepEvolve", 1)) { break; }
retval = ARKodeEvolve(arkode_mem, tout, y, &t, ARK_NORMAL);
if (check_retval(&retval, "ARKodeEvolve", 1)) { break; }

/* Output state */
WriteOutput(t, y, udata, uopt);
Expand All @@ -328,24 +328,24 @@ int EvolveProblemIMEX(SUNContext ctx, N_Vector y, UserData* udata,
while (iout < uopt->nout);

/* Get final statistics */
retval = ARKStepGetNumSteps(arkode_mem, &nst);
check_retval(&retval, "ARKStepGetNumSteps", 1);
retval = ARKStepGetNumStepAttempts(arkode_mem, &nst_a);
check_retval(&retval, "ARKStepGetNumStepAttempts", 1);
retval = ARKodeGetNumSteps(arkode_mem, &nst);
check_retval(&retval, "ARKodeGetNumSteps", 1);
retval = ARKodeGetNumStepAttempts(arkode_mem, &nst_a);
check_retval(&retval, "ARKodeGetNumStepAttempts", 1);
retval = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi);
check_retval(&retval, "ARKStepGetNumRhsEvals", 1);
retval = ARKStepGetNumErrTestFails(arkode_mem, &netf);
check_retval(&retval, "ARKStepGetNumErrTestFails", 1);
retval = ARKStepGetNumNonlinSolvIters(arkode_mem, &nni);
check_retval(&retval, "ARKStepGetNumNonlinSolvIters", 1);
retval = ARKStepGetNumNonlinSolvConvFails(arkode_mem, &ncnf);
check_retval(&retval, "ARKStepGetNumNonlinSolvConvFails", 1);
retval = ARKodeGetNumErrTestFails(arkode_mem, &netf);
check_retval(&retval, "ARKodeGetNumErrTestFails", 1);
retval = ARKodeGetNumNonlinSolvIters(arkode_mem, &nni);
check_retval(&retval, "ARKodeGetNumNonlinSolvIters", 1);
retval = ARKodeGetNumNonlinSolvConvFails(arkode_mem, &ncnf);
check_retval(&retval, "ARKodeGetNumNonlinSolvConvFails", 1);
if (uopt->global)
{
retval = ARKStepGetNumLinIters(arkode_mem, &nli);
check_retval(&retval, "ARKStepGetNumLinIters", 1);
retval = ARKStepGetNumPrecSolves(arkode_mem, &npsol);
check_retval(&retval, "ARKStepGetNumPrecSolves", 1);
retval = ARKodeGetNumLinIters(arkode_mem, &nli);
check_retval(&retval, "ARKodeGetNumLinIters", 1);
retval = ARKodeGetNumPrecSolves(arkode_mem, &npsol);
check_retval(&retval, "ARKodeGetNumPrecSolves", 1);
}

/* Print final statistics */
Expand All @@ -366,7 +366,7 @@ int EvolveProblemIMEX(SUNContext ctx, N_Vector y, UserData* udata,
}

/* Clean up */
ARKStepFree(&arkode_mem);
ARKodeFree(&arkode_mem);
SUNNonlinSolFree(NLS);
if (LS) { SUNLinSolFree(LS); }

Expand All @@ -390,20 +390,20 @@ int EvolveProblemExplicit(SUNContext ctx, N_Vector y, UserData* udata,
if (check_retval((void*)arkode_mem, "ERKStepCreate", 0)) { return 1; }

/* Select the method order */
retval = ERKStepSetOrder(arkode_mem, uopt->order);
if (check_retval(&retval, "ERKStepSetOrder", 1)) { return 1; }
retval = ARKodeSetOrder(arkode_mem, uopt->order);
if (check_retval(&retval, "ARKodeSetOrder", 1)) { return 1; }

/* Attach user data */
retval = ERKStepSetUserData(arkode_mem, (void*)udata);
if (check_retval(&retval, "ERKStepSetUserData", 1)) { return 1; }
retval = ARKodeSetUserData(arkode_mem, (void*)udata);
if (check_retval(&retval, "ARKodeSetUserData", 1)) { return 1; }

/* Specify tolerances */
retval = ERKStepSStolerances(arkode_mem, uopt->rtol, uopt->atol);
if (check_retval(&retval, "ERKStepSStolerances", 1)) { return 1; }
retval = ARKodeSStolerances(arkode_mem, uopt->rtol, uopt->atol);
if (check_retval(&retval, "ARKodeSStolerances", 1)) { return 1; }

/* Increase the max number of steps allowed between outputs */
retval = ERKStepSetMaxNumSteps(arkode_mem, 1000000);
if (check_retval(&retval, "ERKStepSetMaxNumSteps", 1)) { return 1; }
retval = ARKodeSetMaxNumSteps(arkode_mem, 1000000);
if (check_retval(&retval, "ARKodeSetMaxNumSteps", 1)) { return 1; }

/* Output initial condition */
if (udata->myid == 0 && uopt->monitor)
Expand All @@ -422,8 +422,8 @@ int EvolveProblemExplicit(SUNContext ctx, N_Vector y, UserData* udata,

do {
/* Integrate to output time */
retval = ERKStepEvolve(arkode_mem, tout, y, &t, ARK_NORMAL);
if (check_retval(&retval, "ERKStepEvolve", 1)) { break; }
retval = ARKodeEvolve(arkode_mem, tout, y, &t, ARK_NORMAL);
if (check_retval(&retval, "ARKodeEvolve", 1)) { break; }

/* Output state */
WriteOutput(t, y, udata, uopt);
Expand All @@ -437,14 +437,14 @@ int EvolveProblemExplicit(SUNContext ctx, N_Vector y, UserData* udata,
while (iout < uopt->nout);

/* Get final statistics */
retval = ERKStepGetNumSteps(arkode_mem, &nst);
check_retval(&retval, "ERKStepGetNumSteps", 1);
retval = ERKStepGetNumStepAttempts(arkode_mem, &nst_a);
check_retval(&retval, "ERKStepGetNumStepAttempts", 1);
retval = ARKodeGetNumSteps(arkode_mem, &nst);
check_retval(&retval, "ARKodeGetNumSteps", 1);
retval = ARKodeGetNumStepAttempts(arkode_mem, &nst_a);
check_retval(&retval, "ARKodeGetNumStepAttempts", 1);
retval = ERKStepGetNumRhsEvals(arkode_mem, &nfe);
check_retval(&retval, "ERKStepGetNumRhsEvals", 1);
retval = ERKStepGetNumErrTestFails(arkode_mem, &netf);
check_retval(&retval, "ERKStepGetNumErrTestFails", 1);
retval = ARKodeGetNumErrTestFails(arkode_mem, &netf);
check_retval(&retval, "ARKodeGetNumErrTestFails", 1);

/* Print final statistics */
if (udata->myid == 0)
Expand All @@ -456,7 +456,7 @@ int EvolveProblemExplicit(SUNContext ctx, N_Vector y, UserData* udata,
}

/* Clean up */
ERKStepFree(&arkode_mem);
ARKodeFree(&arkode_mem);

/* Return success */
return (0);
Expand Down Expand Up @@ -911,9 +911,9 @@ int TaskLocalNlsResidual(N_Vector ycor, N_Vector F, void* arkode_mem)
double tcur, gamma;
void* user_data;

retval = ARKStepGetNonlinearSystemData(arkode_mem, &tcur, &zpred, &z, &Fi,
&gamma, &sdata, &user_data);
if (check_retval((void*)&retval, "ARKStepGetNonlinearSystemData", 1))
retval = ARKodeGetNonlinearSystemData(arkode_mem, &tcur, &zpred, &z, &Fi,
&gamma, &sdata, &user_data);
if (check_retval((void*)&retval, "ARKodeGetNonlinearSystemData", 1))
{
return (-1);
}
Expand Down Expand Up @@ -956,9 +956,9 @@ int TaskLocalLSolve(N_Vector delta, void* arkode_mem)
double tcur, gamma;
void* user_data = NULL;

retval = ARKStepGetNonlinearSystemData(arkode_mem, &tcur, &zpred, &z, &Fi,
&gamma, &sdata, &user_data);
if (check_retval((void*)&retval, "ARKStepGetNonlinearSystemData", 1))
retval = ARKodeGetNonlinearSystemData(arkode_mem, &tcur, &zpred, &z, &Fi,
&gamma, &sdata, &user_data);
if (check_retval((void*)&retval, "ARKodeGetNonlinearSystemData", 1))
{
return (-1);
}
Expand Down
Loading
Loading