Skip to content

Commit

Permalink
Add prerequisites in README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Yuuichi Asahi committed Feb 26, 2025
1 parent b54d348 commit 4c08565
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 3 deletions.
4 changes: 2 additions & 2 deletions examples/10_HasegawaWakatani/10_hasegawa_wakatani.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ class HasegawaWakatani {

//! The parameters used in the simulation.
const double m_ca = 3.0;
const double m_nu = 0.01;
const double m_nu = 0.001;
const double m_eta = 3.0;
double m_norm_coef;
double m_dt = 0.0, m_time = 0.0;
Expand Down Expand Up @@ -735,7 +735,7 @@ int main(int argc, char* argv[]) {
Kokkos::ScopeGuard guard(argc, argv);
auto kwargs = IO::parse_args(argc, argv);
std::string out_dir = IO::get_arg(kwargs, "out_dir", "data_kokkos");
int nx = 512, nbiter = 100000;
int nx = 1024, nbiter = 100000;
double lx = 10.0, dt = 0.0005;
HasegawaWakatani model(nx, lx, nbiter, dt, out_dir);
Kokkos::Timer timer;
Expand Down
19 changes: 19 additions & 0 deletions examples/10_HasegawaWakatani/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,25 @@ The nonlinear term can be described as follows, which can be efficiently compute

![Poisson bracket](https://latex.codecogs.com/svg.latex?\\{\tilde{\phi},\tilde{n}\\}_k=-\sum_{k'}\sum_{k''}\delta_{k+k'+k'',0}\left(k_{x}'k_{y}''-k_{y}'k_{x}''\right)\hat{\phi}^{\ast}_{k'}\hat{n}^{\ast}_{k''})

## Prerequisites

For kokkos version, we need the followings:

* `CMake 3.22+`
* `Kokkos 4.4+`
* `gcc 8.3.0+` (CPUs)
* `IntelLLVM 2023.0.0+` (CPUs, Intel GPUs)
* `nvcc 11.0.0+` (NVIDIA GPUs)
* `rocm 5.3.0+` (AMD GPUs)

For python version, we need the followings:

* `python 3.8+`
* `numpy`
* `matplotlib`
* `xarray[io]`, `xarray[viz]`
* `joblib`

## python and kokkos implementation

As imagined, the nonlinear term is the core computational kernel of this code. In python, it is implemented by
Expand Down
2 changes: 1 addition & 1 deletion examples/10_HasegawaWakatani/postscript.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ def Real3DtoComplex2D(A: np.ndarray) -> np.ndarray:
Parameters
----------
A (xr.DataArray): A 3D array where the first dimension represents the real and imaginary parts.
A (np.ndarray): A 3D array where the first dimension represents the real and imaginary parts.
Returns
-------
Expand Down

0 comments on commit 4c08565

Please sign in to comment.