Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/05/11 22:43:07 (13 years ago)
Author:
cneumuel
Message:

#1233

  • svn fixes
Location:
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.HiveEngine/3.4
Files:
1 deleted
1 edited
5 copied

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.HiveEngine/3.4/HiveEngine.cs

    r6357 r6358  
    150150
    151151        next = executionStack.Pop();
    152         bool isOpCollection = next is OperationCollection;
    153         int collCount = isOpCollection ? ((OperationCollection)next).Count : 0;
    154         string opName = !isOpCollection ? ((IAtomicOperation)next).Operator.Name : "OpCollection";
     152        //bool isOpCollection = next is OperationCollection;
     153        //int collCount = isOpCollection ? ((OperationCollection)next).Count : 0;
     154        //string opName = !isOpCollection ? ((IAtomicOperation)next).Operator.Name : "OpCollection";
    155155
    156156        if (next is OperationCollection) {
    157157          coll = (OperationCollection)next;
    158158
    159           bool isPMOEvaluator = coll.Count > 0 && coll.First() is HeuristicLab.Core.ExecutionContext && ((HeuristicLab.Core.ExecutionContext)coll.First()).Operator.GetType().Name == "PMOEvaluator";
    160           bool isAlgorithmEvaluator = coll.Count > 0 && coll.First() is HeuristicLab.Core.ExecutionContext && ((HeuristicLab.Core.ExecutionContext)coll.First()).Operator.GetType().Name == "AlgorithmEvaluator";
    161 
    162           if (coll.Parallel && isPMOEvaluator) {
    163             Task[] tasks = new Task[coll.Count];
    164             Stack<IOperation>[] stacks = new Stack<IOperation>[coll.Count];
    165             for (int i = 0; i < coll.Count; i++) {
    166               stacks[i] = new Stack<IOperation>();
    167               stacks[i].Push(coll[i]);
    168               tasks[i] = Task.Factory.StartNew(Run, stacks[i], cancellationToken);
    169             }
    170             try {
    171               Task.WaitAll(tasks);
    172             }
    173             catch (AggregateException ex) {
    174               OperationCollection remaining = new OperationCollection() { Parallel = true };
    175               for (int i = 0; i < stacks.Length; i++) {
    176                 if (stacks[i].Count == 1)
    177                   remaining.Add(stacks[i].Pop());
    178                 if (stacks[i].Count > 1) {
    179                   OperationCollection ops = new OperationCollection();
    180                   while (stacks[i].Count > 0)
    181                     ops.Add(stacks[i].Pop());
    182                   remaining.Add(ops);
    183                 }
    184               }
    185               if (remaining.Count > 0) executionStack.Push(remaining);
    186               throw ex;
    187             }
    188           } else if (coll.Parallel) {
     159          //bool isPMOEvaluator = coll.Count > 0 && coll.First() is HeuristicLab.Core.ExecutionContext && ((HeuristicLab.Core.ExecutionContext)coll.First()).Operator.GetType().Name == "PMOEvaluator";
     160          //bool isAlgorithmEvaluator = coll.Count > 0 && coll.First() is HeuristicLab.Core.ExecutionContext && ((HeuristicLab.Core.ExecutionContext)coll.First()).Operator.GetType().Name == "AlgorithmEvaluator";
     161
     162          //if (coll.Parallel && isPMOEvaluator) {
     163          //  Task[] tasks = new Task[coll.Count];
     164          //  Stack<IOperation>[] stacks = new Stack<IOperation>[coll.Count];
     165          //  for (int i = 0; i < coll.Count; i++) {
     166          //    stacks[i] = new Stack<IOperation>();
     167          //    stacks[i].Push(coll[i]);
     168          //    tasks[i] = Task.Factory.StartNew(Run, stacks[i], cancellationToken);
     169          //  }
     170          //  try {
     171          //    Task.WaitAll(tasks);
     172          //  }
     173          //  catch (AggregateException ex) {
     174          //    OperationCollection remaining = new OperationCollection() { Parallel = true };
     175          //    for (int i = 0; i < stacks.Length; i++) {
     176          //      if (stacks[i].Count == 1)
     177          //        remaining.Add(stacks[i].Pop());
     178          //      if (stacks[i].Count > 1) {
     179          //        OperationCollection ops = new OperationCollection();
     180          //        while (stacks[i].Count > 0)
     181          //          ops.Add(stacks[i].Pop());
     182          //        remaining.Add(ops);
     183          //      }
     184          //    }
     185          //    if (remaining.Count > 0) executionStack.Push(remaining);
     186          //    throw ex;
     187          //  }
     188          //} else if (coll.Parallel) {
     189          if(coll.Parallel) {
    189190            // clone the parent scope here and reuse it for each operation. otherwise for each job the whole scope-tree first needs to be copied and then cleaned, which causes a lot of work for the Garbage Collector
    190191            IScope parentScopeClone = (IScope)((IAtomicOperation)coll.First()).Scope.Parent.Clone();
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.HiveEngine/3.4/Tests

    • Property svn:ignore
      •  

        old new  
        33HeuristicLab.HiveEngine.Test.csproj.vs10x
        44HeuristicLab.HiveEngine.Test.csproj.user
         5HeuristicLab.HiveEngine-3.4.Tests.csproj.vs10x
         6Meta-GA - Meta Optimization Problem (Genetic Programming - Symbolic Regression 3.4 scaled)_small.hl
Note: See TracChangeset for help on using the changeset viewer.