Docs: Description of Buid flag

This commit is contained in:
straile 2024-10-09 17:33:12 +02:00
parent d839ae4d5e
commit 3464ada1f1
4 changed files with 11 additions and 2 deletions

View File

@ -98,7 +98,11 @@ following available options:
slowed down significantly. Defaults to _OFF_. slowed down significantly. Defaults to _OFF_.
- **POET_PREPROCESS_BENCHS**=*boolean* - enables the preprocessing of - **POET_PREPROCESS_BENCHS**=*boolean* - enables the preprocessing of
predefined models/benchmarks. Defaults to *ON*. predefined models/benchmarks. Defaults to *ON*.
- **USE_AI_SURROGATE**=*boolean* - includes the functions of the AI
surrogate model. This relies on the presence of a Python environment
where Keras is installed.
### Example: Build from scratch ### Example: Build from scratch
Assuming that only the C/C++ compiler, MPI libraries, R runtime Assuming that only the C/C++ compiler, MPI libraries, R runtime
@ -318,7 +322,7 @@ precision is supported on that platform (e.g., nanoseconds).
The AI surrogate can be activated for any benchmark and is by default The AI surrogate can be activated for any benchmark and is by default
initiated as a sequential keras model with three hidden layer of depth initiated as a sequential keras model with three hidden layer of depth
48, 96, 24 with relu activation and adam optimizer. All functions in 48, 96, 24 with relu activation and adam optimizer. All functions in
`ai_surrogate_model.R` can be overridden by adding custom definitions `ai_surrogate_model_functions.R` can be overridden by adding custom definitions
via an R file in the input script. This is done by adding the path to via an R file in the input script. This is done by adding the path to
this file in the input script. Simply add the path as an element this file in the input script. Simply add the path as an element
called `ai_surrogate_input_script` to the `chemistry_setup` list. called `ai_surrogate_input_script` to the `chemistry_setup` list.

View File

@ -119,6 +119,7 @@ target_compile_definitions(POETLib PUBLIC STRICT_R_HEADERS OMPI_SKIP_MPICXX)
file(READ "${PROJECT_SOURCE_DIR}/R_lib/kin_r_library.R" R_KIN_LIB ) file(READ "${PROJECT_SOURCE_DIR}/R_lib/kin_r_library.R" R_KIN_LIB )
file(READ "${PROJECT_SOURCE_DIR}/R_lib/init_r_lib.R" R_INIT_LIB) file(READ "${PROJECT_SOURCE_DIR}/R_lib/init_r_lib.R" R_INIT_LIB)
file(READ "${PROJECT_SOURCE_DIR}/R_lib/ai_surrogate_model_functions.R" R_AI_SURROGATE_LIB)
configure_file(poet.hpp.in poet.hpp @ONLY) configure_file(poet.hpp.in poet.hpp @ONLY)

View File

@ -583,6 +583,8 @@ int main(int argc, char *argv[]) {
chemistry.masterSetField(init_list.getInitialGrid()); chemistry.masterSetField(init_list.getInitialGrid());
if (run_params.use_ai_surrogate) { if (run_params.use_ai_surrogate) {
// Load default function implementations
R.parseEvalQ(ai_surrogate_r_library);
/* Use dht species for model input and output */ /* Use dht species for model input and output */
R["ai_surrogate_species"] = R["ai_surrogate_species"] =
init_list.getChemistryInit().dht_species.getNames(); init_list.getChemistryInit().dht_species.getNames();

View File

@ -36,6 +36,8 @@ static const char *poet_version = "@POET_VERSION@";
// using the Raw string literal to avoid escaping the quotes // using the Raw string literal to avoid escaping the quotes
static const inline std::string kin_r_library = R"(@R_KIN_LIB@)"; static const inline std::string kin_r_library = R"(@R_KIN_LIB@)";
static const inline std::string init_r_library = R"(@R_INIT_LIB@)"; static const inline std::string init_r_library = R"(@R_INIT_LIB@)";
static const inline std::string ai_surrogate_r_library =
R"(@R_AI_SURROGATE_LIB@)";
static const inline std::string r_runtime_parameters = "mysetup"; static const inline std::string r_runtime_parameters = "mysetup";
struct RuntimeParameters { struct RuntimeParameters {