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

Feature/remove deprecated code types #369

Merged
merged 101 commits into from
Nov 14, 2023
Merged
Show file tree
Hide file tree
Changes from 91 commits
Commits
Show all changes
101 commits
Select commit Hold shift + click to select a range
354e4cb
remove deprecated arkode code
balos1 Oct 26, 2023
4a3a323
remove direct and spils header files
balos1 Oct 26, 2023
c3c4b28
remove kinsol deprecated code
balos1 Oct 26, 2023
9a43a8a
more changes for the removal of spils and direct
balos1 Oct 26, 2023
511f7b9
remove more deprecated code
balos1 Oct 26, 2023
269c00a
realtype --> sunrealtype
balos1 Oct 26, 2023
7557be4
update sunrealtype related macros
balos1 Oct 26, 2023
42bf5a4
add old types into a different header for backwards compatibility
balos1 Oct 26, 2023
f51efc4
booleantype --> sunbooleantype
balos1 Oct 26, 2023
c9de095
changelog note
balos1 Oct 26, 2023
08a4a43
fix redefinition
balos1 Oct 26, 2023
c9db3f5
regen swig
balos1 Oct 26, 2023
e70954d
update swig
balos1 Oct 26, 2023
ec557bc
Merge branch 'develop' into feature/remove-deprecated-code
balos1 Oct 27, 2023
bde3811
Apply suggestions from code review
balos1 Oct 27, 2023
f96e164
Feature: Fortran interface for lapack dense solver (#353)
balos1 Oct 27, 2023
a212472
Feature/new tables (#359)
drreynolds Oct 28, 2023
b548855
remove implementation of SUNLinsSol and SUNNonlinSol printinfo functions
balos1 Oct 30, 2023
e252417
replace use of SetDiagnostics in some arkode examples
balos1 Oct 31, 2023
9939d98
make INFO level the default for logging
balos1 Oct 31, 2023
28e931e
change arkode INFO logging to DEBUG
balos1 Nov 2, 2023
37b4948
add debugging filename
balos1 Nov 2, 2023
ba66c1e
clean up use of removed functions
balos1 Nov 3, 2023
f555583
Merge remote-tracking branch 'origin/develop' into feature/remove-dep…
balos1 Nov 3, 2023
7a6347e
Merge branch 'feature/remove-deprecated-code' into feature/remove-dep…
balos1 Nov 3, 2023
d445aa5
remove deprecated arkode code
balos1 Oct 26, 2023
e57f71c
remove direct and spils header files
balos1 Oct 26, 2023
106901b
remove kinsol deprecated code
balos1 Oct 26, 2023
5934bf2
more changes for the removal of spils and direct
balos1 Oct 26, 2023
7091261
remove more deprecated code
balos1 Oct 26, 2023
0388073
update swig
balos1 Oct 26, 2023
b77a568
Apply suggestions from code review
balos1 Oct 27, 2023
bce63fb
Feature: Fortran interface for lapack dense solver (#353)
balos1 Oct 27, 2023
1c76c85
remove implementation of SUNLinsSol and SUNNonlinSol printinfo functions
balos1 Oct 30, 2023
841a6d9
replace use of SetDiagnostics in some arkode examples
balos1 Oct 31, 2023
5179287
make INFO level the default for logging
balos1 Oct 31, 2023
196c32a
change arkode INFO logging to DEBUG
balos1 Nov 2, 2023
e47a8c3
add debugging filename
balos1 Nov 2, 2023
32501fa
clean up use of removed functions
balos1 Nov 3, 2023
3ebc682
clean removed functions in benchmarks
balos1 Nov 3, 2023
1652153
remove _spils and _direct references
balos1 Nov 3, 2023
3841cd5
remove cpodes script
balos1 Nov 3, 2023
b816971
cleanup use of removed PREC_ macro
balos1 Nov 3, 2023
3cd7a85
remove unused flag
balos1 Nov 5, 2023
454203a
Merge branch 'feature/remove-deprecated-code' into feature/remove-dep…
balos1 Nov 5, 2023
7764a5b
regen fortran
balos1 Nov 5, 2023
22c9bf3
clean up more use of Diagnostics
balos1 Nov 5, 2023
1af246d
Merge branch 'feature/remove-deprecated-code' into feature/remove-dep…
balos1 Nov 5, 2023
31d3115
remove sundials_lapack.h from install list
balos1 Nov 6, 2023
1212aea
Merge branch 'feature/remove-deprecated-code' into feature/remove-dep…
balos1 Nov 6, 2023
a10585b
use SUN_RCONST
balos1 Nov 6, 2023
2b39a12
remove KINSetInfofile
balos1 Nov 6, 2023
7f6f328
Merge branch 'develop' into feature/remove-deprecated-code
balos1 Nov 6, 2023
1cbfa1f
remove warnings to stdout
balos1 Nov 6, 2023
447eafa
Merge remote-tracking branch 'origin/develop' into feature/remove-dep…
balos1 Nov 7, 2023
5806bc6
Merge branch 'feature/remove-deprecated-code' into feature/remove-dep…
balos1 Nov 7, 2023
752c350
update action to sunrealtype
balos1 Nov 7, 2023
d202111
remove DFID
balos1 Nov 7, 2023
f16bc3c
remove KINInfoHandler
balos1 Nov 7, 2023
820a6f6
Merge remote-tracking branch 'origin/develop' into feature/remove-dep…
balos1 Nov 8, 2023
afbc36f
remove unused variable
balos1 Nov 8, 2023
a2be7dc
Merge branch 'develop' into feature/remove-deprecated-code
balos1 Nov 9, 2023
83f2c7c
remove unused variables
balos1 Nov 9, 2023
6fcb7cb
Update examples/arkode/CXX_xbraid/ark_heat2D_hypre_pfmg_xbraid.cpp
balos1 Nov 9, 2023
4cff0ae
remove delted functions from soruce
balos1 Nov 10, 2023
b601820
remove unused kinsol parts
balos1 Nov 10, 2023
9690f3d
remove use of printfl
balos1 Nov 10, 2023
4a8ad53
change default logging level
balos1 Nov 10, 2023
dbf7f3f
remove more unused stuff in arkode
balos1 Nov 10, 2023
89dcad3
remove uses of ark_mem->report
balos1 Nov 10, 2023
a0502e3
build with different logging levels and profiling on/off
balos1 Nov 10, 2023
4e38f35
remove broken line
balos1 Nov 10, 2023
90b0924
rename GitHub actions CI jobs
balos1 Nov 10, 2023
6e17a61
update log levels cycles through
balos1 Nov 10, 2023
1ef6287
dont automatically include sundials_context.hpp
balos1 Nov 10, 2023
c125409
add recent changes
balos1 Nov 10, 2023
aede7e5
fix indentation
balos1 Nov 10, 2023
4d3ed8f
undo removal of include
balos1 Nov 10, 2023
5224893
dont fail fast
balos1 Nov 10, 2023
3d4661d
fix logging statements in arkode_adapt broken in merge
balos1 Nov 11, 2023
40f5135
fix compiler warning
balos1 Nov 11, 2023
97a3fbd
Merge branch 'feature/remove-deprecated-code' into feature/remove-dep…
balos1 Nov 11, 2023
07f73cc
post merge fixes
balos1 Nov 11, 2023
2f3773b
post-merge fix: change RCONST to SUN_RCONST
balos1 Nov 11, 2023
004191f
another spot where we need to supress warning of set but unused
balos1 Nov 11, 2023
075105f
Merge branch 'feature/remove-deprecated-code' into feature/remove-dep…
balos1 Nov 11, 2023
765e947
regen fortran
balos1 Nov 11, 2023
8dd9c82
Merge remote-tracking branch 'origin/develop' into feature/remove-dep…
balos1 Nov 12, 2023
52efca3
Merge branch 'feature/remove-deprecated-code' into feature/remove-dep…
balos1 Nov 12, 2023
4228b22
Merge remote-tracking branch 'origin/develop' into feature/remove-dep…
balos1 Nov 13, 2023
b7468ef
fix doc build
gardner48 Nov 14, 2023
93132b1
Update CHANGELOG.md
balos1 Nov 14, 2023
b59256e
rename sundials_types_old
balos1 Nov 14, 2023
50a90ed
update recent changes
balos1 Nov 14, 2023
bcfc49a
fix tables
gardner48 Nov 14, 2023
28043ea
fix typo
gardner48 Nov 14, 2023
edb4bb0
install sundials_types_deprecated.h
gardner48 Nov 14, 2023
2b16b8c
Apply suggestions for READMEs
balos1 Nov 14, 2023
a779c70
Apply suggestions from code review
balos1 Nov 14, 2023
7baeafe
Update doc/shared/sunmatrix/SUNMatrix_SLUNRloc.rst
balos1 Nov 14, 2023
4e891f7
Update doc/shared/nvectors/NVector_SYCL.rst
balos1 Nov 14, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .github/actions/test-driver/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ runs:
run: |
git config --global --add safe.directory $GITHUB_WORKSPACE
cd test
./test_driver.sh --testtype CUSTOM --env env/docker.sh --tpls --realtype ${{ inputs.precision }} --indexsize ${{ inputs.indexsize }}
./test_driver.sh --testtype CUSTOM --env env/docker.sh --tpls --sunrealtype ${{ inputs.precision }} --indexsize ${{ inputs.indexsize }}
shell: bash
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# SUNDIALS Changelog

## Changes to SUNDIALS in release 7.0.0

The previously deprecated types `realtype` and `booleantype` were removed from `sundials_types.h`.
Users should use `sunrealtype` and `sunbooleantype` instead, but the old names for the types
can be used by including the header file `sundials_types_old.h`.
balos1 marked this conversation as resolved.
Show resolved Hide resolved


## Changes to SUNDIALS in release X.X.X

Expand Down
48 changes: 24 additions & 24 deletions benchmarks/advection_reaction_3D/kokkos/ParallelGrid.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ using MemSpace = Kokkos::HostSpace;
using ExecSpace = Kokkos::Serial;
using MemSpace = Kokkos::HostSpace;
#endif
using Vec1D = Kokkos::View<realtype*, MemSpace>;
using Vec4D = Kokkos::View<realtype****, MemSpace>;
using Vec1D = Kokkos::View<sunrealtype*, MemSpace>;
using Vec4D = Kokkos::View<sunrealtype****, MemSpace>;
using Vec1DHost = Vec1D::HostMirror;
using Vec4DHost = Vec4D::HostMirror;
using Range3D = Kokkos::MDRangePolicy<ExecSpace, Kokkos::Rank<3>>;
Expand Down Expand Up @@ -84,8 +84,8 @@ class ParallelGrid
// [in] st - the stencil to use (see StencilType)
// [in] npxyz - the number of processors in each dimension; defaults to 0 which means MPI will choose
// [in] reorder - should MPI_Cart_create do process reordering to optimize or not; defaults to false (some MPI implementations ignore this)
ParallelGrid(MPI_Comm* comm, const realtype a[], const realtype b[], const GLOBALINT npts[],
int dof, BoundaryType bc, StencilType st, const realtype c,
ParallelGrid(MPI_Comm* comm, const sunrealtype a[], const sunrealtype b[], const GLOBALINT npts[],
int dof, BoundaryType bc, StencilType st, const sunrealtype c,
const int npxyz[] = nullptr, bool reorder = false)
: nx(1), ny(1), nz(1),
nxl(1), nyl(1), nzl(1),
Expand Down Expand Up @@ -130,7 +130,7 @@ class ParallelGrid
nx = npts[0];
ax = a[0];
bx = b[0];
dx = (bx-ax) / (realtype) nx;
dx = (bx-ax) / (sunrealtype) nx;
int is = nx*(coords[0])/npx;
int ie = nx*(coords[0]+1)/npx-1;
nxl = ie-is+1;
Expand All @@ -141,7 +141,7 @@ class ParallelGrid
ny = npts[1];
ay = a[1];
by = b[1];
dy = (by-ay) / (realtype) ny;
dy = (by-ay) / (sunrealtype) ny;
int js = ny*(coords[1])/npy;
int je = ny*(coords[1]+1)/npy-1;
nyl = je-js+1;
Expand All @@ -152,7 +152,7 @@ class ParallelGrid
nz = npts[2];
az = a[2];
bz = b[2];
dz = (bz-az) / (realtype) nz;
dz = (bz-az) / (sunrealtype) nz;
int ks = nz*(coords[2])/npz;
int ke = nz*(coords[2]+1)/npz-1;
nzl = ke-ks+1;
Expand Down Expand Up @@ -469,31 +469,31 @@ class ParallelGrid
return dof*nptsl();
}

realtype* GetRecvView(const std::string& direction)
sunrealtype* GetRecvView(const std::string& direction)
{
if (direction == "WEST")
{
return static_cast<realtype*>(Wrecv_.data());
return static_cast<sunrealtype*>(Wrecv_.data());
}
else if (direction == "EAST")
{
return static_cast<realtype*>(Erecv_.data());
return static_cast<sunrealtype*>(Erecv_.data());
}
else if (direction == "NORTH")
{
return static_cast<realtype*>(Nrecv_.data());
return static_cast<sunrealtype*>(Nrecv_.data());
}
else if (direction == "SOUTH")
{
return static_cast<realtype*>(Srecv_.data());
return static_cast<sunrealtype*>(Srecv_.data());
}
else if (direction == "FRONT")
{
return static_cast<realtype*>(Frecv_.data());
return static_cast<sunrealtype*>(Frecv_.data());
}
else if (direction == "BACK")
{
return static_cast<realtype*>(Brecv_.data());
return static_cast<sunrealtype*>(Brecv_.data());
}
else
{
Expand All @@ -502,31 +502,31 @@ class ParallelGrid
}
}

realtype* GetSendView(const std::string& direction)
sunrealtype* GetSendView(const std::string& direction)
{
if (direction == "WEST")
{
return static_cast<realtype*>(Wsend_.data());
return static_cast<sunrealtype*>(Wsend_.data());
}
else if (direction == "EAST")
{
return static_cast<realtype*>(Esend_.data());
return static_cast<sunrealtype*>(Esend_.data());
}
else if (direction == "NORTH")
{
return static_cast<realtype*>(Nsend_.data());
return static_cast<sunrealtype*>(Nsend_.data());
}
else if (direction == "SOUTH")
{
return static_cast<realtype*>(Ssend_.data());
return static_cast<sunrealtype*>(Ssend_.data());
}
else if (direction == "FRONT")
{
return static_cast<realtype*>(Fsend_.data());
return static_cast<sunrealtype*>(Fsend_.data());
}
else if (direction == "BACK")
{
return static_cast<realtype*>(Bsend_.data());
return static_cast<sunrealtype*>(Bsend_.data());
}
else
{
Expand All @@ -538,9 +538,9 @@ class ParallelGrid
GLOBALINT nx, ny, nz; /* number of intervals globally */
int nxl, nyl, nzl; /* number of intervals locally */
int npx, npy, npz; /* numner of processes */
realtype dx, dy, dz; /* mesh spacing */
realtype ax, ay, az; /* domain in [a, b] */
realtype bx, by, bz;
sunrealtype dx, dy, dz; /* mesh spacing */
sunrealtype ax, ay, az; /* domain in [a, b] */
sunrealtype bx, by, bz;
int dof; /* degrees of freedom per node */
int neq; /* total number of equations locally */

Expand Down
14 changes: 7 additions & 7 deletions benchmarks/advection_reaction_3D/kokkos/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,19 +60,19 @@ listed below.
| `--nout <int>` | Number of output times | 40 |
| `--npts <int>` | Number of mesh points in each direction | 100 |
| `--npxyz <int> <int> <int>` | Number of MPI tasks in each direction (0 forces MPI to decide) | 0 0 0 |
| `--xmax <realtype>` | Maximum value of `x`, `y`, and `z` in :math:`X_max` | 1.0 |
| `--A <realtype>` | Constant concentration of species `A` | 1.0 |
| `--B <realtype>` | Constant concentration of species `B` | 3.5 |
| `--c <realtype>` | Advection speed `c` | 0.01 |
| `--xmax <sunrealtype>` | Maximum value of `x`, `y`, and `z` in :math:`X_max` | 1.0 |
| `--A <sunrealtype>` | Constant concentration of species `A` | 1.0 |
| `--B <sunrealtype>` | Constant concentration of species `B` | 3.5 |
| `--c <sunrealtype>` | Advection speed `c` | 0.01 |
balos1 marked this conversation as resolved.
Show resolved Hide resolved
| `--order <int>` | Integration method order | 3 |
| `--method <method>` | Integrator to use: `ERK`, `ARK-DIRK`, `ARK-IMEX`, `CV-BDF`, `CV-ADAMS`, `IDA` | `ARK-DIRK` |
| `--nls <method>` | Nonlinear Solver Method: `newton`, `tl-newton`, `fixedpoint`, `none` | `newton` |
| `--fpaccel <int>` | Number of fixed point acceleration vectors | 3 |
| `--nopre` | Disable preconditioning | False |
| `--fused` | Enabled fused operations | Off |
| `--tf <realtype>` | Final integration time `t_f` | 10.0 |
| `--rtol <realtype>` | Relative tolerance | 1.0e-6 |
| `--atol <realtype>` | Absolute tolerance | 1.0e-9 |
| `--tf <sunrealtype>` | Final integration time `t_f` | 10.0 |
| `--rtol <sunrealtype>` | Relative tolerance | 1.0e-6 |
| `--atol <sunrealtype>` | Absolute tolerance | 1.0e-9 |
balos1 marked this conversation as resolved.
Show resolved Hide resolved

## Building and Running

Expand Down
92 changes: 46 additions & 46 deletions benchmarks/advection_reaction_3D/kokkos/advection_reaction_3D.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,14 @@
* --nopre turn off preconditioning
* --order <int> the method order to use
* --npts <int> number of mesh points in each direction
* --xmax <realtype> maximum value of x (size of domain)
* --tf <realtype> final time
* --A <realtype> A parameter value
* --B <realtype> B parameter value
* --k <realtype> reaction rate
* --c <realtype> advection speed
* --rtol <realtype> relative tolerance
* --atol <realtype> absolute tolerance
* --xmax <sunrealtype> maximum value of x (size of domain)
* --tf <sunrealtype> final time
* --A <sunrealtype> A parameter value
* --B <sunrealtype> B parameter value
* --k <sunrealtype> reaction rate
* --c <sunrealtype> advection speed
* --rtol <sunrealtype> relative tolerance
* --atol <sunrealtype> absolute tolerance
* --------------------------------------------------------------------------*/

#include "advection_reaction_3D.hpp"
Expand Down Expand Up @@ -167,7 +167,7 @@ int FillSendBuffers(N_Vector y, UserData* udata)
{

/* Shortcuts */
const realtype c = udata->c;
const sunrealtype c = udata->c;
const int nxl = udata->grid->nxl;
const int nyl = udata->grid->nyl;
const int nzl = udata->grid->nzl;
Expand Down Expand Up @@ -468,8 +468,8 @@ int SetupProblem(int argc, char *argv[], UserData* udata, UserOptions* uopt,

/* Setup the parallel decomposition */
const sunindextype npts[] = {uopt->npts, uopt->npts, uopt->npts};
const realtype amax[] = {0.0, 0.0, 0.0};
const realtype bmax[] = {udata->xmax, udata->xmax, udata->xmax};
const sunrealtype amax[] = {0.0, 0.0, 0.0};
const sunrealtype bmax[] = {udata->xmax, udata->xmax, udata->xmax};
udata->grid = new ParallelGrid<sunindextype>(&udata->comm, amax, bmax, npts,
3, BoundaryType::PERIODIC, StencilType::UPWIND, udata->c, uopt->npxyz);

Expand Down Expand Up @@ -551,15 +551,15 @@ int SetupProblem(int argc, char *argv[], UserData* udata, UserOptions* uopt,

/* Compute the 3D Gaussian function. */
KOKKOS_FUNCTION
void Gaussian3D(realtype& x, realtype& y, realtype& z, realtype xmax)
void Gaussian3D(sunrealtype& x, sunrealtype& y, sunrealtype& z, sunrealtype xmax)
{
/* Gaussian distribution defaults */
const realtype alpha = 0.1;
const realtype mu[] = { xmax/RCONST(2.0), xmax/RCONST(2.0), xmax/RCONST(2.0) };
const realtype sigma[] = { xmax/RCONST(4.0), xmax/RCONST(4.0), xmax/RCONST(4.0) }; // Sigma = diag(sigma)
const sunrealtype alpha = 0.1;
const sunrealtype mu[] = { xmax/SUN_RCONST(2.0), xmax/SUN_RCONST(2.0), xmax/SUN_RCONST(2.0) };
const sunrealtype sigma[] = { xmax/SUN_RCONST(4.0), xmax/SUN_RCONST(4.0), xmax/SUN_RCONST(4.0) }; // Sigma = diag(sigma)

/* denominator = 2*sqrt(|Sigma|*(2pi)^3) */
const realtype denom = 2.0 * sqrt((sigma[0]*sigma[1]*sigma[2])*pow(2*M_PI,3));
const sunrealtype denom = 2.0 * sqrt((sigma[0]*sigma[1]*sigma[2])*pow(2*M_PI,3));
x = alpha * exp( -((x - mu[0])*(x - mu[0])*(1.0/sigma[0])) / denom );
y = alpha * exp( -((y - mu[1])*(y - mu[1])*(1.0/sigma[1])) / denom );
z = alpha * exp( -((z - mu[2])*(z - mu[2])*(1.0/sigma[2])) / denom );
Expand All @@ -576,24 +576,24 @@ int SetIC(N_Vector y, UserData* udata)
const int nyl = udata->grid->nyl;
const int nzl = udata->grid->nzl;
const int dof = udata->grid->dof;
const realtype dx = udata->grid->dx;
const realtype dy = udata->grid->dy;
const realtype dz = udata->grid->dz;
const realtype xmax = udata->xmax;
const realtype A = udata->A;
const realtype B = udata->B;
const realtype k1 = udata->k1;
const realtype k2 = udata->k2;
const realtype k3 = udata->k3;
const realtype k4 = udata->k4;
const sunrealtype dx = udata->grid->dx;
const sunrealtype dy = udata->grid->dy;
const sunrealtype dz = udata->grid->dz;
const sunrealtype xmax = udata->xmax;
const sunrealtype A = udata->A;
const sunrealtype B = udata->B;
const sunrealtype k1 = udata->k1;
const sunrealtype k2 = udata->k2;
const sunrealtype k3 = udata->k3;
const sunrealtype k4 = udata->k4;
const int xcrd = udata->grid->coords[0];
const int ycrd = udata->grid->coords[1];
const int zcrd = udata->grid->coords[2];

/* Steady state solution */
const realtype us = k1 * A / k4;
const realtype vs = k2 * k4 * B / (k1 * k3 * A);
const realtype ws = 3.0;
const sunrealtype us = k1 * A / k4;
const sunrealtype vs = k2 * k4 * B / (k1 * k3 * A);
const sunrealtype ws = 3.0;

/* Create 4D view of y */
Vec4D yview(N_VGetDeviceArrayPointer(N_VGetLocalVector_MPIPlusX(y)), nxl, nyl, nzl, dof);
Expand All @@ -603,11 +603,11 @@ int SetIC(N_Vector y, UserData* udata)
Range3D({0,0,0},{nxl,nyl,nzl}),
KOKKOS_LAMBDA (int i, int j, int k)
{
realtype x = (xcrd * nxl + i) * dx;
realtype y = (ycrd * nyl + j) * dy;
realtype z = (zcrd * nzl + k) * dz;
sunrealtype x = (xcrd * nxl + i) * dx;
sunrealtype y = (ycrd * nyl + j) * dy;
sunrealtype z = (zcrd * nzl + k) * dz;
Gaussian3D(x,y,z,xmax);
const realtype p = x + y + z;
const sunrealtype p = x + y + z;
yview(i,j,k,0) = us + p;
yview(i,j,k,1) = vs + p;
yview(i,j,k,2) = ws + p;
Expand All @@ -619,17 +619,17 @@ int SetIC(N_Vector y, UserData* udata)


/* Write time and solution to disk */
int WriteOutput(realtype t, N_Vector y, UserData* udata, UserOptions* uopt)
int WriteOutput(sunrealtype t, N_Vector y, UserData* udata, UserOptions* uopt)
{
SUNDIALS_CXX_MARK_FUNCTION(udata->prof);

/* output current solution norm to screen */
realtype N = (realtype) udata->grid->npts();
realtype u = N_VWL2Norm(y, udata->umask);
sunrealtype N = (sunrealtype) udata->grid->npts();
sunrealtype u = N_VWL2Norm(y, udata->umask);
u = sqrt(u*u/N);
realtype v = N_VWL2Norm(y, udata->vmask);
sunrealtype v = N_VWL2Norm(y, udata->vmask);
v = sqrt(v*v/N);
realtype w = N_VWL2Norm(y, udata->wmask);
sunrealtype w = N_VWL2Norm(y, udata->wmask);
w = sqrt(w*w/N);
if (udata->myid == 0) {
printf(" %10.6f %10.6f %10.6f %10.6f\n", t, u, v, w);
Expand Down Expand Up @@ -697,14 +697,14 @@ void InputError(char *name)
fprintf(stderr, " --order <int> the method order to use\n");
fprintf(stderr, " --npts <int> number of mesh points in each direction\n");
fprintf(stderr, " --npxyz <int> <int> <int> number of processors in each direction (0 forces MPI to decide)\n");
fprintf(stderr, " --xmax <realtype> maximum value of x (size of domain)\n");
fprintf(stderr, " --tf <realtype> final time\n");
fprintf(stderr, " --A <realtype> A parameter value\n");
fprintf(stderr, " --B <realtype> B parameter value\n");
fprintf(stderr, " --k <realtype> reaction rate\n");
fprintf(stderr, " --c <realtype> advection speed\n");
fprintf(stderr, " --rtol <realtype> relative tolerance\n");
fprintf(stderr, " --atol <realtype> absolute tolerance\n");
fprintf(stderr, " --xmax <sunrealtype> maximum value of x (size of domain)\n");
fprintf(stderr, " --tf <sunrealtype> final time\n");
fprintf(stderr, " --A <sunrealtype> A parameter value\n");
fprintf(stderr, " --B <sunrealtype> B parameter value\n");
fprintf(stderr, " --k <sunrealtype> reaction rate\n");
fprintf(stderr, " --c <sunrealtype> advection speed\n");
fprintf(stderr, " --rtol <sunrealtype> relative tolerance\n");
fprintf(stderr, " --atol <sunrealtype> absolute tolerance\n");
}

MPI_Barrier(MPI_COMM_WORLD);
Expand Down
30 changes: 15 additions & 15 deletions benchmarks/advection_reaction_3D/kokkos/advection_reaction_3D.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ struct UserOptions
{
int npxyz[3]; /* number of processors in x,y,z */
sunindextype npts; /* number of spatial mesh points */
realtype t0; /* initial time */
realtype tf; /* final time */
realtype rtol; /* relative tolerance */
realtype atol; /* absolute tolerance */
sunrealtype t0; /* initial time */
sunrealtype tf; /* final time */
sunrealtype rtol; /* relative tolerance */
sunrealtype atol; /* absolute tolerance */
int order; /* method order */
string method; /* method string */
string nls; /* nonlinear solver to use */
Expand Down Expand Up @@ -93,16 +93,16 @@ struct UserData
N_Vector wmask;

/* Problem parameters */
realtype xmax; /* maximum x value */
realtype A; /* concentration of species A */
realtype B; /* w source rate */
realtype k1; /* reaction rates */
realtype k2;
realtype k3;
realtype k4;
realtype k5;
realtype k6;
realtype c; /* advection coefficient */
sunrealtype xmax; /* maximum x value */
sunrealtype A; /* concentration of species A */
sunrealtype B; /* w source rate */
sunrealtype k1; /* reaction rates */
sunrealtype k2;
sunrealtype k3;
sunrealtype k4;
sunrealtype k5;
sunrealtype k6;
sunrealtype c; /* advection coefficient */

/* Parallel mesh */
ParallelGrid<sunindextype>* grid;
Expand Down Expand Up @@ -166,6 +166,6 @@ void InputError(char *name);
int ComponentMask(N_Vector mask, const int component, const UserData* udata);

/* function to write solution to disk */
int WriteOutput(realtype t, N_Vector y, UserData* udata, UserOptions* uopt);
int WriteOutput(sunrealtype t, N_Vector y, UserData* udata, UserOptions* uopt);

#endif
Loading
Loading