diff --git a/src/ModelTree.cc b/src/ModelTree.cc index 9f691dcf3bfa50f0c87d9adc57af09a52946ecdc..be74443be90eab919c5224e36fde34f2b1fe6a76 100644 --- a/src/ModelTree.cc +++ b/src/ModelTree.cc @@ -357,6 +357,7 @@ ModelTree::evaluateAndReduceJacobian(const eval_context_t &eval_context) const jacob_map_t contemporaneous_jacobian; for (const auto &[indices, d1] : derivatives[1]) { + auto &d11 = d1; int deriv_id = indices[1]; if (getTypeByDerivID(deriv_id) == SymbolType::endogenous) { @@ -367,7 +368,7 @@ ModelTree::evaluateAndReduceJacobian(const eval_context_t &eval_context) const { try { - return d1->eval(eval_context); + return d11->eval(eval_context); } catch (ExprNode::EvalExternalFunctionException &e) { @@ -1880,10 +1881,11 @@ ModelTree::initializeMEXCompilationWorkers(int numworkers) unique_lock<mutex> lk {mex_compilation_mut}; filesystem::path output; string cmd; - + */ /* Look for an object to compile, whose prerequisites are already compiled. If found, remove it from the queue, save the output path and the compilation command, and return true. Must be run under the lock. */ + /* auto pick_job = [&cmd, &output] { for (auto it {mex_compilation_queue.begin()}; it != mex_compilation_queue.end(); ++it) @@ -1912,10 +1914,14 @@ ModelTree::initializeMEXCompilationWorkers(int numworkers) else mex_compilation_done.insert(output); /* The object just compiled may be a prerequisite for several + mex_compilation_done.insert(output); + */ + /* The object just compiled may be a prerequisite for several other objects, so notify all waiting workers. Also needed to notify the main thread when in ModelTree::waitForMEXCompilationWorkers().*/ - mex_compilation_cv.notify_all(); + /* + mex_compilation_cv.notify_all(); } }); */