diff --git a/src/DynareMain.cc b/src/DynareMain.cc index e16c7697e72699b8ba60ebe97d26b21ac7f79379..1cd02302432d6bfa86b58d1fa3f5dbb42f3c867d 100644 --- a/src/DynareMain.cc +++ b/src/DynareMain.cc @@ -502,9 +502,9 @@ main(int argc, char **argv) exit(EXIT_FAILURE); } - if (mod_file->use_dll) - ModelTree::initializeMEXCompilationWorkers(max(jthread::hardware_concurrency(), 1U), - dynareroot, mexext); + // if (mod_file->use_dll) + // ModelTree::initializeMEXCompilationWorkers(max(jthread::hardware_concurrency(), 1U), + // dynareroot, mexext); if (json == JsonOutputPointType::parsing) mod_file->writeJsonOutput(basename, json, json_output_mode, onlyjson); @@ -539,8 +539,8 @@ main(int argc, char **argv) /* Ensures that workers are not destroyed before they finish compiling. Also ensures that the preprocessor final message is printed after the end of compilation (and is not printed in case of compilation failure). */ - if (mod_file->use_dll) - ModelTree::waitForMEXCompilationWorkers(); + // if (mod_file->use_dll) + // ModelTree::waitForMEXCompilationWorkers(); cout << "Preprocessing completed." << endl; return EXIT_SUCCESS; diff --git a/src/ModelTree.cc b/src/ModelTree.cc index d02438a8a9479f2f718e81ed05316e158bdc713e..ffb4f1c994b10fe1d1d9effbeb48938daee816d5 100644 --- a/src/ModelTree.cc +++ b/src/ModelTree.cc @@ -45,7 +45,7 @@ condition_variable_any ModelTree::mex_compilation_cv; mutex ModelTree::mex_compilation_mut; vector<tuple<filesystem::path, set<filesystem::path>, string>> ModelTree::mex_compilation_queue; set<filesystem::path> ModelTree::mex_compilation_ongoing, ModelTree::mex_compilation_done, ModelTree::mex_compilation_failed; -vector<jthread> ModelTree::mex_compilation_workers; +// vector<jthread> ModelTree::mex_compilation_workers; void ModelTree::copyHelper(const ModelTree &m) @@ -1646,9 +1646,12 @@ ModelTree::findCompilerOnMacos(const string &mexext) } #endif + filesystem::path ModelTree::compileMEX(const filesystem::path &output_dir, const string &output_basename, const string &mexext, const vector<filesystem::path> &input_files, const filesystem::path &matlabroot, bool link) const { + + #if 0 assert(!mex_compilation_workers.empty()); const string gcc_opt_flags { "-O3 -g0 --param ira-max-conflict-table-size=1 -fno-forward-propagate -fno-gcse -fno-dce -fno-dse -fno-tree-fre -fno-tree-pre -fno-tree-cselim -fno-tree-dse -fno-tree-dce -fno-tree-pta -fno-gcse-after-reload" }; @@ -1706,8 +1709,12 @@ ModelTree::compileMEX(const filesystem::path &output_dir, const string &output_b } } + #endif + filesystem::path output_filename {output_dir / (output_basename + "." + (link ? mexext : "o"))}; + #if 0 + ostringstream cmd; #ifdef _WIN32 @@ -1771,9 +1778,12 @@ ModelTree::compileMEX(const filesystem::path &output_dir, const string &output_b lk.unlock(); mex_compilation_cv.notify_one(); + #endif + return output_filename; } + void ModelTree::reorderAuxiliaryEquations() { @@ -1897,6 +1907,8 @@ ModelTree::getRHSFromLHS(expr_t lhs) const throw ExprNode::MatchFailureException{"Cannot find an equation with the requested LHS"}; } +#if 0 + void ModelTree::initializeMEXCompilationWorkers(int numworkers, const filesystem::path &dynareroot, const string &mexext) @@ -1991,6 +2003,10 @@ ModelTree::initializeMEXCompilationWorkers(int numworkers, const filesystem::pat #endif } +#endif + +#if 0 + void ModelTree::waitForMEXCompilationWorkers() { @@ -2009,6 +2025,8 @@ ModelTree::waitForMEXCompilationWorkers() } } +#endif + void ModelTree::computingPassBlock(const eval_context_t &eval_context, bool no_tmp_terms) { diff --git a/src/ModelTree.hh b/src/ModelTree.hh index 88a2b11491b4e8dbf2355c8747c4945cd341349d..7eb410df5c9a22f680e9a51f541fa97cfcdc3dac 100644 --- a/src/ModelTree.hh +++ b/src/ModelTree.hh @@ -410,7 +410,7 @@ private: vector<int> endo2eq; // Stores workers used for compiling MEX files in parallel - static vector<jthread> mex_compilation_workers; + // static vector<jthread> mex_compilation_workers; /* The following variables implement the thread synchronization mechanism for limiting the number of concurrent GCC processes and tracking dependencies