diff --git a/doc/downloads/index.js b/doc/downloads/index.js index 66337147b0..205393a20e 100644 --- a/doc/downloads/index.js +++ b/doc/downloads/index.js @@ -38,7 +38,7 @@ var jsonData = { "versions": [ ], "changes": [ { "change": "General: make sure that we can find the plugin 'xcb' on some Linux machines (see issue #1383)." }, - { "change": "Simulation Experiment view: make sure that the runtime gets updated after having edited a CellML file (see issue #1385)." } + { "change": "Simulation Experiment view: make sure that the runtime gets updated after having edited a CellML file (see issue #1385). Don't check whether the memory associated with a simulation can be allocated (see issue #1389)." } ] }, { "major": 0, "minor": 4, "patch": 1, "day": 20, "month": 5, "year": 2015, "type": 0, diff --git a/doc/user/whatIsNew.js b/doc/user/whatIsNew.js index 49a01dde91..9ad5f15da1 100644 --- a/doc/user/whatIsNew.js +++ b/doc/user/whatIsNew.js @@ -57,6 +57,15 @@ var jsonData = { "versions": [ } ] }, + { "name": "Simulation", + "entries": [ + { "type": "subCategory", "name": "Simulation Experiment view (formerly known as the Single Cell view)", + "entries": [ + { "type": "Improved", "description": "Running of long simulations." } + ] + } + ] + }, { "name": "Support", "entries": [ { "type": "subCategory", "name": "CellML support", diff --git a/src/plugins/simulation/SimulationExperimentView/i18n/SimulationExperimentView_fr.ts b/src/plugins/simulation/SimulationExperimentView/i18n/SimulationExperimentView_fr.ts index 8f407f89c6..3f0a314ebf 100644 --- a/src/plugins/simulation/SimulationExperimentView/i18n/SimulationExperimentView_fr.ts +++ b/src/plugins/simulation/SimulationExperimentView/i18n/SimulationExperimentView_fr.ts @@ -426,12 +426,8 @@ Les paramètres suivants sont importés et ne peuvent donc pas être sauvegardés : - The simulation requires %1 of memory and you have only %2 left. - La simulation requiert %1 de mémoire et il ne vous en reste que %2. - - - We could not allocate the %1 of memory required for the simulation. - Nous n'avons pas pu allouer les %1 de mémoire nécessaires pour la simulation. + We could not allocate the memory required for the simulation. + Nous n'avons pas pu allouer la mémoire nécessaire pour la simulation. Export To SED-ML File diff --git a/src/plugins/simulation/SimulationExperimentView/src/simulationexperimentviewsimulationwidget.cpp b/src/plugins/simulation/SimulationExperimentView/src/simulationexperimentviewsimulationwidget.cpp index ebeab9e3c7..96c4de0269 100644 --- a/src/plugins/simulation/SimulationExperimentView/src/simulationexperimentviewsimulationwidget.cpp +++ b/src/plugins/simulation/SimulationExperimentView/src/simulationexperimentviewsimulationwidget.cpp @@ -1272,35 +1272,21 @@ void SimulationExperimentViewSimulationWidget::runPauseResumeSimulation() if (mSimulation->isPaused()) { mSimulation->resume(); } else { - // Check that we have enough memory to run our simulation + // Try to allocate all the memory we need for the simulation by + // resetting its settings - bool runSimulation = true; + bool runSimulation = mSimulation->results()->reset(); - double freeMemory = Core::freeMemory(); - double requiredMemory = mSimulation->requiredMemory(); - - if (requiredMemory > freeMemory) { - Core::warningMessageBox(tr("Run Simulation"), - tr("The simulation requires %1 of memory and you have only %2 left.").arg(Core::sizeAsString(requiredMemory), Core::sizeAsString(freeMemory))); - } else { - // Theoretically speaking, we have enough memory to run the - // simulation, so try to allocate all the memory we need for the - // simulation by resetting its settings - - runSimulation = mSimulation->results()->reset(); + // Run our simulation (after having cleared our plots), in case we + // were able to allocate all the memory we need + if (runSimulation) { mViewWidget->checkSimulationResults(mFileName, true); - // Note: this will, among other things, clear our plots... - - // Effectively run our simulation in case we were able to - // allocate all the memory we need to run the simulation - if (runSimulation) { - mSimulation->run(); - } else { - Core::warningMessageBox(tr("Run Simulation"), - tr("We could not allocate the %1 of memory required for the simulation.").arg(Core::sizeAsString(requiredMemory))); - } + mSimulation->run(); + } else { + Core::warningMessageBox(tr("Run Simulation"), + tr("We could not allocate the memory required for the simulation.")); } handlingAction = false; diff --git a/src/plugins/support/SimulationSupport/src/simulation.cpp b/src/plugins/support/SimulationSupport/src/simulation.cpp index ac3957c47e..992d90a7cf 100644 --- a/src/plugins/support/SimulationSupport/src/simulation.cpp +++ b/src/plugins/support/SimulationSupport/src/simulation.cpp @@ -1078,30 +1078,6 @@ void Simulation::setDelay(const int &pDelay) //============================================================================== -double Simulation::requiredMemory() -{ - // Determine and return the amount of required memory to run our simulation - // Note #1: we return the amount as a double rather than a qulonglong (as we - // do when retrieving the total/free amount of memory available; - // see [OpenCOR]/src/plugins/miscellaneous/Core/src/guiutils.cpp) - // in case a simulation requires an insane amount of memory... - // Note #2: the 1.0 is for mPoints in SimulationResults... - - if (mRuntime) { - return size() - *( 1.0 - +mRuntime->constantsCount() - +mRuntime->ratesCount() - +mRuntime->statesCount() - +mRuntime->algebraicCount()) - *Solver::SizeOfDouble; - } else { - return 0.0; - } -} - -//============================================================================== - bool Simulation::simulationSettingsOk(const bool &pEmitSignal) { // Check and return whether our simulation settings are sound diff --git a/src/plugins/support/SimulationSupport/src/simulation.h b/src/plugins/support/SimulationSupport/src/simulation.h index 0df4e63810..87ef1a0f48 100644 --- a/src/plugins/support/SimulationSupport/src/simulation.h +++ b/src/plugins/support/SimulationSupport/src/simulation.h @@ -258,8 +258,6 @@ class SIMULATIONSUPPORT_EXPORT Simulation : public QObject int delay() const; void setDelay(const int &pDelay); - double requiredMemory(); - double size(); bool run();