|
1 | | -SUNDIALS installation guide: |
2 | | -https://computing.llnl.gov/projects/sundials/faq#inst |
| 1 | +Refer to https://amrex-codes.github.io/amrex/docs_html/TimeIntegration_Chapter.html |
| 2 | +for SNUDIALS installation, build, and usage instructions. |
3 | 3 |
|
4 | | -Installation |
5 | | - |
6 | | -# You need SUNDIALS v7.1.1 or later. |
7 | | -# Check https://computing.llnl.gov/projects/sundials/sundials-software to see if it's available for download. |
8 | | -# If so, download sundials-x.y.z.tar.gz and extract it at the same level as amrex using |
9 | | ->> tar -xzvf sundials-x.y.z.tar.gz # where x.y.z is the version of sundials |
10 | | ->> mv sundials-x.y.z sundials-src |
11 | | - |
12 | | -# If v7.1.1. is not available on the website, clone the git repo directly and use the latest version |
13 | | -# At the same level that amrex is cloned, do: |
14 | | - |
15 | | ->> git clone https://github.com/LLNL/sundials.git |
16 | | ->> mv sundials sundials-src |
17 | | - |
18 | | -# Next |
19 | | - |
20 | | ->> mkdir sundials |
21 | | ->> cd sundials |
22 | | - |
23 | | -###################### |
24 | | -HOST BUILD |
25 | | -###################### |
26 | | - |
27 | | ->> mkdir instdir |
28 | | ->> mkdir builddir |
29 | | ->> cd builddir |
30 | | - |
31 | | ->> cmake -DCMAKE_INSTALL_PREFIX=/pathto/sundials/instdir -DEXAMPLES_INSTALL_PATH=/pathto/sundials/instdir/examples -DENABLE_MPI=ON ../../sundials-src |
32 | | - |
33 | | -###################### |
34 | | -NVIDIA/CUDA BUILD |
35 | | -###################### |
36 | | - |
37 | | -# Navigate back to the 'sundials' directory and do: |
38 | | - |
39 | | ->> mkdir instdir_cuda |
40 | | ->> mkdir builddir_cuda |
41 | | ->> cd builddir_cuda |
42 | | - |
43 | | ->> cmake -DCMAKE_INSTALL_PREFIX=/pathto/sundials/instdir_cuda -DEXAMPLES_INSTALL_PATH=/pathto/sundials/instdir_cuda/examples -DENABLE_CUDA=ON -DENABLE_MPI=ON ../../sundials-src |
44 | | - |
45 | | -###################### |
46 | | - |
47 | | ->> make -j4 |
48 | | ->> make install |
49 | | - |
50 | | -# in your .bashrc or preferred configuration file, add the following (and then "source ~/.bashrc") |
51 | | - |
52 | | -# If you have a CPU build: |
53 | | - |
54 | | ->> export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/pathto/sundials/instdir/lib/ |
55 | | - |
56 | | -# If you have a NVIDIA/CUDA build: |
57 | | - |
58 | | ->> export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/pathto/sundials/instdir_cuda/lib/ |
59 | | - |
60 | | -# now you are ready to compile MagneX with: |
61 | | - |
62 | | ->> make -j4 USE_SUNDIALS=TRUE # optional to have 'USE_CUDA=TRUE' as well |
63 | | - |
64 | | -# in your inputs file, you will need to have: |
65 | | - |
66 | | -TimeIntegratorOption = 4 #amrex/sundials backend integrators |
67 | | - |
68 | | -# INTEGRATION |
69 | | -## integration.type can take on the following values: |
70 | | -## 0 or "ForwardEuler" => Native AMReX Forward Euler integrator |
71 | | -## 1 or "RungeKutta" => Native AMReX Explicit Runge Kutta controlled by integration.rk.type |
72 | | -## 2 or "SUNDIALS" => SUNDIALS backend controlled by integration.sundials.strategy |
73 | | -integration.type = SUNDIALS |
74 | | - |
75 | | -## Native AMReX Explicit Runge-Kutta parameters |
76 | | -# |
77 | | -## integration.rk.type can take the following values: |
78 | | -### 0 = User-specified Butcher Tableau |
79 | | -### 1 = Forward Euler |
80 | | -### 2 = Trapezoid Method |
81 | | -### 3 = SSPRK3 Method |
82 | | -### 4 = RK4 Method |
83 | | -integration.rk.type = 1 |
84 | | - |
85 | | -# Set the SUNDIALS method type: |
86 | | -# ERK = Explicit Runge-Kutta method |
87 | | -# DIRK = Diagonally Implicit Runge-Kutta method |
88 | | -# |
89 | | -# Optionally select a specific SUNDIALS method by name, see the SUNDIALS |
90 | | -# documentation for the supported method names |
91 | | - |
92 | | -# Use forward Euler (fixed step sizes only) |
93 | | -integration.sundials.type = ERK |
94 | | -integration.sundials.method = ARKODE_FORWARD_EULER_1_1 |
| 4 | +Make sure that SUNDIALS_HOME in the GNUmakefile points to the installation directory. |
0 commit comments