Changeset 9363 for branches/OaaS/HeuristicLab.ParallelEngine
- Timestamp:
- 04/16/13 13:13:41 (12 years ago)
- Location:
- branches/OaaS
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/OaaS
- Property svn:ignore
-
old new 21 21 protoc.exe 22 22 _ReSharper.HeuristicLab 3.3 Tests 23 Google.ProtocolBuffers-2.4.1.473.dll 23 24 packages
-
- Property svn:mergeinfo changed
- Property svn:ignore
-
branches/OaaS/HeuristicLab.ParallelEngine/3.3
- Property svn:ignore
-
old new 5 5 HeuristicLab.ParallelEngine-3.3.csproj.user 6 6 Plugin.cs 7 *.user
-
- Property svn:ignore
-
branches/OaaS/HeuristicLab.ParallelEngine/3.3/HeuristicLab.ParallelEngine-3.3.csproj
r6866 r9363 145 145 <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> 146 146 <PropertyGroup> 147 <PreBuildEvent>set Path=%25Path%25;$(ProjectDir);$(SolutionDir)147 <PreBuildEvent Condition=" '$(OS)' == 'Windows_NT' ">set Path=%25Path%25;$(ProjectDir);$(SolutionDir) 148 148 set ProjectDir=$(ProjectDir) 149 149 set SolutionDir=$(SolutionDir) … … 151 151 152 152 call PreBuildEvent.cmd 153 </PreBuildEvent> 154 <PreBuildEvent Condition=" '$(OS)' != 'Windows_NT' "> 155 export ProjectDir=$(ProjectDir) 156 export SolutionDir=$(SolutionDir) 157 158 $SolutionDir/PreBuildEvent.sh 153 159 </PreBuildEvent> 154 160 </PropertyGroup> -
branches/OaaS/HeuristicLab.ParallelEngine/3.3/ParallelEngine.cs
r7259 r9363 37 37 public class ParallelEngine : Engine { 38 38 private CancellationToken cancellationToken; 39 private ParallelOptions parallelOptions; 40 41 [Storable(DefaultValue = -1)] 42 private int degreeOfParallelism; 43 public int DegreeOfParallelism { 44 get { return degreeOfParallelism; } 45 set { 46 if (degreeOfParallelism != value) { 47 degreeOfParallelism = value; 48 OnDegreeOfParallelismChanged(); 49 } 50 } 51 } 39 52 40 53 [StorableConstructor] 41 54 protected ParallelEngine(bool deserializing) : base(deserializing) { } 42 protected ParallelEngine(ParallelEngine original, Cloner cloner) : base(original, cloner) { } 43 public ParallelEngine() : base() { } 55 protected ParallelEngine(ParallelEngine original, Cloner cloner) 56 : base(original, cloner) { 57 this.DegreeOfParallelism = original.DegreeOfParallelism; 58 } 59 public ParallelEngine() 60 : base() { 61 this.degreeOfParallelism = -1; 62 } 44 63 45 64 public override IDeepCloneable Clone(Cloner cloner) { … … 47 66 } 48 67 68 public event EventHandler DegreeOfParallelismChanged; 69 protected void OnDegreeOfParallelismChanged() { 70 var handler = DegreeOfParallelismChanged; 71 if (handler != null) handler(this, EventArgs.Empty); 72 } 73 74 49 75 protected override void Run(CancellationToken cancellationToken) { 50 76 this.cancellationToken = cancellationToken; 77 parallelOptions = new ParallelOptions(); 78 parallelOptions.MaxDegreeOfParallelism = DegreeOfParallelism; 51 79 Run(ExecutionStack); 52 80 } … … 65 93 coll = (OperationCollection)next; 66 94 if (coll.Parallel) { 67 Task[] tasks = new Task[coll.Count];68 95 Stack<IOperation>[] stacks = new Stack<IOperation>[coll.Count]; 69 96 for (int i = 0; i < coll.Count; i++) { 70 97 stacks[i] = new Stack<IOperation>(); 71 98 stacks[i].Push(coll[i]); 72 tasks[i] = Task.Factory.StartNew(Run, stacks[i], cancellationToken);73 99 } 74 100 try { 75 Task.WaitAll(tasks);101 Parallel.ForEach(stacks, parallelOptions, Run); 76 102 } 77 103 catch (AggregateException ex) { -
branches/OaaS/HeuristicLab.ParallelEngine/3.3/Plugin.cs.frame
r7259 r9363 29 29 /// Plugin class for HeuristicLab.ParallelEngine plugin. 30 30 /// </summary> 31 [Plugin("HeuristicLab.ParallelEngine", "3.3. 6.$WCREV$")]31 [Plugin("HeuristicLab.ParallelEngine", "3.3.7.$WCREV$")] 32 32 [PluginFile("HeuristicLab.ParallelEngine-3.3.dll", PluginFileType.Assembly)] 33 33 [PluginDependency("HeuristicLab.Common", "3.3")] -
branches/OaaS/HeuristicLab.ParallelEngine/3.3/Properties/AssemblyInfo.cs.frame
r7259 r9363 54 54 // by using the '*' as shown below: 55 55 [assembly: AssemblyVersion("3.3.0.0")] 56 [assembly: AssemblyFileVersion("3.3. 6.$WCREV$")]56 [assembly: AssemblyFileVersion("3.3.7.$WCREV$")]
Note: See TracChangeset
for help on using the changeset viewer.