Skip to content

Commit

Permalink
try using spack to install llvm
Browse files Browse the repository at this point in the history
  • Loading branch information
balos1 committed Nov 15, 2023
1 parent 2cd66c5 commit 475e727
Show file tree
Hide file tree
Showing 152 changed files with 735 additions and 680 deletions.
17 changes: 13 additions & 4 deletions .github/workflows/clang-format-compliance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,19 @@ jobs:
clang_format_check:
runs-on: ubuntu-latest
steps:
- run: sudo apt-get -yqq update && sudo apt-get -yqq install --no-install-recommends gnupg2 software-properties-common wget
- run: wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
- run: sudo add-apt-repository 'deb http://apt.llvm.org/focal/ llvm-toolchain-focal-17 main'
- run: sudo apt-get -yqq update && sudo apt-get -yqq install clang-format-17
# - run: sudo apt-get -yqq update && sudo apt-get -yqq install --no-install-recommends gnupg2 software-properties-common wget
# - run: wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
# - run: sudo add-apt-repository 'deb http://apt.llvm.org/focal/ llvm-toolchain-focal-17 main'
# - run: sudo apt-get -yqq update && sudo apt-get -yqq install clang-format-17
- name: Check out Spack
uses: actions/checkout@v4
with:
repository: spack/spack
ref: v0.21.0
- name: Setup Spack Binary Cache
run: spack mirror add --oci-username ${{ github.actor }} --oci-password ${{ secrets.OCI_TOKEN }} sundials_spack_cache oci://ghcr.io/LLNL/sundials_spack_cache
- name: Spack install [email protected]
run: spack install [email protected] && spack buildache push sundials_spack_cache llvm
- name: Check out repository code
uses: actions/checkout@v4
- name: Run checker on code
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/advection_reaction_3D/kokkos/arkode_driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ typedef struct
long int ncnf;
MPI_Comm comm;
SUNNonlinearSolver local_nls;
}* TaskLocalNewton_Content;
} * TaskLocalNewton_Content;

/* Content accessor macors */
#define GET_NLS_CONTENT(NLS) ((TaskLocalNewton_Content)(NLS->content))
Expand Down
4 changes: 2 additions & 2 deletions benchmarks/advection_reaction_3D/kokkos/rhs3D.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ static int SolveReactionLinSys(N_Vector y, N_Vector x, N_Vector b,
Bview(i, j, k, 1) * (A0 * A8 - scratch_9) +
A5 * scratch_8 - A8 * scratch_10);
Xview(i, j, k,
2) = (-Bview(i, j, k, 2) + scratch_11 * scratch_8 +
2) = (-Bview(i, j, k, 2) + scratch_11 * scratch_8 +
scratch_13 * (Bview(i, j, k, 1) - scratch_10 * scratch_11)) /
(-A8 + scratch_11 * scratch_9 +
scratch_13 * (A5 - scratch_11 * scratch_7));
Expand Down Expand Up @@ -505,7 +505,7 @@ static int SolveReactionLinSysRes(N_Vector y, N_Vector x, N_Vector b,
Bview(i, j, k, 1) * (A0 * A8 - scratch_9) +
A5 * scratch_8 - A8 * scratch_10);
Xview(i, j, k,
2) = (-Bview(i, j, k, 2) + scratch_11 * scratch_8 +
2) = (-Bview(i, j, k, 2) + scratch_11 * scratch_8 +
scratch_13 * (Bview(i, j, k, 1) - scratch_10 * scratch_11)) /
(-A8 + scratch_11 * scratch_9 +
scratch_13 * (A5 - scratch_11 * scratch_7));
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/advection_reaction_3D/raja/arkode_driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ typedef struct
long int ncnf;
MPI_Comm comm;
SUNNonlinearSolver local_nls;
}* TaskLocalNewton_Content;
} * TaskLocalNewton_Content;

/* Content accessor macors */
#define GET_NLS_CONTENT(NLS) ((TaskLocalNewton_Content)(NLS->content))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ typedef struct
sunrealtype ep; /* stiffness parameter */
N_Vector tmp; /* temporary vector */
SUNMatrix R; /* temporary storage */
}* UserData;
} * UserData;

/* User-supplied Functions Called by the Solver */
static int f(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data);
Expand Down
2 changes: 1 addition & 1 deletion examples/arkode/C_manyvector/ark_brusselator1D_manyvec.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ typedef struct
sunrealtype dv; /* diffusion coeff for v */
sunrealtype dw; /* diffusion coeff for w */
sunrealtype ep; /* stiffness parameter */
}* UserData;
} * UserData;

/* User-supplied Functions Called by the Solver */
static int fe(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data);
Expand Down
6 changes: 3 additions & 3 deletions examples/arkode/C_openmp/ark_brusselator1D_omp.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ typedef struct
sunrealtype dv; /* diffusion coeff for v */
sunrealtype dw; /* diffusion coeff for w */
sunrealtype ep; /* stiffness parameter */
}* UserData;
} * UserData;

/* User-supplied Functions Called by the Solver */
static int f(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data);
Expand Down Expand Up @@ -120,7 +120,7 @@ int main(int argc, char* argv[])

/* general problem variables */
int flag; /* reusable error-checking flag */
N_Vector y = NULL; /* empty vector for storing solution */
N_Vector y = NULL; /* empty vector for storing solution */
N_Vector umask = NULL; /* empty mask vectors for viewing solution components */
N_Vector vmask = NULL;
N_Vector wmask = NULL;
Expand Down Expand Up @@ -391,7 +391,7 @@ static int f(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data)
vconst = dv / dx / dx;
wconst = dw / dx / dx;
#pragma omp parallel for default(shared) private(i, u, ul, ur, v, vl, vr, w, \
wl, wr) schedule(static) \
wl, wr) schedule(static) \
num_threads(udata->nthreads)
for (i = 1; i < N - 1; i++)
{
Expand Down
2 changes: 1 addition & 1 deletion examples/arkode/C_openmp/ark_heat1D_omp.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ typedef struct
int nthreads; /* number of OpenMP threads */
sunrealtype dx; /* mesh spacing */
sunrealtype k; /* diffusion coefficient */
}* UserData;
} * UserData;

/* User-supplied Functions Called by the Solver */
static int f(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data);
Expand Down
6 changes: 3 additions & 3 deletions examples/arkode/C_openmpdev/ark_heat1D_adapt_ompdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ typedef struct
sunrealtype* x_dev; /* current mesh on device */
sunrealtype k; /* diffusion coefficient */
sunrealtype refine_tol; /* adaptivity tolerance */
}* UserData;
} * UserData;

/* User-supplied Functions Called by the Solver */
static int f(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data);
Expand Down Expand Up @@ -554,8 +554,8 @@ static int project(sunindextype Nold, sunrealtype* xold, N_Vector yold,
/* loop over new mesh, finding corresponding interval within old mesh,
and perform piecewise linear interpolation from yold to ynew */
iv = 0;
#pragma omp target map(to : iv) is_device_ptr(Yold, Ynew, xnew, xold) \
device(dev)
#pragma omp target map(to \
: iv) is_device_ptr(Yold, Ynew, xnew, xold) device(dev)
#pragma omp teams distribute parallel for schedule(static, 1)
{
for (i = 0; i < Nnew; i++)
Expand Down
5 changes: 3 additions & 2 deletions examples/arkode/C_openmpdev/ark_heat1D_ompdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ typedef struct
sunindextype N; /* number of intervals */
sunrealtype dx; /* mesh spacing */
sunrealtype k; /* diffusion coefficient */
}* UserData;
} * UserData;

/* User-supplied Functions Called by the Solver */
static int f(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data);
Expand Down Expand Up @@ -285,7 +285,8 @@ static int f(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data)
c2 = -SUN_RCONST(2.0) * k / dx / dx;
isource = N / 2;

#pragma omp target map(to : c1, c2, isource, N, dx) is_device_ptr(Ydot, Y) \
#pragma omp target map(to \
: c1, c2, isource, N, dx) is_device_ptr(Ydot, Y) \
device(dev)
#pragma omp teams distribute parallel for schedule(static, 1)
for (i = 1; i < N - 1; i++)
Expand Down
6 changes: 3 additions & 3 deletions examples/arkode/C_parallel/ark_brusselator1D_task_local_nls.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ typedef struct
FILE* VFID;
FILE* WFID;
char* outputdir;
}* UserOptions;
} * UserOptions;

/*
* User data structure
Expand Down Expand Up @@ -160,7 +160,7 @@ typedef struct

/* integrator options */
UserOptions uopt;
}* UserData;
} * UserData;

/*
* Definitions for a custom task local SUNNonlinearSolver
Expand All @@ -173,7 +173,7 @@ typedef struct
long int ncnf;
MPI_Comm comm;
SUNNonlinearSolver local_nls;
}* TaskLocalNewton_Content;
} * TaskLocalNewton_Content;

/* Content accessor macors */
#define GET_NLS_CONTENT(NLS) ((TaskLocalNewton_Content)(NLS->content))
Expand Down
2 changes: 1 addition & 1 deletion examples/arkode/C_parallel/ark_diurnal_kry_bbd_p.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ typedef struct
int my_pe, isubx, isuby;
sunindextype nvmxsub, nvmxsub2, Nlocal;
MPI_Comm comm;
}* UserData;
} * UserData;

/* Prototypes of private helper functions */
static void InitUserData(int my_pe, sunindextype local_N, MPI_Comm comm,
Expand Down
2 changes: 1 addition & 1 deletion examples/arkode/C_parallel/ark_diurnal_kry_p.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ typedef struct
sunrealtype **P[MXSUB][MYSUB], **Jbd[MXSUB][MYSUB];
sunindextype* pivot[MXSUB][MYSUB];

}* UserData;
} * UserData;

/* Private Helper Functions */
static void InitUserData(int my_pe, MPI_Comm comm, UserData data);
Expand Down
2 changes: 1 addition & 1 deletion examples/arkode/C_parhyp/ark_diurnal_kry_ph.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ typedef struct
sunrealtype **P[MXSUB][MYSUB], **Jbd[MXSUB][MYSUB];
sunindextype* pivot[MXSUB][MYSUB];

}* UserData;
} * UserData;

/* Private Helper Functions */
static void InitUserData(int my_pe, MPI_Comm comm, UserData data);
Expand Down
2 changes: 1 addition & 1 deletion examples/arkode/C_serial/ark_KrylovDemo_prec.c
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ typedef struct
N_Vector tmp;
N_Vector rewt;
void* arkode_mem;
}* WebData;
} * WebData;

/* Private Helper Functions */

Expand Down
20 changes: 10 additions & 10 deletions examples/arkode/C_serial/ark_brusselator.c
Original file line number Diff line number Diff line change
Expand Up @@ -284,12 +284,12 @@ int main()
static int f(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data)
{
sunrealtype* rdata = (sunrealtype*)user_data; /* cast user_data to sunrealtype */
sunrealtype a = rdata[0]; /* access data entries */
sunrealtype b = rdata[1];
sunrealtype ep = rdata[2];
sunrealtype u = NV_Ith_S(y, 0); /* access solution values */
sunrealtype v = NV_Ith_S(y, 1);
sunrealtype w = NV_Ith_S(y, 2);
sunrealtype a = rdata[0]; /* access data entries */
sunrealtype b = rdata[1];
sunrealtype ep = rdata[2];
sunrealtype u = NV_Ith_S(y, 0); /* access solution values */
sunrealtype v = NV_Ith_S(y, 1);
sunrealtype w = NV_Ith_S(y, 2);

/* fill in the RHS function */
NV_Ith_S(ydot, 0) = a - (w + 1.0) * u + v * u * u;
Expand All @@ -304,10 +304,10 @@ static int Jac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J,
void* user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3)
{
sunrealtype* rdata = (sunrealtype*)user_data; /* cast user_data to sunrealtype */
sunrealtype ep = rdata[2]; /* access data entries */
sunrealtype u = NV_Ith_S(y, 0); /* access solution values */
sunrealtype v = NV_Ith_S(y, 1);
sunrealtype w = NV_Ith_S(y, 2);
sunrealtype ep = rdata[2]; /* access data entries */
sunrealtype u = NV_Ith_S(y, 0); /* access solution values */
sunrealtype v = NV_Ith_S(y, 1);
sunrealtype w = NV_Ith_S(y, 2);

/* fill in the Jacobian via SUNDenseMatrix macro, SM_ELEMENT_D (see sunmatrix_dense.h) */
SM_ELEMENT_D(J, 0, 0) = -(w + 1.0) + 2.0 * u * v;
Expand Down
4 changes: 2 additions & 2 deletions examples/arkode/C_serial/ark_brusselator1D.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ typedef struct
sunrealtype dv; /* diffusion coeff for v */
sunrealtype dw; /* diffusion coeff for w */
sunrealtype ep; /* stiffness parameter */
}* UserData;
} * UserData;

/* User-supplied Functions Called by the Solver */
static int f(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data);
Expand Down Expand Up @@ -113,7 +113,7 @@ int main()

/* general problem variables */
int flag; /* reusable error-checking flag */
N_Vector y = NULL; /* empty vector for storing solution */
N_Vector y = NULL; /* empty vector for storing solution */
N_Vector umask = NULL; /* empty mask vectors for viewing solution components */
N_Vector vmask = NULL;
N_Vector wmask = NULL;
Expand Down
2 changes: 1 addition & 1 deletion examples/arkode/C_serial/ark_brusselator1D_FEM_slu.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ typedef struct
sunrealtype ep; /* stiffness parameter */
N_Vector tmp; /* temporary vector */
SUNMatrix R; /* temporary storage */
}* UserData;
} * UserData;

/* User-supplied Functions Called by the Solver */
static int f(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data);
Expand Down
2 changes: 1 addition & 1 deletion examples/arkode/C_serial/ark_brusselator1D_imexmri.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ typedef struct
sunrealtype av; /* advection coeff for v */
sunrealtype aw; /* advection coeff for w */
sunrealtype ep; /* stiffness parameter */
}* UserData;
} * UserData;

/* User-supplied Functions Called by the Solver */
static int ff(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data);
Expand Down
2 changes: 1 addition & 1 deletion examples/arkode/C_serial/ark_brusselator1D_klu.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ typedef struct
sunrealtype dw; /* diffusion coeff for w */
sunrealtype ep; /* stiffness parameter */
SUNMatrix R; /* temporary storage */
}* UserData;
} * UserData;

/* User-supplied Functions Called by the Solver */
static int f(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data);
Expand Down
2 changes: 1 addition & 1 deletion examples/arkode/C_serial/ark_brusselator_1D_mri.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ typedef struct
sunrealtype b; /* steady-state value of w */
sunrealtype c; /* advection coefficient */
sunrealtype ep; /* stiffness parameter */
}* UserData;
} * UserData;

/* user-provided functions called by the integrator */
static int ff(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data);
Expand Down
14 changes: 7 additions & 7 deletions examples/arkode/C_serial/ark_brusselator_fp.c
Original file line number Diff line number Diff line change
Expand Up @@ -279,9 +279,9 @@ int main(int argc, char* argv[])
static int fi(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data)
{
sunrealtype* rdata = (sunrealtype*)user_data; /* cast user_data to sunrealtype */
sunrealtype b = rdata[1]; /* access data entries */
sunrealtype ep = rdata[2];
sunrealtype w = NV_Ith_S(y, 2); /* access solution values */
sunrealtype b = rdata[1]; /* access data entries */
sunrealtype ep = rdata[2];
sunrealtype w = NV_Ith_S(y, 2); /* access solution values */

/* fill in the RHS function */
NV_Ith_S(ydot, 0) = 0.0;
Expand All @@ -295,10 +295,10 @@ static int fi(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data)
static int fe(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data)
{
sunrealtype* rdata = (sunrealtype*)user_data; /* cast user_data to sunrealtype */
sunrealtype a = rdata[0]; /* access data entries */
sunrealtype u = NV_Ith_S(y, 0); /* access solution values */
sunrealtype v = NV_Ith_S(y, 1);
sunrealtype w = NV_Ith_S(y, 2);
sunrealtype a = rdata[0]; /* access data entries */
sunrealtype u = NV_Ith_S(y, 0); /* access solution values */
sunrealtype v = NV_Ith_S(y, 1);
sunrealtype w = NV_Ith_S(y, 2);

/* fill in the RHS function */
NV_Ith_S(ydot, 0) = a - (w + 1.0) * u + v * u * u;
Expand Down
14 changes: 7 additions & 7 deletions examples/arkode/C_serial/ark_brusselator_mri.c
Original file line number Diff line number Diff line change
Expand Up @@ -251,9 +251,9 @@ int main()
static int ff(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data)
{
sunrealtype* rdata = (sunrealtype*)user_data; /* cast user_data to sunrealtype */
sunrealtype b = rdata[1]; /* access data entries */
sunrealtype ep = rdata[2];
sunrealtype w = NV_Ith_S(y, 2); /* access solution values */
sunrealtype b = rdata[1]; /* access data entries */
sunrealtype ep = rdata[2];
sunrealtype w = NV_Ith_S(y, 2); /* access solution values */

/* fill in the RHS function */
NV_Ith_S(ydot, 0) = 0.0;
Expand All @@ -268,10 +268,10 @@ static int ff(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data)
static int fs(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data)
{
sunrealtype* rdata = (sunrealtype*)user_data; /* cast user_data to sunrealtype */
sunrealtype a = rdata[0]; /* access data entries */
sunrealtype u = NV_Ith_S(y, 0); /* access solution values */
sunrealtype v = NV_Ith_S(y, 1);
sunrealtype w = NV_Ith_S(y, 2);
sunrealtype a = rdata[0]; /* access data entries */
sunrealtype u = NV_Ith_S(y, 0); /* access solution values */
sunrealtype v = NV_Ith_S(y, 1);
sunrealtype w = NV_Ith_S(y, 2);

/* fill in the RHS function */
NV_Ith_S(ydot, 0) = a - (w + 1.0) * u + v * u * u;
Expand Down
2 changes: 1 addition & 1 deletion examples/arkode/C_serial/ark_heat1D.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ typedef struct
sunindextype N; /* number of intervals */
sunrealtype dx; /* mesh spacing */
sunrealtype k; /* diffusion coefficient */
}* UserData;
} * UserData;

/* User-supplied Functions Called by the Solver */
static int f(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data);
Expand Down
2 changes: 1 addition & 1 deletion examples/arkode/C_serial/ark_heat1D_adapt.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ typedef struct
sunrealtype* x; /* current mesh */
sunrealtype k; /* diffusion coefficient */
sunrealtype refine_tol; /* adaptivity tolerance */
}* UserData;
} * UserData;

/* User-supplied Functions Called by the Solver */
static int f(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data);
Expand Down
2 changes: 1 addition & 1 deletion examples/arkode/C_serial/ark_kepler.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
typedef struct
{
sunrealtype ecc;
}* UserData;
} * UserData;

typedef struct
{
Expand Down
2 changes: 1 addition & 1 deletion examples/arkode/C_serial/ark_reaction_diffusion_mri.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ typedef struct
sunrealtype dx; /* mesh spacing */
sunrealtype k; /* diffusion coefficient */
sunrealtype lam;
}* UserData;
} * UserData;

/* User-supplied Functions Called by the Solver */
static int fs(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data);
Expand Down
Loading

0 comments on commit 475e727

Please sign in to comment.