From b4c87b986f861f4c98ebd4c528a4c34929db2c96 Mon Sep 17 00:00:00 2001 From: MichelJuillard <michel.juillard@mjui.fr> Date: Sun, 20 Nov 2022 10:33:27 +0100 Subject: [PATCH] don't do block decomposition when language is julia (cherry picked from commit 0e54599aa450ce7968d73f1e51f9dc4429b437b9) --- src/DynamicModel.cc | 17 ++++++++++------- src/DynareMain.cc | 5 +++++ src/StaticModel.cc | 11 +++++++---- 3 files changed, 22 insertions(+), 11 deletions(-) diff --git a/src/DynamicModel.cc b/src/DynamicModel.cc index a6d8f2fe..4d53def0 100644 --- a/src/DynamicModel.cc +++ b/src/DynamicModel.cc @@ -2949,13 +2949,16 @@ DynamicModel::computingPass(int derivsOrder, int paramsDerivsOrder, const eval_c if (paramsDerivsOrder > 0 && !no_tmp_terms) computeParamsDerivativesTemporaryTerms(); - computingPassBlock(eval_context, no_tmp_terms); - if (block_decomposed) - computeBlockDynJacobianCols(); - if (!block_decomposed && block) - { - cerr << "ERROR: Block decomposition requested but failed." << endl; - exit(EXIT_FAILURE); + if (block) + { + computingPassBlock(eval_context, no_tmp_terms); + if (block_decomposed) + computeBlockDynJacobianCols(); + if (!block_decomposed && block) + { + cerr << "ERROR: Block decomposition requested but failed." << endl; + exit(EXIT_FAILURE); + } } } diff --git a/src/DynareMain.cc b/src/DynareMain.cc index 4acd1bd2..72b8735e 100644 --- a/src/DynareMain.cc +++ b/src/DynareMain.cc @@ -523,6 +523,11 @@ main(int argc, char **argv) mod_file->evalAllExpressions(warn_uninit); // Do computations + if (language == LanguageOutputType::julia) + mod_file -> block = false; + else + mod_file -> block = true; + mod_file->computingPass(no_tmp_terms, output_mode, params_derivs_order); if (json == JsonOutputPointType::computingpass) mod_file->writeJsonOutput(basename, json, json_output_mode, onlyjson, jsonderivsimple); diff --git a/src/StaticModel.cc b/src/StaticModel.cc index 192b06dc..b90e8f3a 100644 --- a/src/StaticModel.cc +++ b/src/StaticModel.cc @@ -382,11 +382,14 @@ StaticModel::computingPass(int derivsOrder, int paramsDerivsOrder, const eval_co if (paramsDerivsOrder > 0 && !no_tmp_terms) computeParamsDerivativesTemporaryTerms(); - computingPassBlock(eval_context, no_tmp_terms); - if (!block_decomposed && block) + if (block) { - cerr << "ERROR: Block decomposition requested but failed. If your model does not have a steady state, you may want to try the 'no_static' option of the 'model' block." << endl; - exit(EXIT_FAILURE); + computingPassBlock(eval_context, no_tmp_terms); + if (!block_decomposed && block) + { + cerr << "ERROR: Block decomposition requested but failed. If your model does not have a steady state, you may want to try the 'no_static' option of the 'model' block." << endl; + exit(EXIT_FAILURE); + } } } -- GitLab