Free cookie consent management tool by TermsFeed Policy Generator

Changeset 412


Ignore:
Timestamp:
07/31/08 00:15:31 (16 years ago)
Author:
gkronber
Message:

fixed #212

Location:
trunk/sources
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.DistributedEngine/DistributedEngine.cs

    r383 r412  
    130130            foreach(AtomicOperation parOperation in compositeOperation.Operations) {
    131131              ProcessingEngine resultEngine = jobManager.EndExecuteOperation(parOperation);
    132               if(resultEngine.ExecutionStack.Count > 0) {
    133                 // when there are operations left in the execution stack it means that the engine has been aborted
    134                 // for unkown reason. Probably there was a problem at the client, so we can try to execute the steps locally.
     132              if(resultEngine.Canceled) {
     133                // When the engine was canceled because of a problem at the client we can try to execute the steps locally.
    135134                // If they also fail the (local) distributued-engine will be aborted and we will see an error-message.
    136                 // Solution: We could push all waiting operations in the execution stack of the result engine into our own
    137                 // execution stack, but this is not easy because we have to change the operations to point to the
    138                 // original scopes instead of the new scopes (created while deserializing the processing engine).
    139                 // Instead just push the original parallel operation back on the stack to force local execution.
     135                // so just push the original parallel operation back on the stack to force local execution.
    140136                ExecutionStack.Push(parOperation);
    141137              } else {
     
    182178        prunedScopes.Add(subScopes);
    183179        // remove all my sub-scopes
    184         foreach(IScope subScope in subScopes) { 
     180        foreach(IScope subScope in subScopes) {
    185181          currentScope.RemoveSubScope(subScope);
    186182        }
  • trunk/sources/HeuristicLab.Grid/ClientForm.cs

    r402 r412  
    151151
    152152    void currentEngine_Finished(object sender, EventArgs e) {
    153       IEngine engine = (IEngine)sender;
     153      ProcessingEngine engine = (ProcessingEngine)sender;
     154
     155      // if the engine was stopped because of an error it's not necessary to return the whole engine
     156      // instead just return an empty engine that has the aborted flag set
     157      if(engine.Canceled) {
     158        engine.Reset();
     159        engine.OperatorGraph.Clear();
     160        engine.Abort();
     161      }
     162
    154163      byte[] resultXml = SaveEngine(engine);
    155164      bool success = false;
  • trunk/sources/HeuristicLab.Grid/ProcessingEngine.cs

    r411 r412  
    4848    public override XmlNode GetXmlNode(string name, XmlDocument document, IDictionary<Guid, IStorable> persistedObjects) {
    4949      XmlNode node = base.GetXmlNode(name, document, persistedObjects);
     50      XmlAttribute canceledAttr = document.CreateAttribute("Canceled");
     51      canceledAttr.Value = Canceled.ToString();
     52      node.Attributes.Append(canceledAttr);
    5053      node.AppendChild(PersistenceManager.Persist("InitialOperation", initialOperation, document, persistedObjects));
    5154      return node;
     
    5457    public override void Populate(XmlNode node, IDictionary<Guid, IStorable> restoredObjects) {
    5558      base.Populate(node, restoredObjects);
     59      myCanceled = bool.Parse(node.Attributes["Canceled"].Value);
    5660      initialOperation = (AtomicOperation)PersistenceManager.Restore(node.SelectSingleNode("InitialOperation"), restoredObjects);
    5761    }
Note: See TracChangeset for help on using the changeset viewer.