Changeset 412
- Timestamp:
- 07/31/08 00:15:31 (16 years ago)
- Location:
- trunk/sources
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.DistributedEngine/DistributedEngine.cs
r383 r412 130 130 foreach(AtomicOperation parOperation in compositeOperation.Operations) { 131 131 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. 135 134 // 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. 140 136 ExecutionStack.Push(parOperation); 141 137 } else { … … 182 178 prunedScopes.Add(subScopes); 183 179 // remove all my sub-scopes 184 foreach(IScope subScope in subScopes) { 180 foreach(IScope subScope in subScopes) { 185 181 currentScope.RemoveSubScope(subScope); 186 182 } -
trunk/sources/HeuristicLab.Grid/ClientForm.cs
r402 r412 151 151 152 152 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 154 163 byte[] resultXml = SaveEngine(engine); 155 164 bool success = false; -
trunk/sources/HeuristicLab.Grid/ProcessingEngine.cs
r411 r412 48 48 public override XmlNode GetXmlNode(string name, XmlDocument document, IDictionary<Guid, IStorable> persistedObjects) { 49 49 XmlNode node = base.GetXmlNode(name, document, persistedObjects); 50 XmlAttribute canceledAttr = document.CreateAttribute("Canceled"); 51 canceledAttr.Value = Canceled.ToString(); 52 node.Attributes.Append(canceledAttr); 50 53 node.AppendChild(PersistenceManager.Persist("InitialOperation", initialOperation, document, persistedObjects)); 51 54 return node; … … 54 57 public override void Populate(XmlNode node, IDictionary<Guid, IStorable> restoredObjects) { 55 58 base.Populate(node, restoredObjects); 59 myCanceled = bool.Parse(node.Attributes["Canceled"].Value); 56 60 initialOperation = (AtomicOperation)PersistenceManager.Restore(node.SelectSingleNode("InitialOperation"), restoredObjects); 57 61 }
Note: See TracChangeset
for help on using the changeset viewer.