Skip to content
Snippets Groups Projects
Verified Commit 27a8b3b7 authored by Stéphane Adjemian's avatar Stéphane Adjemian
Browse files

Added preprocessor option: notime.

Do not print the total computing time at the end of the driver.
parent daa8d016
No related branches found
No related tags found
No related merge requests found
Pipeline #3455 passed
......@@ -57,7 +57,7 @@ usage()
<< " [-D<variable>[=<value>]] [-I/path] [nostrict] [stochastic] [fast] [minimal_workspace] [compute_xrefs] [output=dynamic|first|second|third] [language=matlab|julia]"
<< " [params_derivs_order=0|1|2] [transform_unary_ops] [exclude_eqs=<equation_tag_list_or_file>] [include_eqs=<equation_tag_list_or_file>]"
<< " [json=parse|check|transform|compute] [jsonstdout] [onlyjson] [jsonderivsimple] [nopathchange] [nopreprocessoroutput]"
<< " [mexext=<extension>] [matlabroot=<path>] [onlymodel]"
<< " [mexext=<extension>] [matlabroot=<path>] [onlymodel] [notime]"
<< endl;
exit(EXIT_FAILURE);
}
......@@ -123,6 +123,7 @@ main(int argc, char **argv)
options.emplace_back(argv[arg]);
// Parse options
bool notime = false;
bool clear_all = true;
bool clear_global = false;
bool save_macro = false;
......@@ -170,6 +171,8 @@ main(int argc, char **argv)
{
if (s == "debug")
debug = true;
else if (s == "notime")
notime = true;
else if (s == "noclearall")
clear_all = false;
else if (s.substr(0, 19) == "params_derivs_order")
......@@ -479,7 +482,7 @@ main(int argc, char **argv)
else
mod_file->writeOutputFiles(basename, clear_all, clear_global, no_log, no_warn, console, nograph,
nointeractive, config_file, check_model_changes, minimal_workspace, compute_xrefs,
mexext, matlabroot, dynareroot, onlymodel, gui);
mexext, matlabroot, dynareroot, onlymodel, gui, notime);
cout << "Preprocessing completed." << endl;
return EXIT_SUCCESS;
......
......@@ -840,7 +840,7 @@ ModFile::writeOutputFiles(const string &basename, bool clear_all, bool clear_glo
bool check_model_changes, bool minimal_workspace, bool compute_xrefs,
const string &mexext,
const filesystem::path &matlabroot,
const filesystem::path &dynareroot, bool onlymodel, bool gui) const
const filesystem::path &dynareroot, bool onlymodel, bool gui, bool notime) const
{
bool hasModelChanged = !dynamic_model.isChecksumMatching(basename, block) || !check_model_changes;
if (hasModelChanged)
......@@ -1098,10 +1098,11 @@ ModFile::writeOutputFiles(const string &basename, bool clear_all, bool clear_glo
<< " save('" << basename << "_results.mat', 'oo_recursive_', '-append');" << endl << "end" << endl;
config_file.writeEndParallel(mOutputFile);
if (!notime)
{
mOutputFile << endl << endl
<< "disp(['Total computing time : ' dynsec2hms(toc(tic0)) ]);" << endl;
}
if (!no_warn)
  • Note that the braces are not needed in this case, since there is a single statement in the if-branch.

  • Contributor

    Also note that if notime is passed, we shouldn't print the line "tic0 = tic;" to the driver file

  • Author Owner

    Thanks, I will change that.

  • Please register or sign in to reply
{
if (warnings.countWarnings() > 0)
......
......@@ -168,7 +168,7 @@ public:
bool console, bool nograph, bool nointeractive, const ConfigFile &config_file,
bool check_model_changes, bool minimal_workspace, bool compute_xrefs,
const string &mexext, const filesystem::path &matlabroot,
const filesystem::path &dynareroot, bool onlymodel, bool gui) const;
const filesystem::path &dynareroot, bool onlymodel, bool gui, bool notime) const;
void writeExternalFiles(const string &basename, LanguageOutputType language) const;
void writeExternalFilesJulia(const string &basename) const;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment