diff --git a/README.md b/README.md index 7ef495139..a273f7f10 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # POET @@ -69,6 +69,9 @@ following available options: DHT usage. Defaults to _OFF_. - **POET_ENABLE_TESTING**=_boolean_ - enables small set of unit tests (more to 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 @@ -109,15 +112,24 @@ poet │ └── kin_r_library.R └── share └── poet - ├── bench - │ ├── dolo_diffu_inner_large.R - │ ├── dolo_diffu_inner.R - │ └── dolo_inner.pqi - └── examples - ├── dol.pqi - ├── phreeqc_kin.dat - ├── SimDol1D_diffu.R - └── SimDol2D_diffu.R + └── bench + ├── barite + │ ├── barite_interp_eval.R + │ ├── barite.pqi + │ ├── barite.R + │ └── db_barite.dat + ├── dolo + │ ├── dolo_diffu_inner_large.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 @@ -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 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 Run POET by `mpirun ./poet ` @@ -132,28 +148,25 @@ where: - **OPTIONS** - runtime parameters (explained below) - **SIMFILE** - simulation described as R script (e.g. - `/share/examples/SimDol2D_diffu.R`) + `/share/poet/bench/dolo/dolo_interp_long.R`) - **OUTPUT_DIRECTORY** - path, where all output of POET should be stored ### Runtime options The following parameters can be set: -| Option | Value | Description | -|--------------------------|--------------|--------------------------------------------------------------------------------------------------------------------------| -| **--work-package-size=** | _1..n_ | size of work packages (defaults to _5_) | -| **--ignore-result** | | disables store of simulation resuls | -| **--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-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-file=** | `` | initializes DHT with the given snapshot file | - -#### Additions to `dht-signif` - -Only used if no vector is given in setup file. For individual values -per column use R vector `signif_vector` in `SIMFILE`. +| Option | Value | Description | +|-----------------------------|--------------|--------------------------------------------------------------------------------------------------------------------------| +| **--work-package-size=** | _1..n_ | size of work packages (defaults to _5_) | +| **--ignore-result** | | disables store of simulation resuls | +| **--dht** | | enabling DHT usage (defaults to _OFF_) | +| **--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-snaps=** | _0-2_ | disable or enable storage of DHT snapshots | +| **--dht-file=** | `` | 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 | +| **--interp-min** | _1-n_ | number of entries in PHT bucket needed to start interpolation | #### Additions to `dht-snaps` @@ -168,13 +181,13 @@ Following values can be set: ### Example: Running from scratch 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 4 processes `cd` into your previously installed POET-dir `/bin` and run: ```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 @@ -187,7 +200,7 @@ produced. This is done by appending the `--dht-snaps=` option. The resulting call would look like this: ```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() diff --git a/bench/barite/barite.R b/bench/barite/barite.R index d6941d3ed..0543ff39a 100644 --- a/bench/barite/barite.R +++ b/bench/barite/barite.R @@ -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") input_script <- normalizePath("../share/poet/bench/barite/barite.pqi") @@ -28,11 +28,7 @@ init_cell <- list( grid <- list( n_cells = c(n, m), s_cells = c(1, 1), - type = types[1], - init_cell = as.data.frame(init_cell, check.names = FALSE), - props = names(init_cell), - database = database, - input_script = input_script + type = types[1] ) diff --git a/bench/dolo/dolo_diffu_inner.R b/bench/dolo/dolo_diffu_inner.R index f981ed5c4..071fe36c1 100644 --- a/bench/dolo/dolo_diffu_inner.R +++ b/bench/dolo/dolo_diffu_inner.R @@ -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") input_script <- normalizePath("../share/poet/bench/dolo/dolo_inner.pqi") @@ -29,11 +29,7 @@ init_cell <- list( grid <- list( n_cells = c(n, m), s_cells = c(1, 1), - type = types[1], - init_cell = as.data.frame(init_cell, check.names = FALSE), - props = names(init_cell), - database = database, - input_script = input_script + type = types[1] ) diff --git a/bench/dolo/dolo_diffu_inner_large.R b/bench/dolo/dolo_diffu_inner_large.R index 5dfb95677..4403ae46f 100644 --- a/bench/dolo/dolo_diffu_inner_large.R +++ b/bench/dolo/dolo_diffu_inner_large.R @@ -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") input_script <- normalizePath("../share/poet/bench/dolo/dolo_inner.pqi") @@ -29,11 +29,7 @@ init_cell <- list( grid <- list( n_cells = c(n, m), s_cells = c(2, 1), - type = types[1], - init_cell = as.data.frame(init_cell, check.names = FALSE), - props = names(init_cell), - database = database, - input_script = input_script + type = types[1] ) diff --git a/bench/dolo/dolo_interp_long.R b/bench/dolo/dolo_interp_long.R index b333891ea..dedfe1c21 100644 --- a/bench/dolo/dolo_interp_long.R +++ b/bench/dolo/dolo_interp_long.R @@ -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") input_script <- normalizePath("../share/poet/bench/dolo/dolo_inner.pqi") @@ -29,11 +29,7 @@ init_cell <- list( grid <- list( n_cells = c(n, m), s_cells = c(5, 2.5), - type = types[1], - init_cell = as.data.frame(init_cell, check.names = FALSE), - props = names(init_cell), - database = database, - input_script = input_script + type = types[1] ) diff --git a/bench/surfex/ex.R b/bench/surfex/ex.R index 299c5db0c..13feea1d8 100644 --- a/bench/surfex/ex.R +++ b/bench/surfex/ex.R @@ -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") input_script <- normalizePath("./ExBase.pqi") @@ -40,11 +40,7 @@ init_cell <- list(H = 1.476571028625e-01, grid <- list( n_cells = c(n, m), s_cells = c(1, 1), - type = "scratch", - init_cell = as.data.frame(init_cell, check.names = FALSE), - props = names(init_cell), - database = database, - input_script = input_script + type = "scratch" ) diff --git a/bench/surfex/surfex.R b/bench/surfex/surfex.R index 37a5e0429..409b0f277 100644 --- a/bench/surfex/surfex.R +++ b/bench/surfex/surfex.R @@ -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") input_script <- normalizePath("../share/poet/bench/surfex/SurfExBase.pqi") @@ -40,11 +40,7 @@ init_cell <- list(H = 1.476571028625e-01, grid <- list( n_cells = c(n, m), s_cells = c(1, 1), - type = "scratch", - init_cell = as.data.frame(init_cell, check.names = FALSE), - props = names(init_cell), - database = database, - input_script = input_script + type = "scratch" ) diff --git a/docs/Input_Scripts.md b/docs/Input_Scripts.md index 305ac554f..1c03de749 100644 --- a/docs/Input_Scripts.md +++ b/docs/Input_Scripts.md @@ -13,10 +13,6 @@ by POET. | `n_cells` | Numeric Vector | Number of cells 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* | -| `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 @@ -70,10 +66,12 @@ vecinj_index <- list( ## Chemistry parameters -| name | type | description | -|----------------|--------|-----------------------------------| -| `database` | String | Path to the Phreeqc database | -| `input_script` | String | Path the the Phreeqc input script | +| name | type | description | +|----------------|--------------|----------------------------------------------------------------------------------| +| `database` | String | Path to the Phreeqc database | +| `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 @@ -86,10 +84,3 @@ vecinj_index <- list( | `timesteps` | Numeric Vector | $\Delta t$ to use for specific iteration | | `store_result` | Boolean | Indicates if results 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* | diff --git a/include/poet/SimParams.hpp b/include/poet/SimParams.hpp index 8a28624df..5651f98d6 100644 --- a/include/poet/SimParams.hpp +++ b/include/poet/SimParams.hpp @@ -240,11 +240,12 @@ private: std::list validateOptions(argh::parser cmdl); const std::set flaglist{ - "ignore-result", "dht", "dht-nolog", "P", "progress", "interp"}; + "ignore-result", "dht", "P", "progress", "interp"}; const std::set paramlist{ - "work-package-size", "dht-signif", "dht-strategy", - "dht-size", "dht-snaps", "dht-file", - "interp-size", "interp-min", "interp-bucket-entries"}; + "work-package-size", "dht-strategy", + "dht-size", "dht-snaps", + "dht-file", "interp-size", + "interp-min", "interp-bucket-entries"}; t_simparams simparams; diff --git a/src/SimParams.cpp b/src/SimParams.cpp index 80c0015b5..95244b6fa 100644 --- a/src/SimParams.cpp +++ b/src/SimParams.cpp @@ -56,14 +56,6 @@ poet::GridParams::s_GridParams(RInside &R) { (dim == 1 ? this->n_cells[0] : this->n_cells[0] * this->n_cells[1]); this->type = Rcpp::as(R.parseEval("mysetup$grid$type")); - this->init_df = - Rcpp::as(R.parseEval("mysetup$grid$init_cell")); - this->props = - Rcpp::as>(R.parseEval("mysetup$grid$props")); - this->input_script = - Rcpp::as(R.parseEval("mysetup$grid$input_script")); - this->database_path = - Rcpp::as(R.parseEval("mysetup$grid$database")); } poet::DiffusionParams::s_DiffusionParams(RInside &R) {