Index: DamEngine/trunk/src/Deltares.DamEngine.IntegrationTests/IntegrationTests/MultiCoreMacroStabilityTests.cs =================================================================== diff -u -r5759 -r5766 --- DamEngine/trunk/src/Deltares.DamEngine.IntegrationTests/IntegrationTests/MultiCoreMacroStabilityTests.cs (.../MultiCoreMacroStabilityTests.cs) (revision 5759) +++ DamEngine/trunk/src/Deltares.DamEngine.IntegrationTests/IntegrationTests/MultiCoreMacroStabilityTests.cs (.../MultiCoreMacroStabilityTests.cs) (revision 5766) @@ -21,7 +21,6 @@ using System.IO; using Deltares.DamEngine.Data.General; -using Deltares.DamEngine.Interface; using Deltares.DamEngine.Io; using Deltares.DamEngine.Io.XmlOutput; using Deltares.DamEngine.TestHelpers; @@ -32,17 +31,59 @@ public static class MultiCoreMacroStabilityTests { private const string mapTestFiles = @"TestFiles\"; + private const string mapCompareMultiCore = @"CompareMultiCoreTo1CoreStability\"; private const string outputBase = "Output"; private const string calcBase = "Cores"; [TestFixture] - public class MultiCoreDesignBishopGridTests + public class RunMultiCoreStabilityTests { - private const string workDir = @"MultiCoreDesignBishopGridTests\"; + private const string mapMultiCore = @"MultiCoreStability\"; [OneTimeSetUp] public void Init() { + GeneralHelper.RemoveTestWorkingDirectory(mapMultiCore); + } + + [OneTimeTearDown] + public void Cleanup() + { + GeneralHelper.RemoveTestWorkingDirectory(mapMultiCore); + } + + [Test, Category(Categories.MultiCore)] + [Category(Categories.WorkInProgress)] // When running multicore without running single core first, sometimes it gives errors + [TestCase(4)] + [TestCase(8)] // 9 relevant combinations + public void MultiCoreDesignBishopWithScenariosForHeadPl3CalculatesCorrect(int maxCores) + { + const string workDir = mapMultiCore + @"DesignBishopWithScenariosPl3Tests\"; + const string inputFilename = "InputFileMultiCoreTestForScenario.xml"; + TestMultiCoreStability(maxCores, workDir, inputFilename, 18); + } + + [Test, Category(Categories.MultiCore)] + [Category(Categories.WorkInProgress)] // Error: The AnalyseType is set to AdaptGeometry in the input, however the geometry was not adapted in any location. Either set the AnalysisType to NoAdaptation or increase the required safety factor. + // When running multicore without running single core first, sometimes it gives errors + [TestCase(4)] + [TestCase(8)] // 9 relevant combinations + public void MultiCoreDesignBishopAdaptionWithOneScenarioForHeadPl3CalculatesCorrect(int maxCores) + { + const string workDir = mapMultiCore + @"AdaptBishopOneScenarioPl3Tests\"; + const string inputFilename = "InputFileMultiCoreTestForScenarioAdaption.xml"; + TestMultiCoreStability(maxCores, workDir, inputFilename, 7, true); + } + } + + [TestFixture] + public class CompareMultiCoreTo1CoreAdaptBishopGridTests + { + private const string workDir = mapCompareMultiCore + @"AdaptBishopGridTests\"; + + [OneTimeSetUp] + public void Init() + { GeneralHelper.RemoveTestWorkingDirectory(workDir); DebugDesignAdaptionWithXmlInputFile(1); } @@ -54,21 +95,21 @@ } [Test, Category(Categories.MultiCore)] - [Category(Categories.WorkInProgress)] //Error: The AnalyseType is set to AdaptGeometry in the input, however the geometry was not adapted in any location. Either set the AnalysisType to NoAdaptation or increase the required safety factor. + [Category(Categories.WorkInProgress)] // Error: The AnalyseType is set to AdaptGeometry in the input, however the geometry was not adapted in any location. Either set the AnalysisType to NoAdaptation or increase the required safety factor. [TestCase(2)] [TestCase(4)] [TestCase(8)] // 8 relevant combinations public void DebugDesignAdaptionWithXmlInputFile(int maxCores) { const string inputFilename = "DesignBishopGrid1Core.xml"; - TestMultiCoreStability(maxCores, workDir, inputFilename, 8); + TestCompareMultiCoreTo1CoreStability(maxCores, workDir, inputFilename, 8); } } [TestFixture] - public class MultiCoreDesignBishopWithScenariosPl3 + public class CompareMultiCoreTo1CoreDesignBishopWithScenariosPl3Tests { - private const string workDir = @"MultiCoreDesignBishopWithScenariosPl3\"; + private const string workDir = mapCompareMultiCore + @"DesignBishopWithScenariosPl3Tests\"; [OneTimeSetUp] public void Init() @@ -89,14 +130,14 @@ public void DesignBishopWithScenariosForHeadPl3CalculatesCorrect(int maxCores) { const string inputFilename = "InputFileMultiCoreTestForScenario.xml"; - TestMultiCoreStability(maxCores, workDir, inputFilename, 18); + TestCompareMultiCoreTo1CoreStability(maxCores, workDir, inputFilename, 18); } } [TestFixture] - public class MultiCoreDesignBishopOneScenarioPl3 + public class CompareMultiCoreTo1CoreDesignBishopOneScenarioPl3Tests { - private const string workDir = @"MultiCoreDesignBishopOneScenarioPl3\"; + private const string workDir = mapCompareMultiCore + @"BishopOneScenarioPl3Tests\"; [OneTimeSetUp] public void Init() @@ -117,14 +158,14 @@ public void DesignBishopWithOneScenariosForHeadPl3CalculatesCorrect(int maxCores) { const string inputFilename = "InputFileMultiCoreTestForScenario.xml"; - TestMultiCoreStability(maxCores, workDir, inputFilename, 9, true); + TestCompareMultiCoreTo1CoreStability(maxCores, workDir, inputFilename, 9, true); } } [TestFixture] - public class MultiCoreAdaptBishopWithScenariosPl3 + public class CompareMultiCoreTo1CoreAdaptBishopWithScenariosPl3Tests { - private const string workDir = @"MultiCoreAdaptBishopWithScenariosPl3\"; + private const string workDir = mapCompareMultiCore + @"AdaptBishopWithScenariosPl3Tests\"; [OneTimeSetUp] public void Init() @@ -140,20 +181,20 @@ } [Test, Category(Categories.MultiCore)] - [Category(Categories.WorkInProgress)] //Error: The AnalyseType is set to AdaptGeometry in the input, however the geometry was not adapted in any location. Either set the AnalysisType to NoAdaptation or increase the required safety factor. + [Category(Categories.WorkInProgress)] // Error: The AnalyseType is set to AdaptGeometry in the input, however the geometry was not adapted in any location. Either set the AnalysisType to NoAdaptation or increase the required safety factor. [TestCase(4)] [TestCase(8)] // 9 relevant combinations public void DesignBishopAdaptionWithScenariosForHeadPl3CalculatesCorrect(int maxCores) { const string inputFilename = "InputFileMultiCoreTestForScenarioAdaption.xml"; - TestMultiCoreStability(maxCores, workDir, inputFilename, 14); + TestCompareMultiCoreTo1CoreStability(maxCores, workDir, inputFilename, 14); } } [TestFixture] - public class MultiCoreAdaptBishopOneScenarioPl3 + public class CompareMultiCoreTo1CoreAdaptBishopOneScenarioPl3Tests { - private const string workDir = @"MultiCoreAdaptBishopOneScenarioPl3\"; + private const string workDir = mapCompareMultiCore + @"AdaptBishopOneScenarioPl3Tests\"; [OneTimeSetUp] public void Init() @@ -169,20 +210,20 @@ } [Test, Category(Categories.MultiCore)] - [Category(Categories.WorkInProgress)] //Error: The AnalyseType is set to AdaptGeometry in the input, however the geometry was not adapted in any location. Either set the AnalysisType to NoAdaptation or increase the required safety factor. + [Category(Categories.WorkInProgress)] // Error: The AnalyseType is set to AdaptGeometry in the input, however the geometry was not adapted in any location. Either set the AnalysisType to NoAdaptation or increase the required safety factor. [TestCase(4)] [TestCase(8)] // 9 relevant combinations public void DesignBishopAdaptionWithOneScenarioForHeadPl3CalculatesCorrect(int maxCores) { const string inputFilename = "InputFileMultiCoreTestForScenarioAdaption.xml"; - TestMultiCoreStability(maxCores, workDir, inputFilename, 7, true); + TestCompareMultiCoreTo1CoreStability(maxCores, workDir, inputFilename, 7, true); } } [TestFixture] - public class MultiCoreDesignLargeBishopTests + public class CompareMultiCoreTo1CoreDesignLargeBishopTests { - private const string workDir = @"MultiCoreDesignLargeBishopTests\"; + private const string workDir = mapCompareMultiCore + @"DesignLargeBishopTests\"; [OneTimeSetUp] public void Init() @@ -204,7 +245,7 @@ public void LargeInsideBishopNoAdaptionGridCalculatesCorrect(int maxCores) { const string inputFilename = "LargeInsideBishopNoAdaptionGrid.xml"; - TestMultiCoreStability(maxCores, workDir, inputFilename, 724, false, false); + TestCompareMultiCoreTo1CoreStability(maxCores, workDir, inputFilename, 724, false, false); } } @@ -213,6 +254,14 @@ { string calcDir = workDir + calcBase + maxCores; string outputFilename = Path.Combine(calcDir, outputBase + maxCores + ".xml"); + RunDesignMultiCoreWithXmlInputFile(maxCores, calcDir, inputFilename, outputFilename, justOneScenario, expectedNoErrors); + } + + private static void TestCompareMultiCoreTo1CoreStability(int maxCores, string workDir, string inputFilename, + int expectedResults, bool justOneScenario = false, bool expectedNoErrors = true) + { + string calcDir = workDir + calcBase + maxCores; + string outputFilename = Path.Combine(calcDir, outputBase + maxCores + ".xml"); if (maxCores > 1) { Output outputMultiCore = RunDesignMultiCoreWithXmlInputFile(maxCores, calcDir, inputFilename, outputFilename, Index: DamEngine/trunk/src/Deltares.DamEngine.IntegrationTests/IntegrationTests/OperationalMultiCoreTests.cs =================================================================== diff -u -r5756 -r5766 --- DamEngine/trunk/src/Deltares.DamEngine.IntegrationTests/IntegrationTests/OperationalMultiCoreTests.cs (.../OperationalMultiCoreTests.cs) (revision 5756) +++ DamEngine/trunk/src/Deltares.DamEngine.IntegrationTests/IntegrationTests/OperationalMultiCoreTests.cs (.../OperationalMultiCoreTests.cs) (revision 5766) @@ -21,7 +21,6 @@ using System.IO; using Deltares.DamEngine.Data.General; -using Deltares.DamEngine.Interface; using Deltares.DamEngine.Io; using Deltares.DamEngine.Io.XmlOutput; using Deltares.DamEngine.TestHelpers; @@ -34,20 +33,52 @@ /// public static class OperationalMultiCoreTests { + private const string mapCompareMultiCore = @"CompareMultiCoreTo1CoreOperational\"; private const string mapTestFiles = @"TestFiles\"; private const string outputBase = "Output"; private const string calcBase = "Cores"; [TestFixture] - public class MultiCoreOperationalBeeSwarmTests + public class RunMultiCoreOperationalTests { - private const string workDir = @"MultiCoreOperationalBeeSwarmTests\"; + private const string mapMultiCore = @"MultiCoreOperational\"; [OneTimeSetUp] public void Init() { + GeneralHelper.RemoveTestWorkingDirectory(mapMultiCore); + } + + [OneTimeTearDown] + public void Cleanup() + { + GeneralHelper.RemoveTestWorkingDirectory(mapMultiCore); + } + + [Test, Category(Categories.MultiCore)] + [Category(Categories.WorkInProgress)] // When running multicore without running single core first, sometimes it gives errors + [TestCase(2)] + [TestCase(4)] + [TestCase(8)] + [TestCase(16)] // 16 relevant combinations + public static void MultiCoreOperationalBishopGridWithXmlInputFile(int maxCores) + { + const string workDir = mapMultiCore + @"BishopGridTests\"; + const string inputFilename = "OperationalBishopGrid1Core.xml"; + TestMultiCoreOperational(maxCores, workDir, inputFilename, 8, 16, 16); + } + } + + [TestFixture] + public class CompareMultiCoreTo1CoreOperationalBeeSwarmTests + { + private const string workDir = mapCompareMultiCore + @"BeeSwarmTests\"; + + [OneTimeSetUp] + public void Init() + { GeneralHelper.RemoveTestWorkingDirectory(workDir); - MultiCoreOperationalBeeSwarmWithXmlInputFile(1); + OperationalBeeSwarmWithXmlInputFile(1); } [OneTimeTearDown] @@ -61,23 +92,23 @@ [TestCase(4)] [TestCase(8)] [TestCase(16)] // 16 relevant combinations - public void MultiCoreOperationalBeeSwarmWithXmlInputFile(int maxCores) + public void OperationalBeeSwarmWithXmlInputFile(int maxCores) { const string inputFilename = "InputForDebuggingBeeSwarm.xml"; - TestMultiCoreOperational(maxCores, workDir, inputFilename, 8, 16, 16); + TestCompareMultiCoreTo1CoreOperational(maxCores, workDir, inputFilename, 8, 16, 16); } } [TestFixture] - public class MultiCoreOperationalBishopGridTests + public class CompareMultiCoreTo1CoreOperationalBishopGridTests { - private const string workDir = @"MultiCoreOperationalBishopGridTests\"; + private const string workDir = mapCompareMultiCore + @"BishopGridTests\"; [OneTimeSetUp] public void Init() { GeneralHelper.RemoveTestWorkingDirectory(workDir); - MultiCoreOperationalBishopGridWithXmlInputFile(1); + OperationalBishopGridWithXmlInputFile(1); } [OneTimeTearDown] @@ -91,18 +122,26 @@ [TestCase(4)] [TestCase(8)] [TestCase(16)] // 16 relevant combinations - public void MultiCoreOperationalBishopGridWithXmlInputFile(int maxCores) + public void OperationalBishopGridWithXmlInputFile(int maxCores) { const string inputFilename = "OperationalBishopGrid1Core.xml"; - TestMultiCoreOperational(maxCores, workDir, inputFilename, 8, 16, 16); + TestCompareMultiCoreTo1CoreOperational(maxCores, workDir, inputFilename, 8, 16, 16); } } - private static void TestMultiCoreOperational(int maxCores, string workDir, string inputFilename, + private static void TestMultiCoreOperational(int maxCores, string workDir, string inputFilename, int expectedTimeSeries, int expectedResults, int expectedRealResults) { string calcDir = workDir + calcBase + maxCores; string outputFilename = Path.Combine(calcDir, outputBase + maxCores + ".xml"); + RunOperationalMultiCoreWithXmlInputFile(maxCores, calcDir, inputFilename, outputFilename); + } + + private static void TestCompareMultiCoreTo1CoreOperational(int maxCores, string workDir, string inputFilename, + int expectedTimeSeries, int expectedResults, int expectedRealResults) + { + string calcDir = workDir + calcBase + maxCores; + string outputFilename = Path.Combine(calcDir, outputBase + maxCores + ".xml"); if (maxCores > 1) { Output outputMultiCore = RunOperationalMultiCoreWithXmlInputFile(maxCores, calcDir, inputFilename, outputFilename);