Changeset 4120 for branches/3.3-HiveMigration
- Timestamp:
- 07/29/10 16:58:35 (14 years ago)
- Location:
- branches/3.3-HiveMigration/sources/HeuristicLab.Hive
- Files:
-
- 7 added
- 2 deleted
- 23 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive 3.3.sln
r4111 r4120 154 154 {C92AAC8C-4D88-449C-ABA5-2B935D769842}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU 155 155 {C92AAC8C-4D88-449C-ABA5-2B935D769842}.Debug|x64.ActiveCfg = Debug|Any CPU 156 {C92AAC8C-4D88-449C-ABA5-2B935D769842}.Debug|x86.ActiveCfg = Debug|Any CPU 156 {C92AAC8C-4D88-449C-ABA5-2B935D769842}.Debug|x86.ActiveCfg = Debug|x86 157 {C92AAC8C-4D88-449C-ABA5-2B935D769842}.Debug|x86.Build.0 = Debug|x86 157 158 {C92AAC8C-4D88-449C-ABA5-2B935D769842}.Release|Any CPU.ActiveCfg = Release|Any CPU 158 159 {C92AAC8C-4D88-449C-ABA5-2B935D769842}.Release|Any CPU.Build.0 = Release|Any CPU -
branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Client.Core/3.3/Properties/AssemblyInfo.cs
r4119 r4120 57 57 // by using the '*' as shown below: 58 58 // [assembly: AssemblyVersion("1.0.*")] 59 [assembly: AssemblyVersion("3.3.0.411 6")]60 [assembly: AssemblyFileVersion("3.3.0.411 6")]61 [assembly: AssemblyBuildDate("2010/07/2 8 17:42:03")]59 [assembly: AssemblyVersion("3.3.0.4119")] 60 [assembly: AssemblyFileVersion("3.3.0.4119")] 61 [assembly: AssemblyBuildDate("2010/07/29 16:49:03")] -
branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Experiment.Views/3.3
- Property svn:ignore
-
old new 1 1 bin 2 2 obj 3 HeuristicLab.Hive.Experiment.Views-3.3.csproj.user
-
- Property svn:ignore
-
branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Experiment.Views/3.3/HeuristicLab.Hive.Experiment.Views-3.3.csproj
r4119 r4120 73 73 <HintPath>..\..\..\..\..\..\..\..\..\Programme\HeuristicLab 3.3\HeuristicLab.Data-3.3.dll</HintPath> 74 74 </Reference> 75 <Reference Include="HeuristicLab.Hive.Experiment.Views-3.3, Version=3.3.0.4111, Culture=neutral, processorArchitecture=MSIL" /> 75 <Reference Include="HeuristicLab.DataAccess-3.3, Version=3.3.0.4091, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL" /> 76 <Reference Include="HeuristicLab.Hive.Experiment.Views-3.3, Version=3.3.0.4119, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL" /> 76 77 <Reference Include="HeuristicLab.Hive.Server.Console-3.3"> 77 78 <HintPath>..\..\HeuristicLab.Hive.Server.Console\3.3\obj\Debug\HeuristicLab.Hive.Server.Console-3.3.dll</HintPath> … … 92 93 <HintPath>..\..\..\..\..\..\..\..\..\Programme\HeuristicLab 3.3\HeuristicLab.Optimization.Views-3.3.dll</HintPath> 93 94 </Reference> 95 <Reference Include="HeuristicLab.Persistence-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL" /> 94 96 <Reference Include="HeuristicLab.PluginInfrastructure-3.3"> 95 97 <HintPath>..\..\..\..\..\..\..\..\..\Programme\HeuristicLab 3.3\HeuristicLab.PluginInfrastructure-3.3.dll</HintPath> … … 101 103 <Reference Include="System.Xml.Linq" /> 102 104 <Reference Include="System.Data.DataSetExtensions" /> 103 <Reference Include="Microsoft.CSharp" />104 105 <Reference Include="System.Data" /> 105 106 <Reference Include="System.Xml" /> … … 113 114 <DependentUpon>HiveExperimentView.cs</DependentUpon> 114 115 </Compile> 116 <Compile Include="JobItemListView.cs"> 117 <SubType>UserControl</SubType> 118 </Compile> 119 <Compile Include="JobItemListView.Designer.cs"> 120 <DependentUpon>JobItemListView.cs</DependentUpon> 121 </Compile> 122 <Compile Include="JobItemView.cs"> 123 <SubType>UserControl</SubType> 124 </Compile> 125 <Compile Include="JobItemView.Designer.cs"> 126 <DependentUpon>JobItemView.cs</DependentUpon> 127 </Compile> 115 128 <Compile Include="Properties\AssemblyInfo.cs" /> 116 129 </ItemGroup> … … 120 133 </ItemGroup> 121 134 <ItemGroup> 135 <ProjectReference Include="..\..\HeuristicLab.Hive.Contracts\3.3\HeuristicLab.Hive.Contracts-3.3.csproj"> 136 <Project>{134F93D7-E7C8-4ECD-9923-7F63259A60D8}</Project> 137 <Name>HeuristicLab.Hive.Contracts-3.3</Name> 138 </ProjectReference> 122 139 <ProjectReference Include="..\..\HeuristicLab.Hive.Experiment\3.3\HeuristicLab.Hive.Experiment-3.3.csproj"> 123 140 <Project>{A84C0A25-13D0-40A6-924F-53556D9691DC}</Project> 124 141 <Name>HeuristicLab.Hive.Experiment-3.3</Name> 142 </ProjectReference> 143 <ProjectReference Include="..\..\HeuristicLab.Hive.JobBase\3.3\HeuristicLab.Hive.JobBase-3.3.csproj"> 144 <Project>{21187322-52DD-4243-80A4-A85F0263E63B}</Project> 145 <Name>HeuristicLab.Hive.JobBase-3.3</Name> 125 146 </ProjectReference> 126 147 </ItemGroup> … … 128 149 <EmbeddedResource Include="HiveExperimentView.resx"> 129 150 <DependentUpon>HiveExperimentView.cs</DependentUpon> 151 </EmbeddedResource> 152 <EmbeddedResource Include="JobItemView.resx"> 153 <DependentUpon>JobItemView.cs</DependentUpon> 130 154 </EmbeddedResource> 131 155 </ItemGroup> -
branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Experiment.Views/3.3/HiveExperimentView.Designer.cs
r4116 r4120 53 53 this.loadExperimentButton = new System.Windows.Forms.Button(); 54 54 this.hiveStatusTabPage = new System.Windows.Forms.TabPage(); 55 this.jobListView = new HeuristicLab.Hive.Experiment.Views.JobItemListView(); 56 this.logTabPage = new System.Windows.Forms.TabPage(); 57 this.logView = new HeuristicLab.Core.Views.LogView(); 55 58 this.startButton = new System.Windows.Forms.Button(); 56 59 this.stopButton = new System.Windows.Forms.Button(); … … 66 69 this.tabControl.SuspendLayout(); 67 70 this.experimentTabPage.SuspendLayout(); 71 this.hiveStatusTabPage.SuspendLayout(); 72 this.logTabPage.SuspendLayout(); 68 73 this.SuspendLayout(); 69 74 // … … 85 90 this.tabControl.Controls.Add(this.experimentTabPage); 86 91 this.tabControl.Controls.Add(this.hiveStatusTabPage); 87 this.tabControl.Location = new System.Drawing.Point(0, 135); 92 this.tabControl.Controls.Add(this.logTabPage); 93 this.tabControl.Location = new System.Drawing.Point(0, 99); 88 94 this.tabControl.Name = "tabControl"; 89 95 this.tabControl.SelectedIndex = 0; 90 this.tabControl.Size = new System.Drawing.Size(735, 3 59);96 this.tabControl.Size = new System.Drawing.Size(735, 395); 91 97 this.tabControl.TabIndex = 4; 92 98 // … … 100 106 this.experimentTabPage.Name = "experimentTabPage"; 101 107 this.experimentTabPage.Padding = new System.Windows.Forms.Padding(3); 102 this.experimentTabPage.Size = new System.Drawing.Size(727, 3 33);108 this.experimentTabPage.Size = new System.Drawing.Size(727, 369); 103 109 this.experimentTabPage.TabIndex = 1; 104 110 this.experimentTabPage.Text = "Experiment"; … … 149 155 // hiveStatusTabPage 150 156 // 157 this.hiveStatusTabPage.Controls.Add(this.jobListView); 151 158 this.hiveStatusTabPage.Location = new System.Drawing.Point(4, 22); 152 159 this.hiveStatusTabPage.Name = "hiveStatusTabPage"; 153 160 this.hiveStatusTabPage.Padding = new System.Windows.Forms.Padding(3); 154 this.hiveStatusTabPage.Size = new System.Drawing.Size(727, 3 33);161 this.hiveStatusTabPage.Size = new System.Drawing.Size(727, 369); 155 162 this.hiveStatusTabPage.TabIndex = 2; 156 163 this.hiveStatusTabPage.Text = "HiveStatus"; 157 164 this.hiveStatusTabPage.UseVisualStyleBackColor = true; 165 // 166 // jobListView 167 // 168 this.jobListView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 169 | System.Windows.Forms.AnchorStyles.Left) 170 | System.Windows.Forms.AnchorStyles.Right))); 171 this.jobListView.Caption = "JobList View"; 172 this.jobListView.Content = null; 173 this.jobListView.Location = new System.Drawing.Point(3, 6); 174 this.jobListView.Name = "jobListView"; 175 this.jobListView.ReadOnly = false; 176 this.jobListView.Size = new System.Drawing.Size(721, 360); 177 this.jobListView.TabIndex = 0; 178 // 179 // logTabPage 180 // 181 this.logTabPage.Controls.Add(this.logView); 182 this.logTabPage.Location = new System.Drawing.Point(4, 22); 183 this.logTabPage.Name = "logTabPage"; 184 this.logTabPage.Size = new System.Drawing.Size(727, 369); 185 this.logTabPage.TabIndex = 3; 186 this.logTabPage.Text = "Log"; 187 this.logTabPage.UseVisualStyleBackColor = true; 188 // 189 // logView 190 // 191 this.logView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 192 | System.Windows.Forms.AnchorStyles.Left) 193 | System.Windows.Forms.AnchorStyles.Right))); 194 this.logView.Caption = "Log View"; 195 this.logView.Content = null; 196 this.logView.Location = new System.Drawing.Point(3, 4); 197 this.logView.Name = "logView"; 198 this.logView.ReadOnly = false; 199 this.logView.Size = new System.Drawing.Size(721, 362); 200 this.logView.TabIndex = 0; 158 201 // 159 202 // startButton … … 300 343 this.tabControl.ResumeLayout(false); 301 344 this.experimentTabPage.ResumeLayout(false); 345 this.hiveStatusTabPage.ResumeLayout(false); 346 this.logTabPage.ResumeLayout(false); 302 347 this.ResumeLayout(false); 303 348 this.PerformLayout(); … … 323 368 private System.Windows.Forms.Button loadExperimentButton; 324 369 private Core.Views.NamedItemView experimentNamedItemView; 370 private System.Windows.Forms.TabPage logTabPage; 371 private Core.Views.LogView logView; 372 private JobItemListView jobListView; 325 373 326 374 } -
branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Experiment.Views/3.3/HiveExperimentView.cs
r4119 r4120 81 81 serverUrlTextBox.Text = Content.ServerUrl; 82 82 experimentNamedItemView.Content = Content.Experiment; 83 logView.Content = Content.Log; 84 jobListView.Content = Content.JobItems; 83 85 } 84 86 } … … 104 106 Content.Prepare(); 105 107 } 106 SetEnabledStateOf ExecutableButtons();108 SetEnabledStateOfControls(); 107 109 } 108 110 … … 189 191 stopButton.Enabled = (Content.ExecutionState == ExecutionState.Started) || (Content.ExecutionState == ExecutionState.Paused); 190 192 resetButton.Enabled = Content.ExecutionState != ExecutionState.Started; 193 191 194 } 192 195 } -
branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Experiment.Views/3.3/HiveExperimentView.resx
r4116 r4120 128 128 <value> 129 129 iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 130 YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAlwSFlzAAALC wAA131 Cw sBbQSEtwAAALZJREFUOE9j/P//PwNFAGQAOi7bn+2GTRybGIZmkKKEGRH/iTUEpwGWZfpEGYLVgKgp130 YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAlwSFlzAAALCAAA 131 CwgBwL2l2gAAALZJREFUOE9j/P//PwNFAGQAOi7bn+2GTRybGIZmkKKEGRH/iTUEpwGWZfpEGYLVgKgp 132 132 Qf833Fr8nxhDsBoQPMEbZDtRhmA1wKfLGWwACEctCsDrEqwGODZb/M/YEAvWbNus/1+nWOG/RBo3iFZD 133 133 jwmsBpjX6KFo5k9gwaoZnIawxa1eqTLcZnyacRqgki8FdjYhzTgNkM4QJEozTgNEkjlx+pmoQMQW2rjy … … 138 138 <value> 139 139 iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 140 YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAlwSFlzAAALC wAA141 Cw sBbQSEtwAAAXJJREFUOE+tkj1IQmEYhWsoaIi2xmhpiYSgKFoiCMLJJYSEJiEI0mgIyqjA6vaLUKIU140 YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAlwSFlzAAALCAAA 141 CwgBwL2l2gAAAXJJREFUOE+tkj1IQmEYhWsoaIi2xmhpiYSgKFoiCMLJJYSEJiEI0mgIyqjA6vaLUKIU 142 142 iZlJKKUoWEbZDzVYCYlQYVxcNDIoRND8ud7idD83C27g7YNvPM8573nfcgBlgh4BCPmCxIX0Qtx/ATTu 143 143 Lyy78ph3ZKC2pTBlSWB86w2jhleMrD9jWB9N/jQsSkDEj5FPPERZ+J7yOL5j4PYzsPsYGL1piKR7nL64 … … 151 151 <value> 152 152 iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 153 YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAlwSFlzAAALC wAA154 Cw sBbQSEtwAAAYNJREFUOE9j/P//PwNFAGQAJZgizWDXI9veu/nvfxhuW/vtf+OKz/9rF7//XzHv1f+S153 YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAlwSFlzAAALCAAA 154 CwgBwL2l2gAAAYNJREFUOE9j/P//PwNFAGQAJZgizWDXI9veu/nvfxhuW/vtf+OKz/9rF7//XzHv1f+S 155 155 2c//F0x//L901mOgFoSrUQzo2vDr/6aT3/6vPPTl/4I9n/5ffvDzf+/ad/+bl74BG5I3/cV/3dBVuA0A 156 156 2bri4Jf/83Z9+n/ryS+Qwv8NS978L5378n/O1Of/k3qf/Vf1W4TbAJCT5+z49P/hyx9gzSBQMvvl/6wp … … 164 164 <value> 165 165 iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 166 YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAlwSFlzAAALC wAA167 Cw sBbQSEtwAAAMZJREFUOE9j/P//PwNFAGQAJZgizWDXU2I7VgN6N//937Xh1/+8qY8+gRSg89EtxHAB166 YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAlwSFlzAAALCAAA 167 CwgBwL2l2gAAAMZJREFUOE9j/P//PwNFAGQAJZgizWDXU2I7VgN6N//937Xh1/+8qY8+gRSg89EtxHAB 168 168 SPPVh3/+64auAqr9z4DOJ2hA29pv/289/f1f1W8R2AB0PkEDGld8/n/54e//cm6zwAag8wkaULv4/f8T 169 169 13//F7ObBDYAnU/QgIp5r/7vvvDzP79ZN9gAdD5BA0pmP/+//uTP/5wGrWAD0PkEDSiY/vj/gj2f/7Pq -
branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Experiment.Views/3.3/Properties/AssemblyInfo.cs
r4119 r4120 55 55 // You can specify all the values or you can default the Revision and Build Numbers 56 56 // by using the '*' as shown below: 57 [assembly: AssemblyVersion("3.3.0.411 6")]58 [assembly: AssemblyFileVersion("3.3.0.411 6")]59 [assembly: AssemblyBuildDate("2010/07/2 8 17:42:56")]57 [assembly: AssemblyVersion("3.3.0.4119")] 58 [assembly: AssemblyFileVersion("3.3.0.4119")] 59 [assembly: AssemblyBuildDate("2010/07/29 16:49:22")] -
branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Experiment/3.3
- Property svn:ignore
-
old new 1 1 bin 2 2 obj 3 HeuristicLab.Hive.Experiment-3.3.csproj.user
-
- Property svn:ignore
-
branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Experiment/3.3/HeuristicLab.Hive.Experiment-3.3.csproj
r4119 r4120 96 96 </ItemGroup> 97 97 <ItemGroup> 98 <Compile Include="JobItemList.cs" /> 99 <Compile Include="JobItem.cs" /> 98 100 <Compile Include="OptimizerJob.cs" /> 99 101 <Compile Include="HeuristicLabHiveExperimentPlugin.cs" /> -
branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Experiment/3.3/HiveExperiment.cs
r4119 r4120 54 54 private const int resultPollingIntervalMs = 10000; 55 55 56 private object locker = new object(); 56 57 private const int maxSnapshotRetries = 20; 57 58 [Storable] 59 private IDictionary<Guid, IOptimizer> sentOptimizers = null; 60 61 private object locker = new object(); 62 private DateTime startTime; 58 private System.Timers.Timer timer; 59 private bool pausePending, stopPending; 60 private DateTime lastUpdateTime; 61 62 [Storable] 63 private IDictionary<Guid, IOptimizer> pendingOptimizers = new Dictionary<Guid, IOptimizer>(); 64 65 [Storable] 66 private JobItemList jobItems; 67 public JobItemList JobItems { 68 get { return jobItems; } 69 } 70 63 71 64 72 [Storable] … … 66 74 public string ServerUrl { 67 75 get { return serverUrl; } 68 set { serverUrl = value; OnServerUrlChanged(); } 76 set { 77 if (serverUrl != value) { 78 serverUrl = value; 79 OnServerUrlChanged(); 80 } 81 } 69 82 } 70 83 … … 73 86 public string ResourceIds { 74 87 get { return resourceIds; } 75 set { resourceIds = value; OnResourceIdsChanged(); } 88 set { 89 if (resourceIds != value) { 90 resourceIds = value; 91 OnResourceIdsChanged(); 92 } 93 } 76 94 } 77 95 … … 80 98 public HeuristicLab.Optimization.Experiment Experiment { 81 99 get { return experiment; } 82 set { experiment = value; OnExperimentChanged(); } 100 set { 101 if (experiment != value) { 102 experiment = value; 103 OnExperimentChanged(); 104 } 105 } 106 } 107 108 [Storable] 109 private ILog log; 110 public ILog Log { 111 get { return log; } 83 112 } 84 113 … … 92 121 this.ServerUrl = HeuristicLab.Hive.Experiment.Properties.Settings.Default.HiveServerUrl; 93 122 this.ResourceIds = HeuristicLab.Hive.Experiment.Properties.Settings.Default.ResourceIds; 123 this.log = new Log(); 124 pausePending = stopPending = false; 125 jobItems = new JobItemList(); 126 InitTimer(); 94 127 } 95 128 96 129 public override IDeepCloneable Clone(Cloner cloner) { 130 log.LogMessage("I am beeing cloned"); 97 131 HiveExperiment clone = (HiveExperiment)base.Clone(cloner); 98 132 clone.resourceIds = this.resourceIds; … … 101 135 clone.executionState = this.executionState; 102 136 clone.executionTime = this.executionTime; 103 clone.sentOptimizers = new Dictionary<Guid, IOptimizer>(); 104 foreach (var pair in this.sentOptimizers) 105 clone.sentOptimizers[pair.Key] = (IOptimizer)cloner.Clone(pair.Value); 137 clone.pendingOptimizers = new Dictionary<Guid, IOptimizer>(); 138 foreach (var pair in this.pendingOptimizers) 139 clone.pendingOptimizers[pair.Key] = (IOptimizer)cloner.Clone(pair.Value); 140 clone.log = (ILog)cloner.Clone(log); 141 clone.stopPending = this.stopPending; 142 clone.pausePending = this.pausePending; 143 clone.jobItems = (JobItemList)cloner.Clone(jobItems); 106 144 return clone; 145 } 146 147 [StorableHook(HookType.AfterDeserialization)] 148 private void AfterDeserialization() { 149 InitTimer(); 150 log.LogMessage("I was deserialized."); 151 } 152 153 private void InitTimer() { 154 timer = new System.Timers.Timer(100); 155 timer.AutoReset = true; 156 timer.Elapsed += new System.Timers.ElapsedEventHandler(timer_Elapsed); 157 } 158 159 private void timer_Elapsed(object sender, System.Timers.ElapsedEventArgs e) { 160 DateTime now = DateTime.Now; 161 ExecutionTime += now - lastUpdateTime; 162 lastUpdateTime = now; 107 163 } 108 164 … … 135 191 get { return executionTime; } 136 192 private set { 137 executionTime = value; 138 OnExecutionTimeChanged(); 193 if (executionTime != value) { 194 executionTime = value; 195 OnExecutionTimeChanged(); 196 } 139 197 } 140 198 } … … 145 203 146 204 public void Prepare() { 147 // [chn] needed?148 205 if (experiment != null) { 149 206 experiment.Prepare(); 207 this.ExecutionState = Core.ExecutionState.Prepared; 150 208 OnPrepared(); 151 209 } … … 153 211 154 212 public void Start() { 155 this.startTime = DateTime.Now; 213 OnStarted(); 214 lastUpdateTime = DateTime.Now; 156 215 this.ExecutionState = Core.ExecutionState.Started; 157 IExecutionEngineFacade executionEngineFacade = ServiceLocator.CreateExecutionEngineFacade(ServerUrl); 158 159 sentOptimizers = new Dictionary<Guid, IOptimizer>(); 160 IEnumerable<string> groups = ResourceGroups; 161 162 foreach (IOptimizer optimizer in Experiment.Optimizers) { 163 SerializedJob serializedJob = CreateSerializedJob(optimizer); 164 ResponseObject<JobDto> response = executionEngineFacade.AddJobWithGroupStrings(serializedJob, groups); 165 sentOptimizers.Add(response.Obj.Id, optimizer); 166 StartResultPollingThread(response.Obj); 167 } 216 Thread t = new Thread(() => { 217 IExecutionEngineFacade executionEngineFacade = ServiceLocator.CreateExecutionEngineFacade(ServerUrl); 218 219 pendingOptimizers = new Dictionary<Guid, IOptimizer>(); 220 IEnumerable<string> groups = ResourceGroups; 221 222 foreach (IOptimizer optimizer in GetOptimizers(false)) { 223 SerializedJob serializedJob = CreateSerializedJob(optimizer); 224 ResponseObject<JobDto> response = executionEngineFacade.AddJobWithGroupStrings(serializedJob, groups); 225 pendingOptimizers.Add(response.Obj.Id, optimizer); 226 StartResultPollingThread(response.Obj); 227 228 JobItem jobItem = new JobItem() { 229 JobDto = response.Obj, 230 LatestSnapshot = new ResponseObject<SerializedJob>() { 231 Obj = serializedJob, 232 StatusMessage = "Initial Snapshot", 233 Success = true 234 } 235 }; 236 jobItems.Add(jobItem); 237 238 log.LogMessage("Sent job to server (jobId: " + response.Obj.Id + ")"); 239 } 240 }); 241 t.Start(); 242 } 243 244 /// <summary> 245 /// Returns all optimizers in the current Experiment 246 /// </summary> 247 /// <param name="flatout">if false only top level optimizers are returned, if true the optimizer-tree is flatted</param> 248 /// <returns></returns> 249 private IEnumerable<IOptimizer> GetOptimizers(bool flatout) { 250 if (!flatout) { 251 return experiment.Optimizers; 252 } else { 253 throw new NotImplementedException(); 254 } 255 } 256 257 private void ReplaceOptimizer(IOptimizer originalOptimizer, IOptimizer newOptimizer) { 258 int originalOptimizerIndex = experiment.Optimizers.IndexOf(originalOptimizer); 259 experiment.Optimizers[originalOptimizerIndex] = newOptimizer; 168 260 } 169 261 … … 171 263 // todo 172 264 } 173 174 private bool abortRequested; 175 265 176 266 #endregion 177 267 … … 219 309 Thread.Sleep(resultPollingIntervalMs); 220 310 lock (locker) { 221 if ( abortRequested) return;222 311 if (stopPending) return; 312 223 313 ResponseObject<SerializedJob> response = executionEngineFacade.GetLastSerializedResult(job.Id, false, false); 224 314 log.LogMessage("Received response for job: " + response.StatusMessage + " (jobId: " + job.Id + ")"); 315 316 225 317 // loop while 226 318 // 1. the user doesn't request an abort … … 229 321 // 4. the result that we get from the server is a snapshot and not the final result 230 322 if (response.Success && response.Obj != null && response.StatusMessage != ApplicationConstants.RESPONSE_JOB_RESULT_NOT_YET_HERE) { 231 232 // [chn] todo: deserialization into interface is not possible! how to find out correct static type?233 323 restoredObject = XmlParser.Deserialize<IJob>(new MemoryStream(response.Obj.SerializedJobData)); 234 324 } … … 236 326 } while (restoredObject == null || restoredObject.ExecutionState != Core.ExecutionState.Stopped); 237 327 328 log.LogMessage("Job finished (jobId: " + job.Id + ")"); 238 329 // job retrieved... replace the existing optimizers with the finished one 239 IOptimizer originalOptimizer = sentOptimizers[job.Id];330 IOptimizer originalOptimizer = pendingOptimizers[job.Id]; 240 331 IOptimizer restoredOptimizer = ((OptimizerJob)restoredObject).Optimizer; 241 332 242 int originalOptimizerIndex = experiment.Optimizers.IndexOf(originalOptimizer); 243 experiment.Optimizers[originalOptimizerIndex] = restoredOptimizer; 244 sentOptimizers.Remove(job.Id); 245 246 if (sentOptimizers.Count == 0) { 333 ReplaceOptimizer(originalOptimizer, restoredOptimizer); 334 pendingOptimizers.Remove(job.Id); 335 336 if (pendingOptimizers.Count == 0) { 247 337 // finished 248 338 this.ExecutionState = Core.ExecutionState.Stopped; … … 254 344 t.Start(); 255 345 } 256 257 346 258 347 #region Required Plugin Search 259 348 /// <summary> … … 351 440 public event EventHandler ExecutionStateChanged; 352 441 private void OnExecutionStateChanged() { 442 log.LogMessage("ExecutionState changed to " + executionState.ToString()); 353 443 EventHandler handler = ExecutionStateChanged; 354 444 if (handler != null) handler(this, EventArgs.Empty); … … 359 449 public event EventHandler Started; 360 450 private void OnStarted() { 451 log.LogMessage("Started"); 452 timer.Start(); 361 453 EventHandler handler = Started; 362 454 if (handler != null) handler(this, EventArgs.Empty); … … 365 457 public event EventHandler Stopped; 366 458 private void OnStopped() { 459 timer.Stop(); 460 log.LogMessage("Stopped"); 367 461 EventHandler handler = Stopped; 368 462 if (handler != null) handler(this, EventArgs.Empty); … … 371 465 public event EventHandler Paused; 372 466 private void OnPaused() { 467 timer.Stop(); 468 log.LogMessage("Paused"); 373 469 EventHandler handler = Paused; 374 470 if (handler != null) handler(this, EventArgs.Empty); … … 377 473 public event EventHandler Prepared; 378 474 protected virtual void OnPrepared() { 475 log.LogMessage("Prepared"); 379 476 EventHandler handler = Prepared; 380 477 if (handler != null) handler(this, EventArgs.Empty); … … 389 486 public event EventHandler ExperimentChanged; 390 487 protected virtual void OnExperimentChanged() { 488 log.LogMessage("Experiment changed"); 391 489 EventHandler handler = ExperimentChanged; 392 490 if (handler != null) handler(this, EventArgs.Empty); … … 399 497 } 400 498 401 402 499 #endregion 403 500 } -
branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Experiment/3.3/OptimizerJob.cs
r4119 r4120 10 10 namespace HeuristicLab.Hive.Experiment { 11 11 [StorableClass] 12 class OptimizerJob : IJob {12 public class OptimizerJob : IJob { 13 13 14 14 [Storable] -
branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Experiment/3.3/Properties/AssemblyInfo.cs
r4119 r4120 55 55 // You can specify all the values or you can default the Revision and Build Numbers 56 56 // by using the '*' as shown below: 57 [assembly: AssemblyVersion("3.3.0.411 6")]58 [assembly: AssemblyFileVersion("3.3.0.411 6")]59 [assembly: AssemblyBuildDate("2010/07/2 8 17:42:02")]57 [assembly: AssemblyVersion("3.3.0.4119")] 58 [assembly: AssemblyFileVersion("3.3.0.4119")] 59 [assembly: AssemblyBuildDate("2010/07/29 16:49:01")] -
branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Experiment/3.3/ServiceLocator.cs
r4116 r4120 31 31 internal class ServiceLocator { 32 32 internal static IExecutionEngineFacade CreateExecutionEngineFacade(string url) { 33 ChannelFactory<IExecutionEngineFacade> factory = 34 new ChannelFactory<IExecutionEngineFacade>( 33 ChannelFactory<IExecutionEngineFacade> factory = new ChannelFactory<IExecutionEngineFacade>( 35 34 WcfSettings.GetStreamedBinding(), 36 35 new EndpointAddress(url)); 37 38 36 return factory.CreateChannel(); 39 37 } -
branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.JobBase/3.3/HeuristicLab.Hive.JobBase-3.3.csproj
r4111 r4120 91 91 </PropertyGroup> 92 92 <ItemGroup> 93 <Reference Include="HeuristicLab.Collections-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL" /> 93 94 <Reference Include="HeuristicLab.Common-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL" /> 94 95 <Reference Include="HeuristicLab.Core-3.3"> -
branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Server.Console/3.3/JobDataFetcher.cs
r4107 r4120 11 11 namespace HeuristicLab.Hive.Server.ServerConsole { 12 12 public class JobDataFetcher { 13 public List<State> PollStates { get; set; } 13 private List<State> pollStates; 14 15 public IEnumerable<State> PollStates { 16 get { return pollStates; } 17 } 14 18 15 19 public event EventHandler NewDataAvailable; 16 20 17 21 private System.Timers.Timer timer; 22 23 private static object locker = new object(); 18 24 19 25 public List<JobDto> CachedJobs { get; set; } … … 39 45 40 46 public JobDataFetcher(IEnumerable<State> states, int nrOfEntries) { 41 PollStates = new List<State>();47 pollStates = new List<State>(); 42 48 CachedJobs = new List<JobDto>(); 43 49 NrOfEntriesOnPage = nrOfEntries; 44 50 CurrentPage = 0; 45 PollStates.AddRange(states);51 pollStates.AddRange(states); 46 52 timer = new System.Timers.Timer(); 47 53 timer.Interval = 5000; … … 70 76 // [chn] Exception occured here: PollStates enumeration changed! 71 77 // todo: make access to PollStates thread-safe! 72 foreach (State stat in PollStates) { 73 ResponseList<JobDto> resList = ServiceLocator.GetJobManager().GetAllJobsWithFilter(stat, CurrentPage * NrOfEntriesOnPage, 74 NrOfEntriesOnPage); 75 if (resList.Success) { 76 if (resList.List.Count == 0) { 77 if (CurrentPage > 0) { 78 CurrentPage--; 78 // * added lock on locker -> didn't help 79 // * made public property PollStates an IEnumerable to be immutable -> lets see 80 lock (locker) { 81 foreach (State stat in PollStates) { 82 ResponseList<JobDto> resList = ServiceLocator.GetJobManager().GetAllJobsWithFilter(stat, CurrentPage * NrOfEntriesOnPage, 83 NrOfEntriesOnPage); 84 if (resList.Success) { 85 if (resList.List.Count == 0) { 86 if (CurrentPage > 0) { 87 CurrentPage--; 88 } 89 } else { 90 CachedJobs = new List<JobDto>(); 91 CachedJobs.AddRange(resList.List); 79 92 } 80 } else {81 CachedJobs = new List<JobDto>();82 CachedJobs.AddRange(resList.List);83 93 } 84 94 } 95 if (NewDataAvailable != null) 96 NewDataAvailable(this, new EventArgs()); 85 97 } 86 if (NewDataAvailable != null)87 NewDataAvailable(this, new EventArgs());88 98 } 89 99 } -
branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Server.Core/3.3/Facades/ExecutionEngineFacade.cs
r4092 r4120 70 70 } 71 71 72 public ResponseObject<JobDto> GetJobById(Guid jobId) { 73 using (contextFactory.GetContext()) { 74 return jobManager.GetJobById(jobId); 75 } 76 } 72 77 #endregion 73 78 } -
branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Server.Core/3.3/JobManager.cs
r4119 r4120 58 58 } 59 59 60 61 60 private void CheckForDeadJobs() { 62 61 Logger.Info("Searching for dead Jobs"); … … 231 230 } 232 231 232 // [chn] [refactor] why does this method handle 3 different cases? wouldn't 3 methods be easier? 233 233 //Requested means: there MUST be a job result which gets sent back 234 234 public ResponseObject<SerializedJob> GetLastSerializedJobResultOf(Guid jobId, bool requested, bool snapshot) { 235 ResponseObject<SerializedJob> response = 236 new ResponseObject<SerializedJob>(); 235 ResponseObject<SerializedJob> response = new ResponseObject<SerializedJob>(); 237 236 238 237 JobDto job = DaoLocator.JobDao.FindById(jobId); -
branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Server.Core/3.3/Properties/AssemblyInfo.cs
r4119 r4120 55 55 // by using the '*' as shown below: 56 56 // [assembly: AssemblyVersion("1.0.*")] 57 [assembly: AssemblyVersion("3.3.0.411 6")]58 [assembly: AssemblyFileVersion("3.3.0.411 6")]59 [assembly: AssemblyBuildDate("2010/07/2 8 17:42:06")]57 [assembly: AssemblyVersion("3.3.0.4119")] 58 [assembly: AssemblyFileVersion("3.3.0.4119")] 59 [assembly: AssemblyBuildDate("2010/07/29 16:49:08")] -
branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Server.LINQDataAccess/3.3/ContextFactory.cs
r4092 r4120 23 23 /// </summary> 24 24 class ContextFactory : IContextFactory { 25 private static IDictionary<object, HiveDataContext> contexts = new Dictionary<object, HiveDataContext>(); 26 private static IDictionary<object, TransactionScope> transactions = new Dictionary<object, TransactionScope>(); 25 private static object locker = new object(); 26 private static IDictionary<int, HiveDataContext> contexts = new Dictionary<int, HiveDataContext>(); 27 private static IDictionary<int, TransactionScope> transactions = new Dictionary<int, TransactionScope>(); 27 28 28 29 private static IContextFactory instance = null; … … 42 43 43 44 public IDisposable GetContext(bool withTransaction) { 44 Logger.Debug("opening transaction"); 45 object obj = Thread.CurrentThread; 45 lock (locker) { 46 Logger.Debug("opening transaction"); 47 int threadId = Thread.CurrentThread.ManagedThreadId; 46 48 47 if (contexts.ContainsKey(obj)) { 48 throw new DataAccessException("Context for this Thread already defined"); 49 if (contexts.ContainsKey(threadId)) { 50 throw new DataAccessException("Context for this Thread already defined"); 51 } 52 53 Logger.Debug("creating context"); 54 DisposableHiveDataContext context = CreateContext(); 55 context.OnDisposing += new EventHandler(context_OnDisposing); 56 contexts.Add(threadId, context); 57 58 if (withTransaction) { 59 TransactionScope transaction = new TransactionScope(TransactionScopeOption.Required, new TransactionOptions { IsolationLevel = ApplicationConstants.ISOLATION_LEVEL_SCOPE }); 60 Logger.Debug("creating transaction"); 61 62 transactions.Add(threadId, transaction); 63 } 64 return context; 49 65 } 50 51 Logger.Debug("creating context");52 DisposableHiveDataContext context = CreateContext();53 context.OnDisposing += new EventHandler(context_OnDisposing);54 contexts.Add(obj, context);55 56 if (withTransaction) {57 TransactionScope transaction = new TransactionScope(TransactionScopeOption.Required, new TransactionOptions { IsolationLevel = ApplicationConstants.ISOLATION_LEVEL_SCOPE });58 Logger.Debug("creating transaction");59 60 transactions.Add(obj, transaction);61 }62 return context;63 66 } 64 67 … … 74 77 public void RollbackTransaction() { 75 78 Logger.Debug("rolling back transaction"); 76 object obj = Thread.CurrentThread;79 int threadId = Thread.CurrentThread.ManagedThreadId; 77 80 78 TransactionScope transaction = transactions[ obj];81 TransactionScope transaction = transactions[threadId]; 79 82 transaction.Dispose(); 80 83 } 81 84 82 85 public void RemoveContext() { 83 Logger.Debug("removing context"); 84 object obj = Thread.CurrentThread; 86 lock (locker) { 87 Logger.Debug("removing context"); 88 int threadId = Thread.CurrentThread.ManagedThreadId; 85 89 86 contexts.Remove(obj); 87 // context gets disposed implicitly, when it is used as IDisposable 90 contexts.Remove(threadId); 91 // context gets disposed implicitly, when it is used as IDisposable 92 } 88 93 } 89 94 90 95 public void RemoveAndCompleteTransaction() { 91 Logger.Debug("completing transaction"); 92 object obj = Thread.CurrentThread; 96 lock (locker) { 97 Logger.Debug("completing transaction"); 98 int threadId = Thread.CurrentThread.ManagedThreadId; 93 99 94 // context does not always have an associated transaction 95 if (transactions.ContainsKey(obj)) { 96 transactions[obj].Complete(); 97 transactions[obj].Dispose(); 98 transactions.Remove(obj); 100 // context does not always have an associated transaction 101 if (transactions.ContainsKey(threadId)) { 102 transactions[threadId].Complete(); 103 transactions[threadId].Dispose(); 104 transactions.Remove(threadId); 105 } 99 106 } 100 107 } … … 102 109 public DataContext CurrentContext { 103 110 get { 104 object obj = Thread.CurrentThread;105 if (contexts.ContainsKey( obj)) {106 return contexts[ obj];111 int threadId = Thread.CurrentThread.ManagedThreadId; 112 if (contexts.ContainsKey(threadId)) { 113 return contexts[threadId]; 107 114 } else { 108 115 return null; -
branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive/3.3
- Property svn:ignore
-
old new 1 1 bin 2 2 obj 3 HeuristicLab.Hive-3.3.csproj.user
-
- Property svn:ignore
-
branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive/3.3/HeuristicLab.Hive-3.3.csproj
r4119 r4120 41 41 <PropertyGroup> 42 42 <AssemblyOriginatorKeyFile>HeuristicLab.snk</AssemblyOriginatorKeyFile> 43 </PropertyGroup> 44 <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'"> 45 <PlatformTarget>x86</PlatformTarget> 46 <OutputPath>bin\Debug\</OutputPath> 47 </PropertyGroup> 48 <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'"> 49 <PlatformTarget>x86</PlatformTarget> 50 <OutputPath>bin\x86\Release\</OutputPath> 43 51 </PropertyGroup> 44 52 <ItemGroup> -
branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive/3.3/Properties/AssemblyInfo.cs
r4119 r4120 51 51 // Revision 52 52 // 53 [assembly: AssemblyVersion("3.3.0.411 6")]54 [assembly: AssemblyFileVersion("3.3.0.411 6")]53 [assembly: AssemblyVersion("3.3.0.4119")] 54 [assembly: AssemblyFileVersion("3.3.0.4119")]
Note: See TracChangeset
for help on using the changeset viewer.