Max Luebke 3fdf586e0d BREAKING CHANGE: use dump mechanism of PhreeqcRM-GFZ to get and set
internal variables

feat: enables exchange

data: added exchange only benchmark

data: applied required changes to benchmarks
2023-04-17 12:37:43 +02:00
2023-03-03 15:41:11 +01:00
2023-03-07 13:44:41 +01:00
2023-03-07 13:44:41 +01:00
2023-03-03 15:41:11 +01:00
2021-02-26 19:33:04 +01:00
2021-02-09 17:39:10 +01:00

POET

POET is a coupled reactive transport simulator implementing a parallel architecture and a fast, original MPI-based Distributed Hash Table.

PORT's Coupling Scheme

Parsed code documentiation

A parsed version of POET's documentiation can be found at Gitlab pages.

External Libraries

The following external header library is shipped with POET:

Installation

Requirements

To compile POET you need several software to be installed:

  • C/C++ compiler (tested with GCC)
  • MPI-Implementation (tested with OpenMPI and MVAPICH)
  • R language and environment
  • CMake 3.9+
  • optional: doxygen with dot bindings for documentiation

The following R libraries must then be installed, which will get the needed dependencies automatically:

Compiling source code

The generation of makefiles is done with CMake. You should be able to generate Makefiles by running:

mkdir build && cd build
cmake ..

This will create the directory build and processes the CMake files and generate Makefiles from it. You're now able to run make to start build process.

If everything went well you'll find the executable at build/app/poet, but it is recommended to install the POET project structure to a desired CMAKE_INSTALL_PREFIX with make install.

During the generation of Makefiles, various options can be specified via cmake -D <option>=<value> [...]. Currently, there are the following available options:

  • POET_DHT_Debug=boolean - toggles the output of detailed statistics about DHT usage. Defaults to OFF.
  • POET_ENABLE_TESTING=boolean - enables small set of unit tests (more to come). Defaults to OFF.
  • POET_USE_PRM_BACKEND=bollean - use the PhreeqcRM parallelization instead of POET's one. Intended for debugging purposes for modellers.

Example: Build from scratch

Assuming that only the C/C++ compiler, MPI libraries, R runtime environment and CMake have been installed, POET can be installed as follows:

# start R environment
$ R

# install R dependencies
> install.packages(c("Rcpp", "RInside"))
> q(save="no")

# cd into POET project root
$ cd <POET_dir>

# Build process
$ mkdir build && cd build
$ cmake -DCMAKE_INSTALL_PREFIX=/home/<user>/poet ..
$ make -j<max_numprocs>
$ make install

This will install a POET project structure into /home/<user>/poet which is called hereinafter <POET_INSTALL_DIR>. With this version of POET we do not recommend to install to hierarchies like /usr/local/ etc.

The correspondending directory tree would look like this:

poet
├── bin
│   └── poet
├── R_lib
│   └── 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

The R libraries will be loaded at runtime and the paths are hardcoded 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.

Running

Run POET by mpirun ./poet <OPTIONS> <SIMFILE> <OUTPUT_DIRECTORY> where:

  • OPTIONS - runtime parameters (explained below)
  • SIMFILE - simulation described as R script (e.g. <POET_INSTALL_DIR>/share/examples/SimDol2D_diffu.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= <SNAPSHOT> 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.

Additions to dht-snaps

Following values can be set:

  • 0 = snapshots are disabled
  • 1 = only stores snapshot at the end of the simulation with name <OUTPUT_DIRECTORY>.dht
  • 2 = stores snapshot at the end and after each iteration iteration snapshot files are stored in <DIRECTORY>/iter<n>.dht

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. It's a 2D, 100x100 grid, simulating 10 time steps. To start the simulation with 4 processes cd into your previously installed POET-dir <POET_INSTALL_DIR>/bin and run:

mpirun -n 4 ./poet ../share/poet/examples/SimDol2D_diffu.R output

After a finished simulation all data generated by POET will be found in the directory output.

You might want to use the DHT to cache previously simulated data and reuse them in further time-steps. Just append --dht to the options of POET to activate the usage of the DHT. Also, after each iteration a DHT snapshot shall be produced. This is done by appending the --dht-snaps=<value> option. The resulting call would look like this:

mpirun -n 4 ./poet --dht --dht-snaps=2 ../share/poet/examples/SimDol2D_diffu.R output

About the usage of MPI_Wtime()

Implemented time measurement functions uses MPI_Wtime(). Some important information from the OpenMPI Man Page:

For example, on platforms that support it, the clock_gettime() function will be used to obtain a monotonic clock value with whatever precision is supported on that platform (e.g., nanoseconds).

Description
Massively parallel reactive transport simulator exploring acceleration strategies such as embedding of AI/ML and cache of results in Distributed Hash Tables. Developed in cooperation with computer scientists of University of Potsdam.
Readme GPL-2.0 8.9 GiB
Languages
C++ 59.8%
R 23.9%
C 10.8%
CMake 3.2%
Dockerfile 1.1%
Other 1.2%