Changeset 375 for trunk/sources/HeuristicLab.CEDMA.Server
- Timestamp:
- 07/09/08 21:37:36 (16 years ago)
- Location:
- trunk/sources/HeuristicLab.CEDMA.Server
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.CEDMA.Server/AgentScheduler.cs
r372 r375 59 59 engines.Remove(e); 60 60 AgentEntry entry = agent[e]; 61 entry.Status = AgentStatus.Finished;62 database.Update (entry);61 entry.Status = ProcessStatus.Finished; 62 database.UpdateAgent(entry.Id, entry.Status); 63 63 } 64 64 } 65 65 private void CreateNewEngines() { 66 ICollection<AgentEntry> agents = database.GetAgent Entries(AgentStatus.Waiting);66 ICollection<AgentEntry> agents = database.GetAgents(ProcessStatus.Waiting); 67 67 foreach(AgentEntry a in agents) { 68 68 SequentialEngine.SequentialEngine engine = new HeuristicLab.SequentialEngine.SequentialEngine(); … … 75 75 agent[engine] = a; 76 76 engines.Add(engine); 77 a.Status = AgentStatus.Active;78 database.Update (a);77 a.Status = ProcessStatus.Active; 78 database.UpdateAgent(a.Id, a.Status); 79 79 } 80 80 } … … 84 84 engine.ExecuteStep(); 85 85 } 86 Thread.Sleep(100); // prevent over -load86 Thread.Sleep(100); // prevent overload 87 87 } 88 88 } -
trunk/sources/HeuristicLab.CEDMA.Server/HeuristicLab.CEDMA.Server.csproj
r372 r375 60 60 <ItemGroup> 61 61 <Compile Include="AgentScheduler.cs" /> 62 <Compile Include="RunScheduler.cs" /> 62 63 <Compile Include="DbPersistenceManager.cs" /> 63 64 <Compile Include="ServerApplication.cs" /> … … 87 88 <Project>{F43B59AB-2B8C-4570-BC1E-15592086517C}</Project> 88 89 <Name>HeuristicLab.Core</Name> 90 </ProjectReference> 91 <ProjectReference Include="..\HeuristicLab.Grid\HeuristicLab.Grid.csproj"> 92 <Project>{545CE756-98D8-423B-AC2E-6E7D70926E5C}</Project> 93 <Name>HeuristicLab.Grid</Name> 89 94 </ProjectReference> 90 95 <ProjectReference Include="..\HeuristicLab.PluginInfrastructure\HeuristicLab.PluginInfrastructure.csproj"> -
trunk/sources/HeuristicLab.CEDMA.Server/ServerForm.cs
r372 r375 36 36 using System.Data.Common; 37 37 using System.Threading; 38 using HeuristicLab.Grid; 38 39 39 40 namespace HeuristicLab.CEDMA.Server { … … 45 46 public ServerForm() { 46 47 InitializeComponent(); 47 InitDatabase();48 InitAgentScheduler();49 50 48 // windows XP returns the external ip on index 0 while windows vista returns the external ip on index 2 51 49 if (System.Environment.OSVersion.Version.Major >= 6) { … … 54 52 addressTextBox.Text = "net.tcp://" + Dns.GetHostAddresses(Dns.GetHostName())[0] + ":8002/CEDMA/World"; 55 53 } 56 Start();57 54 } 58 55 59 56 private void InitAgentScheduler() { 60 57 AgentScheduler scheduler = new AgentScheduler(database); 58 ThreadPool.QueueUserWorkItem(delegate(object status) { scheduler.Run(); }); 59 } 60 61 private void InitRunScheduler() { 62 JobManager jobManager = new JobManager(gridAddress.Text); 63 RunScheduler scheduler = new RunScheduler(database, jobManager); 61 64 ThreadPool.QueueUserWorkItem(delegate(object status) { scheduler.Run(); }); 62 65 } … … 74 77 75 78 private void Start() { 79 InitDatabase(); 80 InitAgentScheduler(); 81 InitRunScheduler(); 82 76 83 host = new ServiceHost(database, new Uri(addressTextBox.Text)); 77 84 ServiceThrottlingBehavior throttlingBehavior = new ServiceThrottlingBehavior(); … … 95 102 private void statusUpdateTimer_Tick(object sender, EventArgs e) { 96 103 } 104 105 private void startButton_Click(object sender, EventArgs e) { 106 Start(); 107 startButton.Enabled = false; 108 } 97 109 } 98 110 } -
trunk/sources/HeuristicLab.CEDMA.Server/ServerForm.designer.cs
r352 r375 51 51 this.activeAgentsTextBox = new System.Windows.Forms.TextBox(); 52 52 this.statusUpdateTimer = new System.Windows.Forms.Timer(this.components); 53 this.gridAddressLabel = new System.Windows.Forms.Label(); 54 this.gridAddress = new System.Windows.Forms.TextBox(); 55 this.startButton = new System.Windows.Forms.Button(); 53 56 this.SuspendLayout(); 54 57 // … … 73 76 // 74 77 this.activeAgentsLabel.AutoSize = true; 75 this.activeAgentsLabel.Location = new System.Drawing.Point(12, 35);78 this.activeAgentsLabel.Location = new System.Drawing.Point(12, 61); 76 79 this.activeAgentsLabel.Name = "activeAgentsLabel"; 77 80 this.activeAgentsLabel.Size = new System.Drawing.Size(75, 13); … … 81 84 // activeAgentsTextBox 82 85 // 83 this.activeAgentsTextBox.Location = new System.Drawing.Point(106, 32);86 this.activeAgentsTextBox.Location = new System.Drawing.Point(106, 58); 84 87 this.activeAgentsTextBox.Name = "activeAgentsTextBox"; 85 88 this.activeAgentsTextBox.ReadOnly = true; … … 95 98 this.statusUpdateTimer.Tick += new System.EventHandler(this.statusUpdateTimer_Tick); 96 99 // 100 // gridAddressLabel 101 // 102 this.gridAddressLabel.AutoSize = true; 103 this.gridAddressLabel.Location = new System.Drawing.Point(12, 35); 104 this.gridAddressLabel.Name = "gridAddressLabel"; 105 this.gridAddressLabel.Size = new System.Drawing.Size(69, 13); 106 this.gridAddressLabel.TabIndex = 9; 107 this.gridAddressLabel.Text = "&Grid address:"; 108 // 109 // gridAddress 110 // 111 this.gridAddress.Location = new System.Drawing.Point(106, 32); 112 this.gridAddress.Name = "gridAddress"; 113 this.gridAddress.Size = new System.Drawing.Size(229, 20); 114 this.gridAddress.TabIndex = 8; 115 // 116 // startButton 117 // 118 this.startButton.Location = new System.Drawing.Point(15, 84); 119 this.startButton.Name = "startButton"; 120 this.startButton.Size = new System.Drawing.Size(75, 23); 121 this.startButton.TabIndex = 10; 122 this.startButton.Text = "Start"; 123 this.startButton.UseVisualStyleBackColor = true; 124 this.startButton.Click += new System.EventHandler(this.startButton_Click); 125 // 97 126 // ServerForm 98 127 // 99 128 this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 100 129 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 101 this.ClientSize = new System.Drawing.Size(347, 62); 130 this.ClientSize = new System.Drawing.Size(347, 119); 131 this.Controls.Add(this.startButton); 132 this.Controls.Add(this.gridAddressLabel); 133 this.Controls.Add(this.gridAddress); 102 134 this.Controls.Add(this.activeAgentsLabel); 103 135 this.Controls.Add(this.activeAgentsTextBox); … … 118 150 private System.Windows.Forms.TextBox activeAgentsTextBox; 119 151 private System.Windows.Forms.Timer statusUpdateTimer; 152 private System.Windows.Forms.Label gridAddressLabel; 153 private System.Windows.Forms.TextBox gridAddress; 154 private System.Windows.Forms.Button startButton; 120 155 } 121 156 }
Note: See TracChangeset
for help on using the changeset viewer.