diff --git a/Common/onelab.h b/Common/onelab.h index edea591e93c0b0b0b2b1b14e1039d98677f334c9..d37b23b4ce9c8afca55f990f4af22e74e38407a1 100644 --- a/Common/onelab.h +++ b/Common/onelab.h @@ -771,17 +771,16 @@ namespace onelab{ return false; } // if no client name is given, set the changed flag for all the parameters; - // if a client name is given and "changed" is false, affect only the - // parameters that are owned exclusively by the client; if "changed" is - // true, affect all parameters that depend on this client - bool setChanged(bool changed, const std::string &client="") + // if a client name is given, affect parameters that are (exclusively if + // "exclusive" is set) owned by the client + bool setChanged(bool changed, const std::string &client="", bool exclusive=false) { std::set<parameter*, parameterLessThan> ps; _getAllParameters(ps); for(std::set<parameter*, parameterLessThan>::iterator it = ps.begin(); it != ps.end(); it++) if(client.empty() || ((*it)->hasClient(client) && - (changed || (*it)->getNumClients() == 1))) + (!exclusive || (*it)->getNumClients() == 1))) (*it)->setChanged(changed); return true; } @@ -958,9 +957,9 @@ namespace onelab{ c->setId(_clients.size()); } void unregisterClient(client *c){ _clients.erase(c->getName()); } - void setChanged(bool changed, const std::string &client="") + void setChanged(bool changed, const std::string &client="", bool exclusive=false) { - _parameterSpace.setChanged(changed, client); + _parameterSpace.setChanged(changed, client, exclusive); } bool getChanged(const std::string &client="") { diff --git a/Common/onelabUtils.cpp b/Common/onelabUtils.cpp index b152f8df5b7ad2c5eb742215bcc83fab61b36869..41ccc1f27ca87ea922fa75e7a48d80ee92a929f4 100644 --- a/Common/onelabUtils.cpp +++ b/Common/onelabUtils.cpp @@ -349,6 +349,11 @@ namespace onelabUtils { } } setFirstComputationFlag(false); + // don't set the "exclusive" flag here: otherwise Gmsh will re-run in a + // loop as soon as a shared parameter exists; this is OK because + // metamodels don't call runGmshClient, and the solver (e.g. GetDP) will + // always run anyway. The correct fix will of course to keep track of + // the "changed" status for each client onelab::server::instance()->setChanged(false, "Gmsh"); } diff --git a/Fltk/onelabGroup.cpp b/Fltk/onelabGroup.cpp index 9d06327281da26154a69f6d096e9de3a486b6b8a..597b77f11e491c4fe0ee909a3086fc97ce146113 100644 --- a/Fltk/onelabGroup.cpp +++ b/Fltk/onelabGroup.cpp @@ -911,7 +911,7 @@ void onelab_cb(Fl_Widget *w, void *data) if(action == "compute"){ // after computing with this solver, mark the parameters exclusively // owned by this solver as unchanged - onelab::server::instance()->setChanged(false, c->getName()); + onelab::server::instance()->setChanged(false, c->getName(), true); FlGui::instance()->onelab->checkForErrors(c->getName()); } if(FlGui::instance()->onelab->stop()) break; @@ -2134,6 +2134,7 @@ void solver_batch_cb(Fl_Widget *w, void *data) o.setValue("compute"); onelab::server::instance()->set(o); c->run(); + onelab::server::instance()->setChanged(false, c->getName(), true); } while(incrementLoops()); if(CTX::instance()->solver.autoSaveDatabase ||