Skip to content

Commit f97eb6f

Browse files
committed
DOC: add explainer on ninja builds, correct some info on installing & running
1 parent a4724ff commit f97eb6f

File tree

2 files changed

+51
-12
lines changed

2 files changed

+51
-12
lines changed

doc/installation/dependencies.md

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,28 +21,31 @@ If a path is printed, `cmake` is installed. To check the version, run `cmake
2121
The layout of this page is as follows:
2222

2323
- [Installing Dependencies](#installing-dependencies)
24-
- [Install gcc](#install-gcc)
24+
- [Install C++ Compiler](#install-gcc)
2525
- [Install cmake](#install-cmake)
2626
- [Install JSON libraries](#install-json-libraries)
2727
- [Install Armadillo (and boost)](#install-armadillo-and-boost)
2828
- [Install NetCDF (optional)](#install-netcdf-optional)
2929

3030
## Install gcc
3131

32-
This comes installed by default on Ubuntu. On MacOS this can be installed, for
32+
On MacOS this can be installed, for
3333
example, using:
3434

3535
```bash
3636
sudo port install gcc11
3737
```
3838

39-
> As development began, gcc11 was the latest version; there are newer versions
40-
> of `gcc` available now (latest version is gcc14), which have not yet been
41-
> validated.
39+
On Ubuntu, `gcc` (the C-compiler) is pre-installed, but the C++ compiler is not. This
40+
can be installed with (subsituting your machine's package manager command):
41+
42+
``bash
43+
sudo apt install g++
44+
```
4245
4346
## Install cmake
4447
45-
Aether uses [CMake](https://cmake.org/) instead of `make`. If you don't have it
48+
Aether uses [CMake](https://cmake.org/) instead of GNU make. If you don't have it
4649
installed, you need it.
4750
4851
For MacOS, this can be installed with:
@@ -57,7 +60,7 @@ For Ubuntu/Debian Linux:
5760
sudo apt install cmake
5861
```
5962

60-
This can be done on RedHat using yum also.
63+
This can be done on RedHat using `yum` also.
6164

6265
## Install JSON libraries
6366

doc/usage/running_aether.md

Lines changed: 41 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,18 @@ cp -R share/run ./run.first_run
1818
This creates the directory where you will do your run. In that directory is a
1919
link to the aether executable and an input file called aether.json.
2020

21-
You can then run the executable from the directory you created.
21+
You can then run the executable from the directory you created. This uses four cores,
22+
which is the minimum for the dipole grid.
2223

2324
```bash
2425
cd run.first_run
25-
./aether
26+
mpirun -np 4 ./aether
2627
```
2728

2829
You should see something like:
2930

3031
```bash
31-
run.first_run% ./aether
32+
run.first_run% mpirun -np 4 ./aether
3233
> Need to NOT adjust F10.7, but that isn't included yet!!!
3334
> Writing file : 3DALL_20110320_000000
3435
> Writing file : 3DBFI_20110320_000000
@@ -59,6 +60,16 @@ The successful end of this will show a timing summary, similar to:
5960
timing_total (s) : 2.94398
6061
```
6162
63+
### Running in 1D
64+
65+
If you want to quickly run Aether to test if things are working, there are a few changes
66+
that need to be made to run in one dimension.
67+
68+
1. Change the input file's, `aether.json`, value for the neutral and ion grids **both**
69+
to `"sphere"`. No number!
70+
2. Run the code with `./aether`. This will not use MPI, however armadillo may use
71+
multiple OpenMP processes for math, so be careful on cluster login nodes.
72+
6273
## Output Files
6374

6475
Aether outputs to a subdirectory called UA/output. At this time, all processors
@@ -127,11 +138,36 @@ model. This file is in UA/inputs/defaults.json.
127138
This is a json file that sets all of the defaults within Aether. This file
128139
should never be modified!
129140

130-
### For Developers
141+
## For Developers
131142

132-
Within Aether, the inputs.cpp file has a large handful of of get_ routines to
143+
Within Aether, the inputs.cpp file has a large handful of of `get_` routines to
133144
get the values of the settings that the user has set.
134145

146+
To speedup builds, it can be faster to use Ninja instead of GNU make. Ninja
147+
automatically parallelizes to fit your machine, can re-run cmake for small changes, and
148+
has other small differences from GNU make. To use ninja for builds:
149+
150+
1. Ensure it is installed. This can be done with conda or your system's package manager
151+
(note on Ubuntu it is called "ninja-build)
152+
2. Clear the GNU make build pecs from `build`. This is most easily done by removing the
153+
`CMakeCache.txt` file, but you can remove the entire contents of the build directory.
154+
3. Tell cmake to generate build scripts for Ninja. From `Aether/build/`, run:
155+
`cmake -GNinja [any options] ../`.
156+
4. Build with `ninja`. This will use as many cores asz your system has.
157+
158+
The dfevelopment process can be further sped up since Ninja can change directories
159+
before compiling. This is useful, for example, to not need to cd out of run when testing
160+
changes. From `Aether/run/`, you can compile and run the code with the one-liner:
161+
162+
```bash
163+
ninja -C ../build && mpirun -np 4 ./aether
164+
```
165+
166+
The `-C` flag specifies which directory to move to before building. Obviously, change it
167+
if yours is different. When changing header files, Ninja often catches the change and
168+
will re-run cmake automatically. If not, you will need to remove `CMakeCache.txt` and
169+
re-run cmake (again using the `-GNinja` flag).
170+
135171
## aether.json file
136172
137173
The file aether.json is read in AFTER the defaults file and these settings

0 commit comments

Comments
 (0)