Merge branch 'ml-doc' into v0.x

This commit is contained in:
Max Luebke 2023-08-02 14:00:44 +02:00
commit d5d098d6cd
10 changed files with 65 additions and 92 deletions

View File

@ -1,5 +1,5 @@
<!-- <!--
Time-stamp: "Last modified 2023-07-20 11:30:44 delucia" Time-stamp: "Last modified 2023-08-02 13:55:11 mluebke"
--> -->
# POET # POET
@ -69,6 +69,9 @@ following available options:
DHT usage. Defaults to _OFF_. DHT usage. Defaults to _OFF_.
- **POET_ENABLE_TESTING**=_boolean_ - enables small set of unit tests (more to - **POET_ENABLE_TESTING**=_boolean_ - enables small set of unit tests (more to
come). Defaults to _OFF_. come). Defaults to _OFF_.
- **POET_PHT_ADDITIONAL_INFO**=_boolean_ - enabling the count of accesses to one
PHT bucket. Use with caution, as things will get slowed down significantly.
Defaults to _OFF_.
### Example: Build from scratch ### Example: Build from scratch
@ -109,15 +112,24 @@ poet
│ └── kin_r_library.R │ └── kin_r_library.R
└── share └── share
└── poet └── poet
├── bench └── bench
│ ├── dolo_diffu_inner_large.R ├── barite
│ ├── dolo_diffu_inner.R │ ├── barite_interp_eval.R
│ └── dolo_inner.pqi │ ├── barite.pqi
└── examples │ ├── barite.R
├── dol.pqi │ └── db_barite.dat
├── phreeqc_kin.dat ├── dolo
├── SimDol1D_diffu.R │ ├── dolo_diffu_inner_large.R
└── SimDol2D_diffu.R │ ├── dolo_diffu_inner.R
│ ├── dolo_inner.pqi
│ ├── dolo_interp_long.R
│ └── phreeqc_kin.dat
└── surfex
├── ExBase.pqi
├── ex.R
├── SMILE_2021_11_01_TH.dat
├── SurfExBase.pqi
└── surfex.R
``` ```
The R libraries will be loaded at runtime and the paths are hardcoded The R libraries will be loaded at runtime and the paths are hardcoded
@ -125,6 +137,10 @@ absolute paths inside `poet.cpp`. So, if you consider to move
`bin/poet` either change paths of the R source files and recompile `bin/poet` either change paths of the R source files and recompile
POET or also move `R_lib/*` relative to the binary. POET or also move `R_lib/*` relative to the binary.
The benchmarks consist of input scripts, which are provided as .R files.
Additionally, Phreeqc scripts and their corresponding databases are required,
stored as .pqi and .dat files, respectively.
## Running ## Running
Run POET by `mpirun ./poet <OPTIONS> <SIMFILE> <OUTPUT_DIRECTORY>` Run POET by `mpirun ./poet <OPTIONS> <SIMFILE> <OUTPUT_DIRECTORY>`
@ -132,28 +148,25 @@ where:
- **OPTIONS** - runtime parameters (explained below) - **OPTIONS** - runtime parameters (explained below)
- **SIMFILE** - simulation described as R script (e.g. - **SIMFILE** - simulation described as R script (e.g.
`<POET_INSTALL_DIR>/share/examples/SimDol2D_diffu.R`) `<POET_INSTALL_DIR>/share/poet/bench/dolo/dolo_interp_long.R`)
- **OUTPUT_DIRECTORY** - path, where all output of POET should be stored - **OUTPUT_DIRECTORY** - path, where all output of POET should be stored
### Runtime options ### Runtime options
The following parameters can be set: The following parameters can be set:
| Option | Value | Description | | Option | Value | Description |
|--------------------------|--------------|--------------------------------------------------------------------------------------------------------------------------| |-----------------------------|--------------|--------------------------------------------------------------------------------------------------------------------------|
| **--work-package-size=** | _1..n_ | size of work packages (defaults to _5_) | | **--work-package-size=** | _1..n_ | size of work packages (defaults to _5_) |
| **--ignore-result** | | disables store of simulation resuls | | **--ignore-result** | | disables store of simulation resuls |
| **--dht** | | enabling DHT usage (defaults to _OFF_) | | **--dht** | | enabling DHT usage (defaults to _OFF_) |
| **--dht-signif=** | _1..n_ | set rounding to number of significant digits (defaults to _5_) (it is recommended to use `signif_vec` in R input script) | | **--dht-strategy=** | _0-1_ | change DHT strategy. **NOT IMPLEMENTED YET** (Defaults to _0_) |
| **--dht-strategy=** | _0-1_ | change DHT strategy. **NOT IMPLEMENTED YET** (Defaults to _0_) | | **--dht-size=** | _1-n_ | size of DHT per process involved in megabyte (defaults to _1000 MByte_) |
| **--dht-size=** | _1-n_ | size of DHT per process involved in megabyte (defaults to _1000 MByte_) | | **--dht-snaps=** | _0-2_ | disable or enable storage of DHT snapshots |
| **--dht-snaps=** | _0-2_ | disable or enable storage of DHT snapshots | | **--dht-file=** | `<SNAPSHOT>` | initializes DHT with the given snapshot file |
| **--dht-file=** | `<SNAPSHOT>` | initializes DHT with the given snapshot file | | **--interp-size** | _1-n_ | size of PHT (interpolation) per process in megabyte |
| **--interp-bucket-entries** | _1-n_ | number of entries to store at maximum in one PHT bucket |
#### Additions to `dht-signif` | **--interp-min** | _1-n_ | number of entries in PHT bucket needed to start interpolation |
Only used if no vector is given in setup file. For individual values
per column use R vector `signif_vector` in `SIMFILE`.
#### Additions to `dht-snaps` #### Additions to `dht-snaps`
@ -168,13 +181,13 @@ Following values can be set:
### Example: Running from scratch ### Example: Running from scratch
We will continue the above example and start a simulation with We will continue the above example and start a simulation with
`SimDol2D_diffu.R`. As transport a simple fixed-coefficient diffusion is used. `dolo_diffu_inner.R`. As transport a simple fixed-coefficient diffusion is used.
It's a 2D, 100x100 grid, simulating 10 time steps. To start the simulation with It's a 2D, 100x100 grid, simulating 10 time steps. To start the simulation with
4 processes `cd` into your previously installed POET-dir 4 processes `cd` into your previously installed POET-dir
`<POET_INSTALL_DIR>/bin` and run: `<POET_INSTALL_DIR>/bin` and run:
```sh ```sh
mpirun -n 4 ./poet ../share/poet/examples/SimDol2D_diffu.R output mpirun -n 4 ./poet ../share/poet/bench/dolo/dolo_diffu_inner.R/ output
``` ```
After a finished simulation all data generated by POET will be found After a finished simulation all data generated by POET will be found
@ -187,7 +200,7 @@ produced. This is done by appending the `--dht-snaps=<value>` option. The
resulting call would look like this: resulting call would look like this:
```sh ```sh
mpirun -n 4 ./poet --dht --dht-snaps=2 ../share/poet/examples/SimDol2D_diffu.R output mpirun -n 4 ./poet --dht --dht-snaps=2 ../share/poet/bench/dolo/dolo_diffu_inner.R/ output
``` ```
## About the usage of MPI_Wtime() ## About the usage of MPI_Wtime()

View File

@ -1,4 +1,4 @@
## Time-stamp: "Last modified 2023-04-24 16:51:23 mluebke" ## Time-stamp: "Last modified 2023-08-02 13:59:22 mluebke"
database <- normalizePath("../share/poet/bench/barite/db_barite.dat") database <- normalizePath("../share/poet/bench/barite/db_barite.dat")
input_script <- normalizePath("../share/poet/bench/barite/barite.pqi") input_script <- normalizePath("../share/poet/bench/barite/barite.pqi")
@ -28,11 +28,7 @@ init_cell <- list(
grid <- list( grid <- list(
n_cells = c(n, m), n_cells = c(n, m),
s_cells = c(1, 1), s_cells = c(1, 1),
type = types[1], type = types[1]
init_cell = as.data.frame(init_cell, check.names = FALSE),
props = names(init_cell),
database = database,
input_script = input_script
) )

View File

@ -1,4 +1,4 @@
## Time-stamp: "Last modified 2023-07-28 16:57:40 mluebke" ## Time-stamp: "Last modified 2023-08-02 13:59:02 mluebke"
database <- normalizePath("../share/poet/bench/dolo/phreeqc_kin.dat") database <- normalizePath("../share/poet/bench/dolo/phreeqc_kin.dat")
input_script <- normalizePath("../share/poet/bench/dolo/dolo_inner.pqi") input_script <- normalizePath("../share/poet/bench/dolo/dolo_inner.pqi")
@ -29,11 +29,7 @@ init_cell <- list(
grid <- list( grid <- list(
n_cells = c(n, m), n_cells = c(n, m),
s_cells = c(1, 1), s_cells = c(1, 1),
type = types[1], type = types[1]
init_cell = as.data.frame(init_cell, check.names = FALSE),
props = names(init_cell),
database = database,
input_script = input_script
) )

View File

@ -1,4 +1,4 @@
## Time-stamp: "Last modified 2023-07-28 16:57:40 mluebke" ## Time-stamp: "Last modified 2023-08-02 13:59:12 mluebke"
database <- normalizePath("../share/poet/bench/dolo/phreeqc_kin.dat") database <- normalizePath("../share/poet/bench/dolo/phreeqc_kin.dat")
input_script <- normalizePath("../share/poet/bench/dolo/dolo_inner.pqi") input_script <- normalizePath("../share/poet/bench/dolo/dolo_inner.pqi")
@ -29,11 +29,7 @@ init_cell <- list(
grid <- list( grid <- list(
n_cells = c(n, m), n_cells = c(n, m),
s_cells = c(2, 1), s_cells = c(2, 1),
type = types[1], type = types[1]
init_cell = as.data.frame(init_cell, check.names = FALSE),
props = names(init_cell),
database = database,
input_script = input_script
) )

View File

@ -1,4 +1,4 @@
## Time-stamp: "Last modified 2023-08-01 18:34:47 mluebke" ## Time-stamp: "Last modified 2023-08-02 13:47:06 mluebke"
database <- normalizePath("../share/poet/bench/dolo/phreeqc_kin.dat") database <- normalizePath("../share/poet/bench/dolo/phreeqc_kin.dat")
input_script <- normalizePath("../share/poet/bench/dolo/dolo_inner.pqi") input_script <- normalizePath("../share/poet/bench/dolo/dolo_inner.pqi")
@ -29,11 +29,7 @@ init_cell <- list(
grid <- list( grid <- list(
n_cells = c(n, m), n_cells = c(n, m),
s_cells = c(5, 2.5), s_cells = c(5, 2.5),
type = types[1], type = types[1]
init_cell = as.data.frame(init_cell, check.names = FALSE),
props = names(init_cell),
database = database,
input_script = input_script
) )

View File

@ -1,4 +1,4 @@
## Time-stamp: "Last modified 2023-04-17 12:29:27 mluebke" ## Time-stamp: "Last modified 2023-08-02 13:59:35 mluebke"
database <- normalizePath("./SMILE_2021_11_01_TH.dat") database <- normalizePath("./SMILE_2021_11_01_TH.dat")
input_script <- normalizePath("./ExBase.pqi") input_script <- normalizePath("./ExBase.pqi")
@ -40,11 +40,7 @@ init_cell <- list(H = 1.476571028625e-01,
grid <- list( grid <- list(
n_cells = c(n, m), n_cells = c(n, m),
s_cells = c(1, 1), s_cells = c(1, 1),
type = "scratch", type = "scratch"
init_cell = as.data.frame(init_cell, check.names = FALSE),
props = names(init_cell),
database = database,
input_script = input_script
) )

View File

@ -1,4 +1,4 @@
## Time-stamp: "Last modified 2023-04-17 15:48:21 mluebke" ## Time-stamp: "Last modified 2023-08-02 13:59:44 mluebke"
database <- normalizePath("../share/poet/bench/surfex/SMILE_2021_11_01_TH.dat") database <- normalizePath("../share/poet/bench/surfex/SMILE_2021_11_01_TH.dat")
input_script <- normalizePath("../share/poet/bench/surfex/SurfExBase.pqi") input_script <- normalizePath("../share/poet/bench/surfex/SurfExBase.pqi")
@ -40,11 +40,7 @@ init_cell <- list(H = 1.476571028625e-01,
grid <- list( grid <- list(
n_cells = c(n, m), n_cells = c(n, m),
s_cells = c(1, 1), s_cells = c(1, 1),
type = "scratch", type = "scratch"
init_cell = as.data.frame(init_cell, check.names = FALSE),
props = names(init_cell),
database = database,
input_script = input_script
) )

View File

@ -13,10 +13,6 @@ by POET.
| `n_cells` | Numeric Vector | Number of cells in each direction | | `n_cells` | Numeric Vector | Number of cells in each direction |
| `s_cells` | Numeric Vector | Spatial resolution of grid in each direction | | `s_cells` | Numeric Vector | Spatial resolution of grid in each direction |
| `type` | String | Type of initialization, can be set to *scratch*, *phreeqc* or *rds* | | `type` | String | Type of initialization, can be set to *scratch*, *phreeqc* or *rds* |
| `init_cell` | Data Frame | Containing all exactly one value per species to initialize the field. |
| `props` | String Vector | Names of all species |
| `database` | String | Path to Phreeqc database |
| `input_script` | String | Path to Phreeqc initial script |
## Diffusion parameters ## Diffusion parameters
@ -70,10 +66,12 @@ vecinj_index <- list(
## Chemistry parameters ## Chemistry parameters
| name | type | description | | name | type | description |
|----------------|--------|-----------------------------------| |----------------|--------------|----------------------------------------------------------------------------------|
| `database` | String | Path to the Phreeqc database | | `database` | String | Path to the Phreeqc database |
| `input_script` | String | Path the the Phreeqc input script | | `input_script` | String | Path the the Phreeqc input script |
| `dht_species` | Named Vector | Indicates significant digits to use for each species for DHT rounding. |
| `pht_species` | Named Vector | Indicates significant digits to use for each species for Interpolation rounding. |
## Final setup ## Final setup
@ -86,10 +84,3 @@ vecinj_index <- list(
| `timesteps` | Numeric Vector | $\Delta t$ to use for specific iteration | | `timesteps` | Numeric Vector | $\Delta t$ to use for specific iteration |
| `store_result` | Boolean | Indicates if results should be stored | | `store_result` | Boolean | Indicates if results should be stored |
| `out_save` | Numeric Vector | *optional:* At which iteration the states should be stored | | `out_save` | Numeric Vector | *optional:* At which iteration the states should be stored |
### DHT setup
| name | type | description |
|-----------------|----------------|---------------------------------------------------------------------------------|
| `signif_vector` | Numeric Vector | Indicates significant digits to use for DHT rounding. Order of `props` vector. |
| `prop_type` | String Vector | Set type of species for rounding, can be left blank or set to *act* or *ignore* |

View File

@ -240,11 +240,12 @@ private:
std::list<std::string> validateOptions(argh::parser cmdl); std::list<std::string> validateOptions(argh::parser cmdl);
const std::set<std::string> flaglist{ const std::set<std::string> flaglist{
"ignore-result", "dht", "dht-nolog", "P", "progress", "interp"}; "ignore-result", "dht", "P", "progress", "interp"};
const std::set<std::string> paramlist{ const std::set<std::string> paramlist{
"work-package-size", "dht-signif", "dht-strategy", "work-package-size", "dht-strategy",
"dht-size", "dht-snaps", "dht-file", "dht-size", "dht-snaps",
"interp-size", "interp-min", "interp-bucket-entries"}; "dht-file", "interp-size",
"interp-min", "interp-bucket-entries"};
t_simparams simparams; t_simparams simparams;

View File

@ -56,14 +56,6 @@ poet::GridParams::s_GridParams(RInside &R) {
(dim == 1 ? this->n_cells[0] : this->n_cells[0] * this->n_cells[1]); (dim == 1 ? this->n_cells[0] : this->n_cells[0] * this->n_cells[1]);
this->type = Rcpp::as<std::string>(R.parseEval("mysetup$grid$type")); this->type = Rcpp::as<std::string>(R.parseEval("mysetup$grid$type"));
this->init_df =
Rcpp::as<Rcpp::DataFrame>(R.parseEval("mysetup$grid$init_cell"));
this->props =
Rcpp::as<std::vector<std::string>>(R.parseEval("mysetup$grid$props"));
this->input_script =
Rcpp::as<std::string>(R.parseEval("mysetup$grid$input_script"));
this->database_path =
Rcpp::as<std::string>(R.parseEval("mysetup$grid$database"));
} }
poet::DiffusionParams::s_DiffusionParams(RInside &R) { poet::DiffusionParams::s_DiffusionParams(RInside &R) {