From 4c08565ef6bbfb03503e370001b497ab48a6f5ad Mon Sep 17 00:00:00 2001 From: Yuuichi Asahi Date: Wed, 26 Feb 2025 19:53:34 +0900 Subject: [PATCH] Add prerequisites in README.md --- .../10_hasegawa_wakatani.cpp | 4 ++-- examples/10_HasegawaWakatani/README.md | 19 +++++++++++++++++++ examples/10_HasegawaWakatani/postscript.py | 2 +- 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/examples/10_HasegawaWakatani/10_hasegawa_wakatani.cpp b/examples/10_HasegawaWakatani/10_hasegawa_wakatani.cpp index 85ba5f85..05eb9f0d 100644 --- a/examples/10_HasegawaWakatani/10_hasegawa_wakatani.cpp +++ b/examples/10_HasegawaWakatani/10_hasegawa_wakatani.cpp @@ -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; @@ -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; diff --git a/examples/10_HasegawaWakatani/README.md b/examples/10_HasegawaWakatani/README.md index 5ad70fa5..37b9af1d 100644 --- a/examples/10_HasegawaWakatani/README.md +++ b/examples/10_HasegawaWakatani/README.md @@ -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 diff --git a/examples/10_HasegawaWakatani/postscript.py b/examples/10_HasegawaWakatani/postscript.py index 18bd0b76..01add8e1 100644 --- a/examples/10_HasegawaWakatani/postscript.py +++ b/examples/10_HasegawaWakatani/postscript.py @@ -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 -------