From 13ad41d3026a592324e9c565097d6b497a7e20bc Mon Sep 17 00:00:00 2001 From: Hannes Signer Date: Fri, 6 Dec 2024 10:55:35 +0100 Subject: [PATCH] add naa-communication header --- src/poet.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/poet.cpp b/src/poet.cpp index 78cdff79c..7656659b7 100644 --- a/src/poet.cpp +++ b/src/poet.cpp @@ -44,6 +44,11 @@ #include #include #include +#include + +extern "C"{ +#include +} using namespace std; using namespace poet; @@ -311,6 +316,7 @@ static Rcpp::List RunMasterLoop(RInsidePOET &R, const RuntimeParameters ¶ms, params.use_clustering); if (!params.disable_training) { MSG("AI: Initialize training thread"); + // TODO add naa_handle as optional parameter which is NULL per default Python_Keras_training_thread(&Eigen_model, &Eigen_model_reactive, &Eigen_model_mutex, &training_data_buffer, &training_data_buffer_mutex, @@ -598,7 +604,7 @@ int main(int argc, char *argv[]) { // Threadsafe MPI is necessary for the AI surrogate // training thread int provided; - int required = MPI_THREAD_FUNNELED; + int required = MPI_THREAD_FUNNELED; // the application is multithreaded but MPI calls are only made from the main thread MPI_Init_thread(&argc, &argv, required, &provided); { @@ -651,6 +657,7 @@ int main(int argc, char *argv[]) { run_params.interp_size, run_params.interp_min_entries, run_params.use_ai_surrogate}; + // TODO add option for naa training chemistry.masterEnableSurrogates(surr_setup); @@ -697,6 +704,7 @@ int main(int argc, char *argv[]) { variable of the same name in one of the the R input scripts)*/ run_params.training_data_size = init_list.getDiffusionInit().n_rows * init_list.getDiffusionInit().n_cols; // Default value is number of cells in field + // ? error handling for all if statements if (Rcpp::as(R.parseEval("exists(\"batch_size\")"))) { run_params.batch_size = R["batch_size"]; }