Index: /misc/tools/HeuristicLab.HiveDrain/HiveIraceResult/App.config
===================================================================
--- /misc/tools/HeuristicLab.HiveDrain/HiveIraceResult/App.config	(revision 16667)
+++ /misc/tools/HeuristicLab.HiveDrain/HiveIraceResult/App.config	(revision 16667)
@@ -0,0 +1,102 @@
+<?xml version="1.0" encoding="utf-8"?>
+<configuration>
+  <configSections>
+    <sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+      <section name="HiveIraceResult.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false"/>
+      <section name="HeuristicLab.Clients.Hive.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false"/>
+    </sectionGroup>
+    <sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+      <section name="HeuristicLab.Clients.Common.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false"/>
+    </sectionGroup>
+  </configSections>
+  <userSettings>
+    <HeuristicLab.Clients.Common.Properties.Settings>
+      <setting name="UserName" serializeAs="String">
+        <value>anonymous</value>
+      </setting>
+      <setting name="SavePassword" serializeAs="String">
+        <value>True</value>
+      </setting>
+      <setting name="Password" serializeAs="String">
+        <value>AQAAANCMnd8BFdERjHoAwE/Cl+sBAAAA36TvN4MDBkWUU6yPrzj49gAAAAACAAAAAAADZgAAwAAAABAAAABr3+B3SidbFwV5hCTHGoESAAAAAASAAACgAAAAEAAAAGSI+4CIIV5GmEl09qLBIxIYAAAAkpj3t9H1LBYhpUjjoM6qEc83XlY0xbnuFAAAADY3OscJ1F9ThR3SHB0sLax4TAN8</value>
+      </setting>
+    </HeuristicLab.Clients.Common.Properties.Settings>
+  </userSettings>
+  <applicationSettings>
+    <HiveIraceResult.Properties.Settings>
+      <setting name="JobPrefix" serializeAs="String">
+        <value>irace</value>
+      </setting>
+      <setting name="ResultName" serializeAs="String">
+        <value>BestQuality</value>
+      </setting>
+    </HiveIraceResult.Properties.Settings>
+    <HeuristicLab.Clients.Hive.Settings>
+      <setting name="MaxParallelUploads" serializeAs="String">
+        <value>2</value>
+      </setting>
+      <setting name="HLBinaryName" serializeAs="String">
+        <value>HeuristicLab 3.3.exe</value>
+      </setting>
+      <setting name="ResultPollingInterval" serializeAs="String">
+        <value>00:00:20</value>
+      </setting>
+      <setting name="MaxParallelDownloads" serializeAs="String">
+        <value>2</value>
+      </setting>
+      <setting name="MaxRepeatServiceCalls" serializeAs="String">
+        <value>5</value>
+      </setting>
+      <setting name="AnonymousUserName" serializeAs="String">
+        <value>anonymous</value>
+      </setting>
+      <setting name="MaxEndpointRetries" serializeAs="String">
+        <value>3</value>
+      </setting>
+      <setting name="EndpointConfigurationPriorities" serializeAs="Xml">
+        <value>
+          <ArrayOfString xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+            <string>NetBinding_IHiveService</string>
+            <string>WSHttpBinding_IHiveService</string>
+          </ArrayOfString>
+        </value>
+      </setting>
+    </HeuristicLab.Clients.Hive.Settings>
+  </applicationSettings>
+  <startup>
+    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1"/>
+  </startup>
+  <system.serviceModel>
+    <behaviors/>
+    <bindings>
+      <wsHttpBinding>
+        <binding name="WSHttpBinding_IHiveService" receiveTimeout="00:20:00" sendTimeout="00:20:00" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647">
+          <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647"/>
+          <security>
+            <message clientCredentialType="UserName"/>
+          </security>
+        </binding>
+      </wsHttpBinding>
+      <netTcpBinding>
+        <binding name="NetBinding_IHiveService" receiveTimeout="00:20:00" sendTimeout="00:20:00" maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647">
+          <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647"/>
+          <security mode="TransportWithMessageCredential">
+            <message clientCredentialType="UserName"/>
+          </security>
+        </binding>
+      </netTcpBinding>
+    </bindings>
+    <client>
+      <endpoint address="http://services.heuristiclab.com/Hive-3.4/HiveService.svc" binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IHiveService" contract="HeuristicLab.Clients.Hive.IHiveService" name="WSHttpBinding_IHiveService">
+        <identity>
+          <dns value="services.heuristiclab.com"/>
+        </identity>
+      </endpoint>
+      <endpoint address="net.tcp://services.heuristiclab.com/Hive-3.4/HiveService.svc" binding="netTcpBinding" bindingConfiguration="NetBinding_IHiveService" contract="HeuristicLab.Clients.Hive.IHiveService" name="NetBinding_IHiveService">
+        <identity>
+          <dns value="services.heuristiclab.com"/>
+        </identity>
+      </endpoint>
+    </client>
+  </system.serviceModel>
+</configuration>
Index: /misc/tools/HeuristicLab.HiveDrain/HiveIraceResult/HiveIraceResult.csproj
===================================================================
--- /misc/tools/HeuristicLab.HiveDrain/HiveIraceResult/HiveIraceResult.csproj	(revision 16667)
+++ /misc/tools/HeuristicLab.HiveDrain/HiveIraceResult/HiveIraceResult.csproj	(revision 16667)
@@ -0,0 +1,103 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProjectGuid>{1BE7096D-95E1-4428-8BB2-341C749DDCFC}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <RootNamespace>HiveIraceResult</RootNamespace>
+    <AssemblyName>HiveIraceResult</AssemblyName>
+    <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+    <TargetFrameworkProfile />
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DefineConstants>TRACE;DEBUG;__NO_DELETE__</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="CommandLine, Version=2.2.1.0, Culture=neutral, PublicKeyToken=de6f01bd326f8c32, processorArchitecture=MSIL">
+      <HintPath>..\packages\CommandLineParser.2.2.1\lib\net45\CommandLine.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Clients.Common-3.3">
+      <HintPath>..\..\..\..\trunk\bin\HeuristicLab.Clients.Common-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Clients.Hive-3.3">
+      <HintPath>..\..\..\..\trunk\bin\HeuristicLab.Clients.Hive-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Collections-3.3">
+      <HintPath>..\..\..\..\trunk\bin\HeuristicLab.Collections-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Common-3.3">
+      <HintPath>..\..\..\..\trunk\bin\HeuristicLab.Common-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Common.Resources-3.3">
+      <HintPath>..\..\..\..\trunk\bin\HeuristicLab.Common.Resources-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Core-3.3">
+      <HintPath>..\..\..\..\trunk\bin\HeuristicLab.Core-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Data-3.3">
+      <HintPath>..\..\..\..\trunk\bin\HeuristicLab.Data-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Hive-3.3">
+      <HintPath>..\..\..\..\trunk\bin\HeuristicLab.Hive-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.MainForm-3.3">
+      <HintPath>..\..\..\..\trunk\bin\HeuristicLab.MainForm-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Optimization-3.3">
+      <HintPath>..\..\..\..\trunk\bin\HeuristicLab.Optimization-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Persistence-3.3">
+      <HintPath>..\..\..\..\trunk\bin\HeuristicLab.Persistence-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.PluginInfrastructure-3.3">
+      <HintPath>..\..\..\..\trunk\bin\HeuristicLab.PluginInfrastructure-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="System" />
+    <Reference Include="System.Core" />
+    <Reference Include="System.Runtime.Serialization" />
+    <Reference Include="System.Xml.Linq" />
+    <Reference Include="System.Data.DataSetExtensions" />
+    <Reference Include="Microsoft.CSharp" />
+    <Reference Include="System.Data" />
+    <Reference Include="System.Net.Http" />
+    <Reference Include="System.Xml" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="Options.cs" />
+    <Compile Include="Program.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+    <Compile Include="Properties\Settings.Designer.cs">
+      <AutoGen>True</AutoGen>
+      <DesignTimeSharedInput>True</DesignTimeSharedInput>
+      <DependentUpon>Settings.settings</DependentUpon>
+    </Compile>
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="App.config" />
+    <None Include="packages.config" />
+    <None Include="Properties\Settings.settings">
+      <Generator>SettingsSingleFileGenerator</Generator>
+      <LastGenOutput>Settings.Designer.cs</LastGenOutput>
+    </None>
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+</Project>
Index: /misc/tools/HeuristicLab.HiveDrain/HiveIraceResult/Options.cs
===================================================================
--- /misc/tools/HeuristicLab.HiveDrain/HiveIraceResult/Options.cs	(revision 16667)
+++ /misc/tools/HeuristicLab.HiveDrain/HiveIraceResult/Options.cs	(revision 16667)
@@ -0,0 +1,46 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System.Collections.Generic;
+using CommandLine;
+
+namespace HiveIraceResult {
+
+  class Options {
+    [Value(0, HelpText = "Configuration ID, set by irace.", Required = true)]
+    public int ConfigId { get; set; }
+
+    [Value(1, HelpText = "Instance ID, set by irace.", Required = true)]
+    public int InstanceId { get; set; }
+
+    [Value(2, HelpText = "Seed, set by irace.", Required = true)]
+    public long Seed { get; set; }
+
+    [Value(3, HelpText = "Name of the problem instance, set by irace.", Required = true)]
+    public string ProblemInstance { get; set; }
+
+    [Value(4, HelpText = "Number of alive candidate configurations, set by irace.", Required = true)]
+    public int NumConfigs { get; set; }
+
+    [Value(5, HelpText = "List of IDs of the alive configurations, set by irace.")]
+    public IEnumerable<int> AllConfigIds { get; set; }
+  }
+}
Index: /misc/tools/HeuristicLab.HiveDrain/HiveIraceResult/Program.cs
===================================================================
--- /misc/tools/HeuristicLab.HiveDrain/HiveIraceResult/Program.cs	(revision 16667)
+++ /misc/tools/HeuristicLab.HiveDrain/HiveIraceResult/Program.cs	(revision 16667)
@@ -0,0 +1,105 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using System.IO;
+using System.Linq;
+using System.Reflection;
+using CommandLine;
+using HeuristicLab.Clients.Hive;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Optimization;
+using HeuristicLab.PluginInfrastructure;
+using HeuristicLab.PluginInfrastructure.Manager;
+
+namespace HiveIraceResult {
+  class Program {
+    private const int EXIT_OK = 0;
+    private const int EXIT_ERR = 1;
+
+    static void Main(string[] args) {
+      //AppDomain.CurrentDomain.SetData("APP_CONFIG_FILE", "HiveIraceResult.exe.config");
+
+      var result = Parser.Default.ParseArguments<Options>(args)
+        .WithParsed(x => {
+          try {
+            Environment.Exit(Initialize(x));
+          } catch (Exception e) {
+            Console.Error.WriteLine(e.Message + Environment.NewLine + e.StackTrace);
+            Environment.Exit(EXIT_ERR);
+          }
+        })
+        .WithNotParsed(x => Environment.Exit(EXIT_ERR));
+    }
+
+    private static int Initialize(Options opts) {
+#if __DRY_RUN__
+      var random = new Random();
+      Console.WriteLine(random.Next(100000));
+      return EXIT_OK;
+#endif
+
+      var pluginManager = new PluginManager(Path.GetDirectoryName(Environment.GetCommandLineArgs()[0]));
+      pluginManager.DiscoverAndCheckPlugins();
+
+      var appManagerType = Assembly.GetAssembly(typeof(IPlugin)).DefinedTypes.Single(x => x.Name == "DefaultApplicationManager");
+      var appManager = Activator.CreateInstance(appManagerType, true);
+      var method = appManagerType.GetMethod("PrepareApplicationDomain", BindingFlags.NonPublic | BindingFlags.Instance);
+      method.Invoke(appManager, new object[] { pluginManager.Applications, pluginManager.Plugins });
+
+      ContentManager.Initialize(new PersistenceContentManager());
+
+      return Run(opts);
+    }
+
+    private static int Run(Options opts) {
+      HiveClient.Instance.Refresh();
+
+      var jobName = Properties.Settings.Default.JobPrefix + " " + string.Join("-", opts.ConfigId, opts.InstanceId, opts.Seed);
+      var job = HiveClient.Instance.Jobs.SingleOrDefault(x => x.Job.Name == jobName);
+      if (job == null) return EXIT_ERR;
+
+      HiveClient.LoadJob(job);
+      var task = job.HiveTasks.Single();
+      //var job = HiveServiceLocator.Instance.CallHiveService(x => x.GetJobs()).Single(x => x.Name == jobName);
+      //var task = HiveServiceLocator.Instance.CallHiveService(x => x.GetLightweightJobTasksWithoutStateLog(job.Id)).Single();
+      //var itemTask = HiveClient.LoadItemJob(task.Id);
+      var algorithm = task.ItemTask.Item as IAlgorithm;
+      var resultItem = algorithm.Runs.Last().Results[Properties.Settings.Default.ResultName];
+
+      try {
+        if (resultItem is DoubleValue) {
+          Console.WriteLine(((DoubleValue)resultItem).Value);
+        } else if (resultItem is IntValue) {
+          Console.WriteLine(((IntValue)resultItem).Value);
+        } else throw new InvalidOperationException("Algorithm results does not contain " + Properties.Settings.Default.ResultName + " or is not (IntValue|DoubleValue).");
+      } finally {
+#if !__NO_DELETE__
+        HiveClient.Delete(job);
+#endif
+      }
+
+      return EXIT_OK;
+    }
+  }
+}
Index: /misc/tools/HeuristicLab.HiveDrain/HiveIraceResult/Properties/AssemblyInfo.cs
===================================================================
--- /misc/tools/HeuristicLab.HiveDrain/HiveIraceResult/Properties/AssemblyInfo.cs	(revision 16667)
+++ /misc/tools/HeuristicLab.HiveDrain/HiveIraceResult/Properties/AssemblyInfo.cs	(revision 16667)
@@ -0,0 +1,36 @@
+﻿using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("HiveResult")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("HiveResult")]
+[assembly: AssemblyCopyright("Copyright ©  2018")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components.  If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("1be7096d-95e1-4428-8bb2-341c749ddcfc")]
+
+// Version information for an assembly consists of the following four values:
+//
+//      Major Version
+//      Minor Version
+//      Build Number
+//      Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
Index: /misc/tools/HeuristicLab.HiveDrain/HiveIraceResult/Properties/Settings.Designer.cs
===================================================================
--- /misc/tools/HeuristicLab.HiveDrain/HiveIraceResult/Properties/Settings.Designer.cs	(revision 16667)
+++ /misc/tools/HeuristicLab.HiveDrain/HiveIraceResult/Properties/Settings.Designer.cs	(revision 16667)
@@ -0,0 +1,44 @@
+﻿//------------------------------------------------------------------------------
+// <auto-generated>
+//     This code was generated by a tool.
+//     Runtime Version:4.0.30319.42000
+//
+//     Changes to this file may cause incorrect behavior and will be lost if
+//     the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace HiveIraceResult.Properties {
+    
+    
+    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.9.0.0")]
+    internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
+        
+        private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
+        
+        public static Settings Default {
+            get {
+                return defaultInstance;
+            }
+        }
+        
+        [global::System.Configuration.ApplicationScopedSettingAttribute()]
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.Configuration.DefaultSettingValueAttribute("irace")]
+        public string JobPrefix {
+            get {
+                return ((string)(this["JobPrefix"]));
+            }
+        }
+        
+        [global::System.Configuration.ApplicationScopedSettingAttribute()]
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.Configuration.DefaultSettingValueAttribute("BestQuality")]
+        public string ResultName {
+            get {
+                return ((string)(this["ResultName"]));
+            }
+        }
+    }
+}
Index: /misc/tools/HeuristicLab.HiveDrain/HiveIraceResult/Properties/Settings.settings
===================================================================
--- /misc/tools/HeuristicLab.HiveDrain/HiveIraceResult/Properties/Settings.settings	(revision 16667)
+++ /misc/tools/HeuristicLab.HiveDrain/HiveIraceResult/Properties/Settings.settings	(revision 16667)
@@ -0,0 +1,12 @@
+﻿<?xml version='1.0' encoding='utf-8'?>
+<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="HiveIraceResult.Properties" GeneratedClassName="Settings">
+  <Profiles />
+  <Settings>
+    <Setting Name="JobPrefix" Type="System.String" Scope="Application">
+      <Value Profile="(Default)">irace</Value>
+    </Setting>
+    <Setting Name="ResultName" Type="System.String" Scope="Application">
+      <Value Profile="(Default)">BestQuality</Value>
+    </Setting>
+  </Settings>
+</SettingsFile>
Index: /misc/tools/HeuristicLab.HiveDrain/HiveIraceResult/packages.config
===================================================================
--- /misc/tools/HeuristicLab.HiveDrain/HiveIraceResult/packages.config	(revision 16667)
+++ /misc/tools/HeuristicLab.HiveDrain/HiveIraceResult/packages.config	(revision 16667)
@@ -0,0 +1,4 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<packages>
+  <package id="CommandLineParser" version="2.2.1" targetFramework="net45" />
+</packages>
Index: /misc/tools/HeuristicLab.HiveDrain/HiveIraceSubmit/App.config
===================================================================
--- /misc/tools/HeuristicLab.HiveDrain/HiveIraceSubmit/App.config	(revision 16667)
+++ /misc/tools/HeuristicLab.HiveDrain/HiveIraceSubmit/App.config	(revision 16667)
@@ -0,0 +1,102 @@
+<?xml version="1.0" encoding="utf-8"?>
+<configuration>
+  <configSections>
+    <sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+      <section name="HiveIraceSubmit.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false"/>
+      <section name="HeuristicLab.Clients.Hive.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false"/>
+    </sectionGroup>
+    <sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+      <section name="HeuristicLab.Clients.Common.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false"/>
+    </sectionGroup>
+  </configSections>
+  <userSettings>
+    <HeuristicLab.Clients.Common.Properties.Settings>
+      <setting name="UserName" serializeAs="String">
+        <value>anonymous</value>
+      </setting>
+      <setting name="SavePassword" serializeAs="String">
+        <value>True</value>
+      </setting>
+      <setting name="Password" serializeAs="String">
+        <value>AQAAANCMnd8BFdERjHoAwE/Cl+sBAAAA36TvN4MDBkWUU6yPrzj49gAAAAACAAAAAAADZgAAwAAAABAAAABr3+B3SidbFwV5hCTHGoESAAAAAASAAACgAAAAEAAAAGSI+4CIIV5GmEl09qLBIxIYAAAAkpj3t9H1LBYhpUjjoM6qEc83XlY0xbnuFAAAADY3OscJ1F9ThR3SHB0sLax4TAN8</value>
+      </setting>
+    </HeuristicLab.Clients.Common.Properties.Settings>
+  </userSettings>
+  <applicationSettings>
+    <HiveIraceSubmit.Properties.Settings>
+      <setting name="HiveResources" serializeAs="String">
+        <value>none</value>
+      </setting>
+      <setting name="JobPrefix" serializeAs="String">
+        <value>prefix</value>
+      </setting>
+    </HiveIraceSubmit.Properties.Settings>
+    <HeuristicLab.Clients.Hive.Settings>
+      <setting name="MaxParallelUploads" serializeAs="String">
+        <value>2</value>
+      </setting>
+      <setting name="HLBinaryName" serializeAs="String">
+        <value>HeuristicLab 3.3.exe</value>
+      </setting>
+      <setting name="ResultPollingInterval" serializeAs="String">
+        <value>00:00:20</value>
+      </setting>
+      <setting name="MaxParallelDownloads" serializeAs="String">
+        <value>2</value>
+      </setting>
+      <setting name="MaxRepeatServiceCalls" serializeAs="String">
+        <value>5</value>
+      </setting>
+      <setting name="AnonymousUserName" serializeAs="String">
+        <value>anonymous</value>
+      </setting>
+      <setting name="MaxEndpointRetries" serializeAs="String">
+        <value>3</value>
+      </setting>
+      <setting name="EndpointConfigurationPriorities" serializeAs="Xml">
+        <value>
+          <ArrayOfString xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+            <string>NetBinding_IHiveService</string>
+            <string>WSHttpBinding_IHiveService</string>
+          </ArrayOfString>
+        </value>
+      </setting>
+    </HeuristicLab.Clients.Hive.Settings>
+  </applicationSettings>
+  <system.serviceModel>
+    <behaviors/>
+    <bindings>
+      <wsHttpBinding>
+        <binding name="WSHttpBinding_IHiveService" receiveTimeout="00:20:00" sendTimeout="00:20:00" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647">
+          <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647"/>
+          <security>
+            <message clientCredentialType="UserName"/>
+          </security>
+        </binding>
+      </wsHttpBinding>
+      <netTcpBinding>
+        <binding name="NetBinding_IHiveService" receiveTimeout="00:20:00" sendTimeout="00:20:00" maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647">
+          <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647"/>
+          <security mode="TransportWithMessageCredential">
+            <message clientCredentialType="UserName"/>
+          </security>
+        </binding>
+      </netTcpBinding>
+    </bindings>
+    <client>
+      <endpoint address="http://services.heuristiclab.com/Hive-3.4/HiveService.svc" binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IHiveService" contract="HeuristicLab.Clients.Hive.IHiveService" name="WSHttpBinding_IHiveService">
+        <identity>
+          <dns value="services.heuristiclab.com"/>
+        </identity>
+      </endpoint>
+      <endpoint address="net.tcp://services.heuristiclab.com/Hive-3.4/HiveService.svc" binding="netTcpBinding" bindingConfiguration="NetBinding_IHiveService" contract="HeuristicLab.Clients.Hive.IHiveService" name="NetBinding_IHiveService">
+        <identity>
+          <dns value="services.heuristiclab.com"/>
+        </identity>
+      </endpoint>
+    </client>
+  </system.serviceModel>
+  <startup>
+    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1"/>
+  </startup>
+</configuration>
Index: /misc/tools/HeuristicLab.HiveDrain/HiveIraceSubmit/HiveIraceSubmit.csproj
===================================================================
--- /misc/tools/HeuristicLab.HiveDrain/HiveIraceSubmit/HiveIraceSubmit.csproj	(revision 16667)
+++ /misc/tools/HeuristicLab.HiveDrain/HiveIraceSubmit/HiveIraceSubmit.csproj	(revision 16667)
@@ -0,0 +1,109 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProjectGuid>{5D3045E7-DE43-4835-8780-04595F3DF0D8}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <RootNamespace>HiveIraceSubmit</RootNamespace>
+    <AssemblyName>HiveIraceSubmit</AssemblyName>
+    <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+    <TargetFrameworkProfile />
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DefineConstants>TRACE;DEBUG;__DRY_RUN__</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="CommandLine, Version=2.2.1.0, Culture=neutral, PublicKeyToken=de6f01bd326f8c32, processorArchitecture=MSIL">
+      <HintPath>..\packages\CommandLineParser.2.2.1\lib\net45\CommandLine.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Clients.Common-3.3">
+      <HintPath>..\..\..\..\trunk\bin\HeuristicLab.Clients.Common-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Clients.Hive-3.3">
+      <HintPath>..\..\..\..\trunk\bin\HeuristicLab.Clients.Hive-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Collections-3.3">
+      <HintPath>..\..\..\..\trunk\bin\HeuristicLab.Collections-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Common-3.3">
+      <HintPath>..\..\..\..\trunk\bin\HeuristicLab.Common-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Common.Resources-3.3">
+      <HintPath>..\..\..\..\trunk\bin\HeuristicLab.Common.Resources-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Core-3.3">
+      <HintPath>..\..\..\..\trunk\bin\HeuristicLab.Core-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Data-3.3">
+      <HintPath>..\..\..\..\trunk\bin\HeuristicLab.Data-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Hive-3.3">
+      <HintPath>..\..\..\..\trunk\bin\HeuristicLab.Hive-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.MainForm-3.3">
+      <HintPath>..\..\..\..\trunk\bin\HeuristicLab.MainForm-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Optimization-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\trunk\bin\HeuristicLab.Optimization-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Persistence-3.3">
+      <HintPath>..\..\..\..\trunk\bin\HeuristicLab.Persistence-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.PluginInfrastructure-3.3">
+      <HintPath>..\..\..\..\trunk\bin\HeuristicLab.PluginInfrastructure-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="System" />
+    <Reference Include="System.Configuration" />
+    <Reference Include="System.Core" />
+    <Reference Include="System.Drawing" />
+    <Reference Include="System.Runtime.Remoting" />
+    <Reference Include="System.Runtime.Serialization" />
+    <Reference Include="System.Runtime.Serialization.Formatters.Soap" />
+    <Reference Include="System.ServiceModel" />
+    <Reference Include="System.ServiceModel.Web" />
+    <Reference Include="System.Xml.Linq" />
+    <Reference Include="System.Data.DataSetExtensions" />
+    <Reference Include="Microsoft.CSharp" />
+    <Reference Include="System.Data" />
+    <Reference Include="System.Xml" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="Options.cs" />
+    <Compile Include="Program.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+    <Compile Include="Properties\Settings.Designer.cs">
+      <AutoGen>True</AutoGen>
+      <DesignTimeSharedInput>True</DesignTimeSharedInput>
+      <DependentUpon>Settings.settings</DependentUpon>
+    </Compile>
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="App.config" />
+    <None Include="packages.config" />
+    <None Include="Properties\Settings.settings">
+      <Generator>SettingsSingleFileGenerator</Generator>
+      <LastGenOutput>Settings.Designer.cs</LastGenOutput>
+    </None>
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+</Project>
Index: /misc/tools/HeuristicLab.HiveDrain/HiveIraceSubmit/Options.cs
===================================================================
--- /misc/tools/HeuristicLab.HiveDrain/HiveIraceSubmit/Options.cs	(revision 16667)
+++ /misc/tools/HeuristicLab.HiveDrain/HiveIraceSubmit/Options.cs	(revision 16667)
@@ -0,0 +1,24 @@
+﻿using System.Collections.Generic;
+using CommandLine;
+
+namespace HiveIraceSubmit {
+  class Options {
+    [Value(0, HelpText = "Configuration ID, set by irace.")]
+    public int ConfigId { get; set; }
+
+    [Value(1, HelpText = "Instance ID, set by irace.")]
+    public int InstanceId { get; set; }
+
+    [Value(2, HelpText = "Seed, set by irace.")]
+    public long Seed { get; set; }
+
+    [Value(3, Default = "20-15-35", HelpText = "Name of the problem instance, set by irace..", Required = true)]
+    public string ProblemInstance { get; set; }
+
+    [Value(4, HelpText = "Name of the algorithm instance.", Required = true)]
+    public string Algorithm { get; set; }
+
+    [Value(5, HelpText = "The parameters and their corresponding value.", Required = false)]
+    public IEnumerable<string> Configuration { get; set; }
+  }
+}
Index: /misc/tools/HeuristicLab.HiveDrain/HiveIraceSubmit/Program.cs
===================================================================
--- /misc/tools/HeuristicLab.HiveDrain/HiveIraceSubmit/Program.cs	(revision 16667)
+++ /misc/tools/HeuristicLab.HiveDrain/HiveIraceSubmit/Program.cs	(revision 16667)
@@ -0,0 +1,189 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Reflection;
+using System.Threading;
+using CommandLine;
+using HeuristicLab.Clients.Hive;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Optimization;
+using HeuristicLab.PluginInfrastructure;
+using HeuristicLab.PluginInfrastructure.Manager;
+
+namespace HiveIraceSubmit {
+  class Program {
+    public const int EXIT_OK = 0;
+    public const int EXIT_ERR = 1;
+
+    static void Main(string[] args) {
+      //AppDomain.CurrentDomain.SetData("APP_CONFIG_FILE", "HiveIraceSubmit.exe.config");
+      
+      
+      var result = Parser.Default.ParseArguments<Options>(args)
+        .WithParsed(x => {
+          try {
+            Environment.Exit(Initialize(x));
+          } catch (Exception e) {
+            Console.Error.WriteLine(e.Message + Environment.NewLine + e.StackTrace);
+            if (e.InnerException != null) {
+              Console.Error.WriteLine("Inner Exception");
+              Console.Error.WriteLine(e.InnerException.Message + Environment.NewLine + e.InnerException.StackTrace);
+            }
+            Environment.Exit(EXIT_ERR);
+          }
+        })
+        .WithNotParsed(x => Environment.Exit(EXIT_ERR));
+    }
+
+    private static int Initialize(Options opts) {
+#if __DRY_RUN__
+      Console.WriteLine(Guid.NewGuid());
+      return EXIT_OK;
+#endif
+      var pluginManager = new PluginManager(Path.GetDirectoryName(Environment.GetCommandLineArgs()[0]));
+      pluginManager.DiscoverAndCheckPlugins();
+
+      var appManagerType = Assembly.GetAssembly(typeof(IPlugin)).DefinedTypes.Single(x => x.Name == "DefaultApplicationManager");
+      var appManager = Activator.CreateInstance(appManagerType, true);
+      var method = appManagerType.GetMethod("PrepareApplicationDomain", BindingFlags.NonPublic | BindingFlags.Instance);
+      method.Invoke(appManager, new object[] { pluginManager.Applications, pluginManager.Plugins });
+
+      ContentManager.Initialize(new PersistenceContentManager());
+
+      return Run(opts);
+    }
+
+    private static int Run(Options opts) {
+      HiveClient.Instance.Refresh();
+
+      var file = Path.Combine(opts.ProblemInstance, opts.Algorithm);
+      var optimizer = ContentManager.Load(file) as IAlgorithm;
+      if (optimizer == null) {
+        Console.Error.WriteLine("File does not contain item of type IAlgorithm");
+        return EXIT_ERR;
+      }
+
+      foreach (var config in opts.Configuration) {
+        var split = config.Split('=');
+        var paramPath = split[0].Split('.');
+        var strValue = split[1].Trim();
+
+        var paramItem = optimizer as IParameterizedItem;
+        for (var i = 0; i < paramPath.Length - 1; i++) {
+          var p = paramItem.Parameters[paramPath[i]];
+          if (p is IValueParameter) paramItem = (IParameterizedItem)((IValueParameter)p).Value;
+          else paramItem = (IParameterizedItem)((dynamic)p).Value;
+        }
+        var param = paramItem.Parameters[paramPath.Last()];
+        Parameterize(param, strValue);
+      }
+
+      var hiveTask = ItemTask.GetItemTaskForItem(optimizer);
+      var task = hiveTask.CreateHiveTask();
+      var rJob = new RefreshableJob();
+      rJob.Job.Name = Properties.Settings.Default.JobPrefix + " " + string.Join("-", opts.ConfigId, opts.InstanceId, opts.Seed);
+      rJob.Job.Description = opts.Algorithm + " " + string.Join(", ", opts.Configuration);
+      rJob.Job.ResourceIds = new List<Guid>() { Guid.Parse(Properties.Settings.Default.HiveResources) };
+      //rJob.Job.ResourceNames = Properties.Settings.Default.HiveResources;
+      rJob.HiveTasks.Add(task);
+
+      HiveClient.Store(rJob, CancellationToken.None);
+      //HiveClient.StartJob(_ => { }, rJob, CancellationToken.None); // this is async
+      //HiveClient.LoadJob(rJob);
+
+      Console.WriteLine(rJob.Job.Id);
+
+      return EXIT_OK;
+    }
+
+    private static void Parameterize(IParameter param, string strValue) {
+      var valueParam = param as IValueParameter;
+      if (valueParam != null) {
+        var intParam = valueParam as IValueParameter<IntValue>;
+        if (intParam != null) {
+          var val = int.Parse(strValue);
+          intParam.Value.Value = val;
+          return;
+        }
+        var doubleParam = valueParam as IValueParameter<DoubleValue>;
+        if (doubleParam != null) {
+          var val = double.Parse(strValue);
+          doubleParam.Value.Value = val;
+          return;
+        }
+        var percentParam = valueParam as IValueParameter<PercentValue>;
+        if (percentParam != null) {
+          var val = double.Parse(strValue);
+          percentParam.Value.Value = val;
+          return;
+        }
+        var boolParam = valueParam as IValueParameter<BoolValue>;
+        if (boolParam != null) {
+          var val = bool.Parse(strValue);
+          boolParam.Value.Value = val;
+          return;
+        }
+        var strParam = valueParam as IValueParameter<StringValue>;
+        if (strParam != null) {
+          strParam.Value.Value = strValue;
+          return;
+        }
+#region IValueParameter<EnumValue<T>>
+        var isEnumParam = valueParam.Value != null && valueParam.Value.GetType().IsGenericType
+                          && typeof(EnumValue<>).IsAssignableFrom(valueParam.Value.GetType().GetGenericTypeDefinition());
+        if (isEnumParam) {
+          dynamic enumValue = valueParam.Value; // EnumValue<T>
+          dynamic val = Enum.Parse(valueParam.Value.GetType().GetGenericArguments()[0], strValue);
+          enumValue.Value = val;
+          return;
+        }
+#endregion
+        throw new InvalidOperationException("Unknown parameter type for parameter " + param.Name);
+      }
+
+#region IConstrainedValueParameter<T>
+      var isCstrParam = param != null && param.GetType().IsGenericType
+                        && typeof(IConstrainedValueParameter<>).IsAssignableFrom(param.GetType().GetGenericTypeDefinition());
+      if (isCstrParam) {
+        // Abandon all hope, ye who enter here.
+        dynamic validValues = ((dynamic)param).ValidValues;
+        dynamic val = null;
+        foreach (dynamic v in validValues) {
+          if (v.Name == strValue) {
+            val = v;
+            break;
+          }
+        }
+        ((dynamic)param).Value = val;
+        return;
+      }
+#endregion
+
+      throw new InvalidOperationException("Unknown parameter type for parameter " + param.Name);
+    }
+  }
+}
Index: /misc/tools/HeuristicLab.HiveDrain/HiveIraceSubmit/Properties/AssemblyInfo.cs
===================================================================
--- /misc/tools/HeuristicLab.HiveDrain/HiveIraceSubmit/Properties/AssemblyInfo.cs	(revision 16667)
+++ /misc/tools/HeuristicLab.HiveDrain/HiveIraceSubmit/Properties/AssemblyInfo.cs	(revision 16667)
@@ -0,0 +1,36 @@
+﻿using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("HiveIraceSubmit")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("HiveIraceSubmit")]
+[assembly: AssemblyCopyright("Copyright ©  2018")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components.  If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("5d3045e7-de43-4835-8780-04595f3df0d8")]
+
+// Version information for an assembly consists of the following four values:
+//
+//      Major Version
+//      Minor Version
+//      Build Number
+//      Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
Index: /misc/tools/HeuristicLab.HiveDrain/HiveIraceSubmit/Properties/Settings.Designer.cs
===================================================================
--- /misc/tools/HeuristicLab.HiveDrain/HiveIraceSubmit/Properties/Settings.Designer.cs	(revision 16667)
+++ /misc/tools/HeuristicLab.HiveDrain/HiveIraceSubmit/Properties/Settings.Designer.cs	(revision 16667)
@@ -0,0 +1,44 @@
+﻿//------------------------------------------------------------------------------
+// <auto-generated>
+//     This code was generated by a tool.
+//     Runtime Version:4.0.30319.42000
+//
+//     Changes to this file may cause incorrect behavior and will be lost if
+//     the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace HiveIraceSubmit.Properties {
+    
+    
+    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.9.0.0")]
+    internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
+        
+        private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
+        
+        public static Settings Default {
+            get {
+                return defaultInstance;
+            }
+        }
+        
+        [global::System.Configuration.ApplicationScopedSettingAttribute()]
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.Configuration.DefaultSettingValueAttribute("HiveSlaves hagblade0")]
+        public string HiveResources {
+            get {
+                return ((string)(this["HiveResources"]));
+            }
+        }
+        
+        [global::System.Configuration.ApplicationScopedSettingAttribute()]
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.Configuration.DefaultSettingValueAttribute("irace")]
+        public string JobPrefix {
+            get {
+                return ((string)(this["JobPrefix"]));
+            }
+        }
+    }
+}
Index: /misc/tools/HeuristicLab.HiveDrain/HiveIraceSubmit/Properties/Settings.settings
===================================================================
--- /misc/tools/HeuristicLab.HiveDrain/HiveIraceSubmit/Properties/Settings.settings	(revision 16667)
+++ /misc/tools/HeuristicLab.HiveDrain/HiveIraceSubmit/Properties/Settings.settings	(revision 16667)
@@ -0,0 +1,12 @@
+﻿<?xml version='1.0' encoding='utf-8'?>
+<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="HiveIraceSubmit.Properties" GeneratedClassName="Settings">
+  <Profiles />
+  <Settings>
+    <Setting Name="HiveResources" Type="System.String" Scope="Application">
+      <Value Profile="(Default)">HiveSlaves hagblade0</Value>
+    </Setting>
+    <Setting Name="JobPrefix" Type="System.String" Scope="Application">
+      <Value Profile="(Default)">irace</Value>
+    </Setting>
+  </Settings>
+</SettingsFile>
Index: /misc/tools/HeuristicLab.HiveDrain/HiveIraceSubmit/packages.config
===================================================================
--- /misc/tools/HeuristicLab.HiveDrain/HiveIraceSubmit/packages.config	(revision 16667)
+++ /misc/tools/HeuristicLab.HiveDrain/HiveIraceSubmit/packages.config	(revision 16667)
@@ -0,0 +1,4 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<packages>
+  <package id="CommandLineParser" version="2.2.1" targetFramework="net45" />
+</packages>
Index: /misc/tools/HeuristicLab.HiveDrain/HiveStatus/App.config
===================================================================
--- /misc/tools/HeuristicLab.HiveDrain/HiveStatus/App.config	(revision 16666)
+++ /misc/tools/HeuristicLab.HiveDrain/HiveStatus/App.config	(revision 16667)
@@ -1,50 +1,25 @@
-﻿<?xml version="1.0"?>
+<?xml version="1.0"?>
 <configuration>
   <configSections>
     <sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-      <section name="HeuristicLab.Clients.Hive.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
+      <section name="HeuristicLab.Clients.Hive.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false"/>
     </sectionGroup>
     <sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-      <section name="HeuristicLab.Clients.Common.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
+      <section name="HeuristicLab.Clients.Common.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false"/>
     </sectionGroup>
   </configSections>
-  <connectionStrings>
-  </connectionStrings>
-  <system.serviceModel>
-    <behaviors />
-    <bindings>
-      <wsHttpBinding>
-        <binding name="WSHttpBinding_IHiveService" receiveTimeout="00:20:00" sendTimeout="00:20:00" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647">
-          <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
-          <security>
-            <message clientCredentialType="UserName" />
-          </security>
-        </binding>
-      </wsHttpBinding>
-      <netTcpBinding>
-        <binding name="NetBinding_IHiveService" receiveTimeout="00:20:00" sendTimeout="00:20:00" maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647">
-          <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
-          <security mode="TransportWithMessageCredential">
-            <message clientCredentialType="UserName" />
-          </security>
-        </binding>
-      </netTcpBinding>
-    </bindings>
-    <client>
-      <endpoint address="http://services.heuristiclab.com/Hive-3.3/HiveService.svc" binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IHiveService" contract="HeuristicLab.Clients.Hive.IHiveService" name="WSHttpBinding_IHiveService">
-        <identity>
-          <dns value="services.heuristiclab.com" />
-        </identity>
-      </endpoint>
-      <endpoint address="net.tcp://services.heuristiclab.com/Hive-3.3/HiveService.svc" binding="netTcpBinding" bindingConfiguration="NetBinding_IHiveService" contract="HeuristicLab.Clients.Hive.IHiveService" name="NetBinding_IHiveService">
-        <identity>
-          <dns value="services.heuristiclab.com" />
-        </identity>
-      </endpoint>
-    </client>
-  </system.serviceModel>
-  <startup>
-    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
-  </startup>
+  <userSettings>
+    <HeuristicLab.Clients.Common.Properties.Settings>
+      <setting name="UserName" serializeAs="String">
+        <value>anonymous</value>
+      </setting>
+      <setting name="SavePassword" serializeAs="String">
+        <value>True</value>
+      </setting>
+      <setting name="Password" serializeAs="String">
+        <value>AQAAANCMnd8BFdERjHoAwE/Cl+sBAAAA36TvN4MDBkWUU6yPrzj49gAAAAACAAAAAAADZgAAwAAAABAAAABr3+B3SidbFwV5hCTHGoESAAAAAASAAACgAAAAEAAAAGSI+4CIIV5GmEl09qLBIxIYAAAAkpj3t9H1LBYhpUjjoM6qEc83XlY0xbnuFAAAADY3OscJ1F9ThR3SHB0sLax4TAN8</value>
+      </setting>
+    </HeuristicLab.Clients.Common.Properties.Settings>
+  </userSettings>
   <applicationSettings>
     <HeuristicLab.Clients.Hive.Settings>
@@ -80,16 +55,39 @@
     </HeuristicLab.Clients.Hive.Settings>
   </applicationSettings>
-  <userSettings>
-    <HeuristicLab.Clients.Common.Properties.Settings>
-      <setting name="UserName" serializeAs="String">
-        <value>anonymous</value>
-      </setting>
-      <setting name="SavePassword" serializeAs="String">
-        <value>True</value>
-      </setting>
-      <setting name="Password" serializeAs="String">
-        <value>AQAAANCMnd8BFdERjHoAwE/Cl+sBAAAA36TvN4MDBkWUU6yPrzj49gAAAAACAAAAAAADZgAAwAAAABAAAABr3+B3SidbFwV5hCTHGoESAAAAAASAAACgAAAAEAAAAGSI+4CIIV5GmEl09qLBIxIYAAAAkpj3t9H1LBYhpUjjoM6qEc83XlY0xbnuFAAAADY3OscJ1F9ThR3SHB0sLax4TAN8</value>
-      </setting>
-    </HeuristicLab.Clients.Common.Properties.Settings>
-  </userSettings>
+  <system.serviceModel>
+    <behaviors/>
+    <bindings>
+      <wsHttpBinding>
+        <binding name="WSHttpBinding_IHiveService" receiveTimeout="00:20:00" sendTimeout="00:20:00" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647">
+          <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647"/>
+          <security>
+            <message clientCredentialType="UserName"/>
+          </security>
+        </binding>
+      </wsHttpBinding>
+      <netTcpBinding>
+        <binding name="NetBinding_IHiveService" receiveTimeout="00:20:00" sendTimeout="00:20:00" maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647">
+          <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647"/>
+          <security mode="TransportWithMessageCredential">
+            <message clientCredentialType="UserName"/>
+          </security>
+        </binding>
+      </netTcpBinding>
+    </bindings>
+    <client>
+      <endpoint address="http://services.heuristiclab.com/Hive-3.4/HiveService.svc" binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IHiveService" contract="HeuristicLab.Clients.Hive.IHiveService" name="WSHttpBinding_IHiveService">
+        <identity>
+          <dns value="services.heuristiclab.com"/>
+        </identity>
+      </endpoint>
+      <endpoint address="net.tcp://services.heuristiclab.com/Hive-3.4/HiveService.svc" binding="netTcpBinding" bindingConfiguration="NetBinding_IHiveService" contract="HeuristicLab.Clients.Hive.IHiveService" name="NetBinding_IHiveService">
+        <identity>
+          <dns value="services.heuristiclab.com"/>
+        </identity>
+      </endpoint>
+    </client>
+  </system.serviceModel>
+  <startup>
+    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1"/>
+  </startup>
 </configuration>
Index: /misc/tools/HeuristicLab.HiveDrain/HiveStatus/HiveStatus.csproj
===================================================================
--- /misc/tools/HeuristicLab.HiveDrain/HiveStatus/HiveStatus.csproj	(revision 16666)
+++ /misc/tools/HeuristicLab.HiveDrain/HiveStatus/HiveStatus.csproj	(revision 16667)
@@ -9,6 +9,7 @@
     <RootNamespace>HiveStatus</RootNamespace>
     <AssemblyName>HiveStatus</AssemblyName>
-    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
+    <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
     <FileAlignment>512</FileAlignment>
+    <TargetFrameworkProfile />
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
@@ -18,5 +19,5 @@
     <Optimize>false</Optimize>
     <OutputPath>bin\Debug\</OutputPath>
-    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DefineConstants>TRACE;DEBUG</DefineConstants>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
Index: /misc/tools/HeuristicLab.HiveDrain/HiveStatus/Options.cs
===================================================================
--- /misc/tools/HeuristicLab.HiveDrain/HiveStatus/Options.cs	(revision 16666)
+++ /misc/tools/HeuristicLab.HiveDrain/HiveStatus/Options.cs	(revision 16667)
@@ -25,14 +25,13 @@
 namespace HiveStatus {
   internal class Options {
-    [Option('u', "user", HelpText = "Username")]
+    [Value(0, HelpText = "Job ID to check status for, if omitted all jobs of the user will be checked.", Required = false)]
+    public Guid JobId { get; set; }
+
+    [Option('u', "user", HelpText = "There are three ways to supply login information, by argument (here), by config file or by being prompted for it.")]
     public string Username { get; set; }
-    [Option('p', "password", HelpText = "Password")]
+    [Option('p', "password", HelpText = "There are three ways to supply login information, by argument (here), by config file or by being prompted for it.")]
     public string Password { get; set; }
-
-    [Option('a', "all", HelpText = "Checks status of all jobs.", SetName = "ALL")]
-    public bool All { get; set; }
-    [Option('j', "job", HelpText = "Checks status of a certain job", SetName = "SINGLE")]
-    public Guid JobId { get; set; }
-    [Option('v', "verbose", HelpText = "More detailed status of a job")]
+    
+    [Option('v', "verbose", HelpText = "More detailed/expensive status check")]
     public bool Verbose { get; set; }
   }
Index: /misc/tools/HeuristicLab.HiveDrain/HiveStatus/Program.cs
===================================================================
--- /misc/tools/HeuristicLab.HiveDrain/HiveStatus/Program.cs	(revision 16666)
+++ /misc/tools/HeuristicLab.HiveDrain/HiveStatus/Program.cs	(revision 16667)
@@ -31,9 +31,9 @@
     public const int EXIT_OK = 0;
     public const int EXIT_ERR = 1;
-    public const int EXIT_WAITING = 2;
-    public const int EXIT_FAILED = 3;
-    public const int EXIT_NOTFOUND = 4;
+    public const int EXIT_FAILED = 2;
+    public const int EXIT_NOTFOUND = 3;
 
     static void Main(string[] args) {
+      //AppDomain.CurrentDomain.SetData("APP_CONFIG_FILE", "HiveStatus.exe.config");
       var result = Parser.Default.ParseArguments<Options>(args)
         .WithParsed(x => {
@@ -45,15 +45,137 @@
     }
 
-    private static int Run(Options opt) {
-      if (!string.IsNullOrEmpty(opt.Username)) {
-        HiveServiceLocator.Instance.Username = opt.Username;
-        var password = opt.Password;
+    private static int Run(Options opts) {
+#if __DRY_RUN__
+      Console.WriteLine("DONE");
+      return EXIT_OK;
+#endif
+      if (string.IsNullOrEmpty(opts.Username) && HeuristicLab.Clients.Common.Properties.Settings.Default.UserName.ToLower() == "anonymous") {
+        Console.Write("Username: ");
+        opts.Username = Console.ReadLine();
+      }
+      if (!string.IsNullOrEmpty(opts.Username)) {
+        HiveServiceLocator.Instance.Username = opts.Username;
+        var password = opts.Password;
         if (string.IsNullOrEmpty(password)) {
-          Console.Error.Write("Password for " + opt.Username + ": ");
+          Console.Error.Write("Password for " + opts.Username + ": ");
           password = ReadPassword();
         }
         HiveServiceLocator.Instance.Password = password;
       }
-      return CheckStatus(opt);
+      return CheckStatus(opts);
+    }
+
+    private static int CheckStatus(Options opt) {
+      if (opt.JobId == default(Guid)) return CheckStatusAll(opt);
+
+      var jobId = opt.JobId;
+
+      if (opt.Verbose) {
+
+        List<LightweightTask> tasks = null;
+        try {
+          tasks = HiveServiceLocator.Instance.CallHiveService(x => x.GetLightweightJobTasksWithoutStateLog(jobId));
+        } catch (System.ServiceModel.Security.SecurityAccessDeniedException) {
+          Console.WriteLine("?");
+          return EXIT_NOTFOUND;
+        }
+
+        int completed, failed, running, paused;
+        GetStats(tasks, out completed, out failed, out running, out paused);
+        Console.WriteLine(FormatStateInfo(tasks.Count, completed, failed, running, paused));
+        return failed > 0 ? EXIT_FAILED : EXIT_OK;
+
+      } else {
+
+        Job job = null;
+        try {
+          job = HiveServiceLocator.Instance.CallHiveService(x => x.GetJob(jobId));
+        } catch (System.ServiceModel.Security.SecurityAccessDeniedException) {
+          Console.WriteLine("?");
+          return EXIT_NOTFOUND;
+        }
+        Console.WriteLine(FormatStateInfo(job.JobCount, job.FinishedCount, job.CalculatingCount));
+        return EXIT_OK;
+      }
+    }
+
+    private static int CheckStatusAll(Options opt) {
+      List<Job> jobs = null;
+      try {
+        jobs = HiveServiceLocator.Instance.CallHiveService(x => x.GetJobs());
+      } catch (System.ServiceModel.Security.SecurityAccessDeniedException) {
+        Console.WriteLine("?");
+        return EXIT_NOTFOUND;
+      }
+
+      if (opt.Verbose) {
+        List<LightweightTask> tasks = null;
+        int totFinished, totFailed, totCalculating, totPaused, total;
+        totFinished = totFailed = totCalculating = totPaused = total = 0;
+        try {
+
+          foreach (var j in jobs) {
+            tasks = HiveServiceLocator.Instance.CallHiveService(x => x.GetLightweightJobTasksWithoutStateLog(j.Id));
+
+            int finished, failed, calculating, paused;
+            GetStats(tasks, out finished, out failed, out calculating, out paused);
+            totFinished += finished;
+            totFailed += failed;
+            totCalculating += calculating;
+            totPaused += paused;
+            total += tasks.Count;
+
+            Console.WriteLine(FormatStateInfo(tasks.Count, finished, failed, calculating, paused) + " | " + Truncate(j.Name, 40).PadRight(40) + " | " + j.DateCreated.ToShortDateString());
+          }
+        } catch (System.ServiceModel.Security.SecurityAccessDeniedException) {
+          Console.WriteLine("?");
+          return EXIT_NOTFOUND;
+        }
+        Console.WriteLine();
+        Console.WriteLine(FormatStateInfo(total, totFinished, totFailed, totCalculating, totPaused) + " | ALL");
+        return totFailed > 0 ? EXIT_FAILED : EXIT_OK;
+      } else {
+        int totFinished, totCalculating, total;
+        totFinished = totCalculating = total = 0;
+        foreach (var j in jobs) {
+          Console.WriteLine(FormatStateInfo(j.JobCount, j.FinishedCount, j.CalculatingCount) + " | " + Truncate(j.Name, 40).PadRight(40) + " | " + j.DateCreated.ToShortDateString());
+          totFinished += j.FinishedCount;
+          totCalculating += j.CalculatingCount;
+          total += j.JobCount;
+        }
+        Console.WriteLine();
+        Console.WriteLine(FormatStateInfo(total, totFinished, totCalculating) + " | ALL");
+        return EXIT_OK;
+      }
+    }
+
+    private static void GetStats(List<LightweightTask> tasks, out int completed, out int failed, out int running, out int paused) {
+      completed = tasks.Count(x => x.State == TaskState.Finished);
+      failed = tasks.Count(x => x.State == TaskState.Failed || x.State == TaskState.Aborted);
+      running = tasks.Count(x => x.State == TaskState.Calculating || x.State == TaskState.Transferring
+|| x.State == TaskState.Waiting);
+      paused = tasks.Count(x => x.State == TaskState.Paused);
+    }
+
+    private static string FormatStateInfo(int total, int finished, int calculating) {
+      var state = finished == total ? "DONE" : "CALC";
+      return string.Join(" ", new object[] { state
+        , "CALC=" + calculating.ToString().PadRight(4)
+        , "DONE=" + finished.ToString().PadRight(4) });
+    }
+
+    private static string FormatStateInfo(int total, int finished, int failed, int calculating, int paused) {
+      var state = finished == total ? "DONE" : failed > 0 ? "FAIL" : calculating > 0 ? "CALC" : paused > 0 ? "PAUS" : "NDEF";
+      return string.Join(" ", new object[] { state
+        , "CALC=" + calculating.ToString().PadRight(4)
+        , "DONE=" + finished.ToString().PadRight(4)
+        , "FAIL=" + failed.ToString().PadRight(4)
+        , "PAUS=" + paused.ToString().PadRight(4) });
+    }
+
+    #region Helpers
+    private static string Truncate(string text, int length) {
+      if (text.Length <= length) return text;
+      return text.Substring(0, length - 3) + "...";
     }
 
@@ -103,117 +225,5 @@
       return sb.ToString();
     }
-
-    private static int CheckStatus(Options opt) {
-      if (opt.All) return CheckStatusAll(opt);
-
-      var jobId = opt.JobId;
-
-      if (opt.Verbose) {
-
-        List<LightweightTask> tasks = null;
-        try {
-          tasks = HiveServiceLocator.Instance.CallHiveService(x => x.GetLightweightJobTasksWithoutStateLog(jobId));
-        } catch (System.ServiceModel.Security.SecurityAccessDeniedException) {
-          Console.WriteLine("?");
-          return EXIT_NOTFOUND;
-        }
-
-        int completed, failed, running, paused;
-        GetStats(tasks, out completed, out failed, out running, out paused);
-        Console.WriteLine(FormatStateInfo(tasks.Count, completed, failed, running, paused));
-        return completed == tasks.Count ? EXIT_OK : failed > 0 ? EXIT_FAILED : EXIT_WAITING;
-
-      } else {
-
-        Job job = null;
-        try {
-          job = HiveServiceLocator.Instance.CallHiveService(x => x.GetJob(jobId));
-        } catch (System.ServiceModel.Security.SecurityAccessDeniedException) {
-          Console.WriteLine("?");
-          return EXIT_NOTFOUND;
-        }
-        Console.WriteLine(FormatStateInfo(job.JobCount, job.FinishedCount, job.CalculatingCount));
-        return job.FinishedCount == job.JobCount ? EXIT_OK : EXIT_WAITING;
-      }
-    }
-
-    private static int CheckStatusAll(Options opt) {
-      List<Job> jobs = null;
-      try {
-        jobs = HiveServiceLocator.Instance.CallHiveService(x => x.GetJobs());
-      } catch (System.ServiceModel.Security.SecurityAccessDeniedException) {
-        Console.WriteLine("?");
-        return EXIT_NOTFOUND;
-      }
-
-      if (opt.Verbose) {
-        List<LightweightTask> tasks = null;
-        int totFinished, totFailed, totCalculating, totPaused, total;
-        totFinished = totFailed = totCalculating = totPaused = total = 0;
-        try {
-
-          foreach (var j in jobs) {
-            tasks = HiveServiceLocator.Instance.CallHiveService(x => x.GetLightweightJobTasksWithoutStateLog(j.Id));
-
-            int finished, failed, calculating, paused;
-            GetStats(tasks, out finished, out failed, out calculating, out paused);
-            totFinished += finished;
-            totFailed += failed;
-            totCalculating += calculating;
-            totPaused += paused;
-            total += tasks.Count;
-
-            Console.WriteLine(FormatStateInfo(tasks.Count, finished, failed, calculating, paused) + " | " + Truncate(j.Name, 40).PadRight(40) + " | " + j.DateCreated.ToShortDateString());
-          }
-        } catch (System.ServiceModel.Security.SecurityAccessDeniedException) {
-          Console.WriteLine("?");
-          return EXIT_NOTFOUND;
-        }
-        Console.WriteLine();
-        Console.WriteLine(FormatStateInfo(total, totFinished, totFailed, totCalculating, totPaused) + " | ALL");
-        return totFinished == total ? EXIT_OK : totFailed > 0 ? EXIT_FAILED : EXIT_WAITING;
-      } else {
-        int totFinished, totCalculating, total;
-        totFinished = totCalculating = total = 0;
-        foreach (var j in jobs) {
-          Console.WriteLine(FormatStateInfo(j.JobCount, j.FinishedCount, j.CalculatingCount) + " | " + Truncate(j.Name, 40).PadRight(40) + " | " + j.DateCreated.ToShortDateString());
-          totFinished += j.FinishedCount;
-          totCalculating += j.CalculatingCount;
-          total += j.JobCount;
-        }
-        Console.WriteLine();
-        Console.WriteLine(FormatStateInfo(total, totFinished, totCalculating) + " | ALL");
-        return totFinished == total ? EXIT_OK : EXIT_WAITING;
-      }
-    }
-
-    private static void GetStats(List<LightweightTask> tasks, out int completed, out int failed, out int running, out int paused) {
-      completed = tasks.Count(x => x.State == TaskState.Finished);
-      failed = tasks.Count(x => x.State == TaskState.Failed || x.State == TaskState.Aborted);
-      running = tasks.Count(x => x.State == TaskState.Calculating || x.State == TaskState.Transferring
-|| x.State == TaskState.Waiting);
-      paused = tasks.Count(x => x.State == TaskState.Paused);
-    }
-
-    private static string FormatStateInfo(int total, int finished, int calculating) {
-      var state = finished == total ? "DONE" : "CALC";
-      return string.Join(" ", new object[] { state
-        , "CALC=" + calculating.ToString().PadRight(4)
-        , "DONE=" + finished.ToString().PadRight(4) });
-    }
-
-    private static string FormatStateInfo(int total, int finished, int failed, int calculating, int paused) {
-      var state = finished == total ? "DONE" : failed > 0 ? "FAIL" : calculating > 0 ? "CALC" : paused > 0 ? "PAUS" : "NDEF";
-      return string.Join(" ", new object[] { state
-        , "CALC=" + calculating.ToString().PadRight(4)
-        , "DONE=" + finished.ToString().PadRight(4)
-        , "FAIL=" + failed.ToString().PadRight(4)
-        , "PAUS=" + paused.ToString().PadRight(4) });
-    }
-
-    private static string Truncate(string text, int length) {
-      if (text.Length <= length) return text;
-      return text.Substring(0, length - 3) + "...";
-    }
+    #endregion
   }
 }
Index: /misc/tools/HeuristicLab.HiveDrain/HiveTools.sln
===================================================================
--- /misc/tools/HeuristicLab.HiveDrain/HiveTools.sln	(revision 16666)
+++ /misc/tools/HeuristicLab.HiveDrain/HiveTools.sln	(revision 16667)
@@ -7,4 +7,8 @@
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HiveStatus", "HiveStatus\HiveStatus.csproj", "{E5FAA64A-CDE0-4932-8813-4F1AC041D8A4}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HiveIraceResult", "HiveIraceResult\HiveIraceResult.csproj", "{1BE7096D-95E1-4428-8BB2-341C749DDCFC}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HiveIraceSubmit", "HiveIraceSubmit\HiveIraceSubmit.csproj", "{5D3045E7-DE43-4835-8780-04595F3DF0D8}"
 EndProject
 Global
@@ -22,4 +26,12 @@
 		{E5FAA64A-CDE0-4932-8813-4F1AC041D8A4}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{E5FAA64A-CDE0-4932-8813-4F1AC041D8A4}.Release|Any CPU.Build.0 = Release|Any CPU
+		{1BE7096D-95E1-4428-8BB2-341C749DDCFC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{1BE7096D-95E1-4428-8BB2-341C749DDCFC}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{1BE7096D-95E1-4428-8BB2-341C749DDCFC}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{1BE7096D-95E1-4428-8BB2-341C749DDCFC}.Release|Any CPU.Build.0 = Release|Any CPU
+		{5D3045E7-DE43-4835-8780-04595F3DF0D8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{5D3045E7-DE43-4835-8780-04595F3DF0D8}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{5D3045E7-DE43-4835-8780-04595F3DF0D8}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{5D3045E7-DE43-4835-8780-04595F3DF0D8}.Release|Any CPU.Build.0 = Release|Any CPU
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
