Skip to content

Commit

Permalink
Update example-installation.md
Browse files Browse the repository at this point in the history
  • Loading branch information
aroubickova authored Nov 1, 2023
1 parent 3d047fc commit 18b2d83
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions docs/example-installation.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
This page shows
1. how to install BOUT++ on Cirrus, and
2. how to install and set-up SmartSim so that it can communicate with BOUT++.
1. how to [install BOUT++](./example-installation.md#1-bout) on Cirrus, and
2. how to [install and set-up SmartSim](./example-installation.md#2-smartsim-with-bout) so that it can communicate with BOUT++.

[back](./)

Expand All @@ -17,7 +17,7 @@ Download BOUT++ source code:
git clone https://github.com/boutproject/BOUT-dev.git
```

> We are using v5.0.0; you can download this specific version using `wget`:
> We are using v5.0.0; you can download this specific version like this:
>
> ```wget https://github.com/boutproject/BOUT-dev/archive/refs/tags/v5.0.0.tar.gz```
Expand All @@ -42,35 +42,40 @@ python -m pip install cython

Following the first run of the above, simply `source bout/bin/activate` is enough.

> **Note:** `export HOME=$WORK` the Python `venv` module expects the venv parent directory to be `$HOME`, i.e. venv folders are in `$HOME/<venv name>`. If `export HOME=$WORK` is not used, full paths must be given to `venv`, for example, `python -m venv --system-site-packages $WORK/bout`. This isn't a big deal at this stage, but will be more important later to run SiMLInt Jupyter Notebooks.
> **Note:** The Python `venv` module expects the venv parent directory to be `$HOME`, i.e. venv folders are in `$HOME/<venv name>`.
> If `export HOME=$WORK` is not used, full paths must be given to `venv`, for example, `python -m venv --system-site-packages $WORK/bout`.
> This isn't a big deal at this stage, but is more important when running SiMLInt Jupyter Notebooks.
Build:
```
cd $WORK/BOUT-dev
MPICXX_CXX=icpc MPICXX=mpicxx cmake . -B build -DBOUT_DOWNLOAD_NETCDF_CXX4=ON -DBOUT_USE_LAPACK=off -DCMAKE_CXX_FLAGS=-std=c++17 -DCMAKE_BUILD_TYPE=Release
export PYTHONPATH=$WORK/BOUT-dev/build/tools/pylib:$WORK/BOUT-dev/tools/pylib:$PYTHONPATH #possibly not required
export PYTHONPATH=$WORK/BOUT-dev/build/tools/pylib:$WORK/BOUT-dev/tools/pylib:$PYTHONPATH
# This may not be not required
cmake --build build -j 6
```

## BOUT++ Hasegawa-Wakatani example
This will build a *pure* BOUT++ version of the Hasegawa-Wakatani example. A build with SmartSim connection capability is described on the [workflow page](./workflow.md#compile-hasegawa-wakatani-with-smartredis)
This will build a *pure* BOUT++ version of the Hasegawa-Wakatani example. A build with SmartSim connection capability is described on the [workflow page](./workflow.md#compile-hasegawa-wakatani-with-smartredis).

Still in `$WORK/BOUT-dev`:
```
MPICXX_CXX=icpc MPICXX=mpicxx cmake . --build build -DBOUT_BUILD_EXAMPLES=on
cmake --build build --target hasegawa-wakatani
```


[back](./)


# 2. SmartSim with BOUT++

## Python/conda environment
Follow [Cirrus docs](https://docs.cirrus.ac.uk/user-guide/python/#installing-your-own-python-packages-with-conda) to set up a python environment to which further packages can be added.
Follow [Cirrus docs](https://docs.cirrus.ac.uk/user-guide/python/#installing-your-own-python-packages-with-conda) to set up a python environment to which further packages can be added. We refer to this environment `myvenv`.

Add the following packages to install SmartSim ML wrapper:

```
conda activate myvenv
conda install git-lfs
Expand All @@ -80,7 +85,6 @@ python -m pip install smartsim[ml]
```

Build:

```
module load mpt
module load intel-compilers-19
Expand Down

0 comments on commit 18b2d83

Please sign in to comment.