diff --git a/src/wrench/simulation/Simulation.cpp b/src/wrench/simulation/Simulation.cpp index 812923bff3..e8cf78ea34 100644 --- a/src/wrench/simulation/Simulation.cpp +++ b/src/wrench/simulation/Simulation.cpp @@ -531,6 +531,7 @@ namespace wrench { } } + /** * @brief Get the current simulated date * @return a date diff --git a/test/compute_services/BareMetalComputeService/BareMetalComputeServiceTestStandardJobs.cpp b/test/compute_services/BareMetalComputeService/BareMetalComputeServiceTestStandardJobs.cpp index bb9b16a6e3..1293507dd7 100644 --- a/test/compute_services/BareMetalComputeService/BareMetalComputeServiceTestStandardJobs.cpp +++ b/test/compute_services/BareMetalComputeService/BareMetalComputeServiceTestStandardJobs.cpp @@ -210,7 +210,7 @@ class MulticoreComputeServiceUnsupportedJobTypeTestWMS : public wrench::WMS { }; TEST_F(BareMetalComputeServiceTestStandardJobs, UnsupportedStandardJobs) { - DO_TEST_WITH_FORK(do_UnsupportedStandardJobs_test); +DO_TEST_WITH_FORK(do_UnsupportedStandardJobs_test); } void BareMetalComputeServiceTestStandardJobs::do_UnsupportedStandardJobs_test() { @@ -318,7 +318,7 @@ class MulticoreComputeServiceBogusNumCoresTestWMS : public wrench::WMS { }; TEST_F(BareMetalComputeServiceTestStandardJobs, BogusNumCores) { - DO_TEST_WITH_FORK(do_BogusNumCores_test); +DO_TEST_WITH_FORK(do_BogusNumCores_test); } void BareMetalComputeServiceTestStandardJobs::do_BogusNumCores_test() { @@ -443,7 +443,7 @@ class MulticoreComputeServiceTwoSingleCoreTasksTestWMS : public wrench::WMS { }; TEST_F(BareMetalComputeServiceTestStandardJobs, TwoSingleCoreTasks) { - DO_TEST_WITH_FORK(do_TwoSingleCoreTasks_test); +DO_TEST_WITH_FORK(do_TwoSingleCoreTasks_test); } void BareMetalComputeServiceTestStandardJobs::do_TwoSingleCoreTasks_test() { @@ -569,7 +569,7 @@ class MulticoreComputeServiceTwoDualCoreTasksCase1TestWMS : public wrench::WMS { TEST_F(BareMetalComputeServiceTestStandardJobs, TwoDualCoreTasksCase1) { - DO_TEST_WITH_FORK(do_TwoDualCoreTasksCase1_test); +DO_TEST_WITH_FORK(do_TwoDualCoreTasksCase1_test); } void BareMetalComputeServiceTestStandardJobs::do_TwoDualCoreTasksCase1_test() { @@ -654,7 +654,7 @@ class MulticoreComputeServiceTwoDualCoreTasksCase2TestWMS : public wrench::WMS { wrench::StandardJob *two_task_job = job_manager->createStandardJob({this->test->task5, this->test->task6}, {}, {std::make_tuple(this->test->input_file, wrench::FileLocation::LOCATION(this->test->storage_service), - wrench::FileLocation::LOCATION(this->test->compute_service->getScratch())}, + wrench::FileLocation::LOCATION(this->test->compute_service->getScratch()))}, {}, {}); // Submit the 2-task job for execution @@ -707,7 +707,7 @@ class MulticoreComputeServiceTwoDualCoreTasksCase2TestWMS : public wrench::WMS { TEST_F(BareMetalComputeServiceTestStandardJobs, TwoDualCoreTasksCase2) { - DO_TEST_WITH_FORK(do_TwoDualCoreTasksCase2_test); +DO_TEST_WITH_FORK(do_TwoDualCoreTasksCase2_test); } void BareMetalComputeServiceTestStandardJobs::do_TwoDualCoreTasksCase2_test() { @@ -728,13 +728,14 @@ void BareMetalComputeServiceTestStandardJobs::do_TwoDualCoreTasksCase2_test() { // Create A Storage Services ASSERT_NO_THROW(storage_service = simulation->add( - new wrench::SimpleStorageService(hostname, 100.0))); + new wrench::SimpleStorageService(hostname, {"/"}))); // Create a Compute Service ASSERT_NO_THROW(compute_service = simulation->add( new wrench::BareMetalComputeService(hostname, - {std::make_pair("QuadCoreHost", std::make_tuple(wrench::ComputeService::ALL_CORES, wrench::ComputeService::ALL_RAM))}, - 100.0, {}))); + {std::make_pair("QuadCoreHost", + std::make_tuple(wrench::ComputeService::ALL_CORES, wrench::ComputeService::ALL_RAM))}, + {"/scratch"}, {}))); // Create a WMS std::shared_ptr wms = nullptr; @@ -749,7 +750,7 @@ void BareMetalComputeServiceTestStandardJobs::do_TwoDualCoreTasksCase2_test() { // Staging the input file on the storage service - ASSERT_NO_THROW(simulation->stageFile(input_file, storage_service)); + ASSERT_NO_THROW(simulation->stageFile(input_file, wrench::FileLocation::LOCATION(storage_service))); // Running a "run a single task" simulation ASSERT_NO_THROW(simulation->launch()); @@ -793,7 +794,10 @@ class BareMetalComputeServiceTwoDualCoreTasksCase3TestWMS : public wrench::WMS { // Create a 2-task job auto two_task_job_1 = job_manager->createStandardJob({this->test->task5, this->test->task6}, {}, - {std::make_tuple(this->test->input_file, this->test->storage_service, wrench::ComputeService::SCRATCH)}, + {std::make_tuple( + this->test->input_file, + wrench::FileLocation::LOCATION(this->test->storage_service), + wrench::FileLocation::LOCATION(this->test->compute_service->getScratch()))}, {}, {}); // Submit the 2-task job for execution (WRONG CS-specific arguments) @@ -882,7 +886,9 @@ class BareMetalComputeServiceTwoDualCoreTasksCase3TestWMS : public wrench::WMS { // service-specific args format testing: "hostname", "" <- that's an empty string // both tasks should run in parallel, use 4 cores each, thus oversubscribing wrench::StandardJob *two_task_job_2 = job_manager->createStandardJob({this->test->task7, this->test->task8}, {}, - {std::make_tuple(this->test->input_file, this->test->storage_service, wrench::ComputeService::SCRATCH)}, + {std::make_tuple(this->test->input_file, + wrench::FileLocation::LOCATION(this->test->storage_service), + wrench::FileLocation::LOCATION(this->test->compute_service->getScratch()))}, {}, {}); job_manager->submitJob(two_task_job_2, this->test->compute_service, @@ -924,7 +930,7 @@ class BareMetalComputeServiceTwoDualCoreTasksCase3TestWMS : public wrench::WMS { TEST_F(BareMetalComputeServiceTestStandardJobs, TwoDualCoreTasksCase3) { - DO_TEST_WITH_FORK(do_TwoDualCoreTasksCase3_test); +DO_TEST_WITH_FORK(do_TwoDualCoreTasksCase3_test); } void BareMetalComputeServiceTestStandardJobs::do_TwoDualCoreTasksCase3_test() { @@ -945,13 +951,13 @@ void BareMetalComputeServiceTestStandardJobs::do_TwoDualCoreTasksCase3_test() { // Create A Storage Services ASSERT_NO_THROW(storage_service = simulation->add( - new wrench::SimpleStorageService(hostname, 100.0))); + new wrench::SimpleStorageService(hostname, {"/"}))); // Create a Compute Service ASSERT_NO_THROW(compute_service = simulation->add( new wrench::BareMetalComputeService(hostname, {std::make_pair("QuadCoreHost", std::make_tuple(wrench::ComputeService::ALL_CORES, wrench::ComputeService::ALL_RAM))}, - 100.0, {}))); + "/scratch", {}))); // Create a WMS std::shared_ptr wms = nullptr; @@ -966,7 +972,7 @@ void BareMetalComputeServiceTestStandardJobs::do_TwoDualCoreTasksCase3_test() { // Staging the input file on the storage service - ASSERT_NO_THROW(simulation->stageFile(input_file, storage_service)); + ASSERT_NO_THROW(simulation->stageFile(input_file, wrench::FileLocation::LOCATION(storage_service))); // Running a "run a single task" simulation ASSERT_NO_THROW(simulation->launch()); @@ -1008,7 +1014,7 @@ class BareMetalComputeServiceJobTerminationTestWMS : public wrench::WMS { // Create a 2-task job wrench::StandardJob *two_task_job = job_manager->createStandardJob({this->test->task1, this->test->task2}, {}, - {std::make_tuple(this->test->input_file, this->test->storage_service, wrench::ComputeService::SCRATCH)}, + {std::make_tuple(this->test->input_file, wrench::FileLocation::LOCATION(this->storage_service), wrench::ComputeService::SCRATCH)}, {}, {}); // Submit the 2-task job for execution @@ -1039,7 +1045,7 @@ class BareMetalComputeServiceJobTerminationTestWMS : public wrench::WMS { }; TEST_F(BareMetalComputeServiceTestStandardJobs, JobTermination) { - DO_TEST_WITH_FORK(do_JobTermination_test); +DO_TEST_WITH_FORK(do_JobTermination_test); } void BareMetalComputeServiceTestStandardJobs::do_JobTermination_test() { @@ -1060,13 +1066,13 @@ void BareMetalComputeServiceTestStandardJobs::do_JobTermination_test() { // Create A Storage Services ASSERT_NO_THROW(storage_service = simulation->add( - new wrench::SimpleStorageService(hostname, 100.0))); + new wrench::SimpleStorageService(hostname, {"/"}))); // Create a Compute Service ASSERT_NO_THROW(compute_service = simulation->add( new wrench::BareMetalComputeService(hostname, {std::make_pair(hostname, std::make_tuple(wrench::ComputeService::ALL_CORES, wrench::ComputeService::ALL_RAM))}, - 100.0, {}))); + "/scratch", {}))); // Create a WMS std::shared_ptr wms = nullptr; @@ -1081,7 +1087,7 @@ void BareMetalComputeServiceTestStandardJobs::do_JobTermination_test() { // Staging the input file on the storage service - ASSERT_NO_THROW(simulation->stageFile(input_file, storage_service)); + ASSERT_NO_THROW(simulation->stageFile(input_file, wrench::FileLocation::LOCATION(storage_service))); // Running a "run a single task" simulation ASSERT_NO_THROW(simulation->launch()); @@ -1155,7 +1161,7 @@ class BareMetalComputeServiceNonSubmittedJobTerminationTestWMS : public wrench:: }; TEST_F(BareMetalComputeServiceTestStandardJobs, NonSubmittedJobTermination) { - DO_TEST_WITH_FORK(do_NonSubmittedJobTermination_test); +DO_TEST_WITH_FORK(do_NonSubmittedJobTermination_test); } void BareMetalComputeServiceTestStandardJobs::do_NonSubmittedJobTermination_test() { @@ -1176,13 +1182,13 @@ void BareMetalComputeServiceTestStandardJobs::do_NonSubmittedJobTermination_test // Create A Storage Services ASSERT_NO_THROW(storage_service = simulation->add( - new wrench::SimpleStorageService(hostname, 100.0))); + new wrench::SimpleStorageService(hostname, {"/"}))); // Create a Compute Service ASSERT_NO_THROW(compute_service = simulation->add( new wrench::BareMetalComputeService(hostname, {std::make_pair(hostname, std::make_tuple(wrench::ComputeService::ALL_CORES, wrench::ComputeService::ALL_RAM))}, - 0, {}))); + "", {}))); // Create a WMS std::shared_ptr wms = nullptr; @@ -1197,7 +1203,7 @@ void BareMetalComputeServiceTestStandardJobs::do_NonSubmittedJobTermination_test // Staging the input file on the storage service - ASSERT_NO_THROW(simulation->stageFile(input_file, storage_service)); + ASSERT_NO_THROW(simulation->stageFile(input_file, wrench::FileLocation::LOCATION(storage_service))); // Running a "run a single task" simulation ASSERT_NO_THROW(simulation->launch()); @@ -1246,7 +1252,7 @@ class BareMetalComputeServiceCompletedJobTerminationTestWMS : public wrench::WMS // Create a 2-task job wrench::StandardJob *two_task_job = job_manager->createStandardJob({this->test->task1, this->test->task2}, {}, - {std::make_tuple(this->test->input_file, this->test->storage_service, wrench::ComputeService::SCRATCH)}, + {std::make_tuple(this->test->input_file, wrench::FileLocation::LOCATION(this->storage_service), wrench::ComputeService::SCRATCH)}, {}, {}); // Submit the 2-task job for execution @@ -1275,7 +1281,7 @@ class BareMetalComputeServiceCompletedJobTerminationTestWMS : public wrench::WMS }; TEST_F(BareMetalComputeServiceTestStandardJobs, CompletedJobTermination) { - DO_TEST_WITH_FORK(do_CompletedJobTermination_test); +DO_TEST_WITH_FORK(do_CompletedJobTermination_test); } void BareMetalComputeServiceTestStandardJobs::do_CompletedJobTermination_test() { @@ -1296,13 +1302,13 @@ void BareMetalComputeServiceTestStandardJobs::do_CompletedJobTermination_test() // Create A Storage Services ASSERT_NO_THROW(storage_service = simulation->add( - new wrench::SimpleStorageService(hostname, 100.0))); + new wrench::SimpleStorageService(hostname, {"/"}))); // Create a Compute Service ASSERT_NO_THROW(compute_service = simulation->add( new wrench::BareMetalComputeService(hostname, {std::make_pair(hostname, std::make_tuple(wrench::ComputeService::ALL_CORES, wrench::ComputeService::ALL_RAM))}, - 100.0, {}))); + "/scratch", {}))); // Create a WMS std::shared_ptr wms = nullptr;; @@ -1317,7 +1323,7 @@ void BareMetalComputeServiceTestStandardJobs::do_CompletedJobTermination_test() // Staging the input file on the storage service - ASSERT_NO_THROW(simulation->stageFile(input_file, storage_service)); + ASSERT_NO_THROW(simulation->stageFile(input_file, wrench::FileLocation::LOCATION(storage_service))); // Running a "run a single task" simulation ASSERT_NO_THROW(simulation->launch()); @@ -1367,7 +1373,9 @@ class BareMetalComputeServiceShutdownComputeServiceWhileJobIsRunningTestWMS : pu // Create a 2-task job wrench::StandardJob *two_task_job = job_manager->createStandardJob({this->test->task1, this->test->task2}, {}, - {std::make_tuple(this->test->input_file, this->test->storage_service, wrench::ComputeService::SCRATCH)}, + {std::make_tuple(this->test->input_file, + wrench::FileLocation::LOCATION(this->test->storage_service), + wrench::FileLocation::LOCATION(this->test->compute_service->getScratch()))}, {}, {}); // Submit the 2-task job for execution @@ -1408,7 +1416,7 @@ class BareMetalComputeServiceShutdownComputeServiceWhileJobIsRunningTestWMS : pu }; TEST_F(BareMetalComputeServiceTestStandardJobs, ShutdownComputeServiceWhileJobIsRunning) { - DO_TEST_WITH_FORK(do_ShutdownComputeServiceWhileJobIsRunning_test); +DO_TEST_WITH_FORK(do_ShutdownComputeServiceWhileJobIsRunning_test); } void BareMetalComputeServiceTestStandardJobs::do_ShutdownComputeServiceWhileJobIsRunning_test() { @@ -1429,13 +1437,13 @@ void BareMetalComputeServiceTestStandardJobs::do_ShutdownComputeServiceWhileJobI // Create A Storage Services ASSERT_NO_THROW(storage_service = simulation->add( - new wrench::SimpleStorageService(hostname, 100.0))); + new wrench::SimpleStorageService(hostname, {"/"}))); // Create a Compute Service ASSERT_NO_THROW(compute_service = simulation->add( new wrench::BareMetalComputeService(hostname, {std::make_pair(hostname, std::make_tuple(wrench::ComputeService::ALL_CORES, wrench::ComputeService::ALL_RAM))}, - 100.0, {}))); + "/scratch", {}))); // Create a WMS std::shared_ptr wms = nullptr;; @@ -1450,7 +1458,7 @@ void BareMetalComputeServiceTestStandardJobs::do_ShutdownComputeServiceWhileJobI // Staging the input file on the storage service - ASSERT_NO_THROW(simulation->stageFile(input_file, storage_service)); + ASSERT_NO_THROW(simulation->stageFile(input_file, wrench::FileLocation::LOCATION(storage_service))); // Running a "run a single task" simulation ASSERT_NO_THROW(simulation->launch()); @@ -1535,7 +1543,7 @@ class BareMetalComputeServiceShutdownStorageServiceBeforeJobIsSubmittedTestWMS : }; TEST_F(BareMetalComputeServiceTestStandardJobs, ShutdownStorageServiceBeforeJobIsSubmitted) { - DO_TEST_WITH_FORK(do_ShutdownStorageServiceBeforeJobIsSubmitted_test); +DO_TEST_WITH_FORK(do_ShutdownStorageServiceBeforeJobIsSubmitted_test); } void BareMetalComputeServiceTestStandardJobs::do_ShutdownStorageServiceBeforeJobIsSubmitted_test() { diff --git a/test/compute_services/StandardJobExecutorTest.cpp b/test/compute_services/StandardJobExecutorTest.cpp index a804017730..c02140ac91 100644 --- a/test/compute_services/StandardJobExecutorTest.cpp +++ b/test/compute_services/StandardJobExecutorTest.cpp @@ -76,10 +76,45 @@ class StandardJobExecutorTest : public ::testing::Test { "" " " " " - " " - " " - " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " " " + " " + " " + " " + " " + " " + " " + " " + " " " " " " " " @@ -464,11 +499,11 @@ void StandardJobExecutorTest::do_StandardJobExecutorConstructorTest_test() { // Create a Storage Service ASSERT_NO_THROW(storage_service1 = simulation->add( - new wrench::SimpleStorageService(hostname, 10000000000000.0))); + new wrench::SimpleStorageService(hostname, {"/"}))); // Create another Storage Service ASSERT_NO_THROW(storage_service2 = simulation->add( - new wrench::SimpleStorageService(hostname, 10000000000000.0))); + new wrench::SimpleStorageService(hostname, {"/"}))); // Create a WMS std::shared_ptr wms = nullptr; @@ -485,7 +520,7 @@ void StandardJobExecutorTest::do_StandardJobExecutorConstructorTest_test() { wrench::WorkflowFile *output_file = this->workflow->addFile("output_file", 20000.0); // Staging the input_file on the storage service - ASSERT_NO_THROW(simulation->stageFile(input_file, storage_service1)); + ASSERT_NO_THROW(simulation->stageFile(input_file, wrench::FileLocation::LOCATION(storage_service1))); // Running a "run a single task" simulation @@ -656,11 +691,11 @@ void StandardJobExecutorTest::do_OneSingleCoreTaskTest_test() { // Create a Storage Service ASSERT_NO_THROW(storage_service1 = simulation->add( - new wrench::SimpleStorageService(hostname, 10000000000000.0))); + new wrench::SimpleStorageService(hostname, {"/"}))); // Create another Storage Service ASSERT_NO_THROW(storage_service2 = simulation->add( - new wrench::SimpleStorageService(hostname, 10000000000000.0))); + new wrench::SimpleStorageService(hostname, {"/"}))); // Create a WMS std::shared_ptr wms = nullptr;; @@ -677,7 +712,7 @@ void StandardJobExecutorTest::do_OneSingleCoreTaskTest_test() { wrench::WorkflowFile *output_file = this->workflow->addFile("output_file", 20000.0); // Staging the input_file on the storage service - ASSERT_NO_THROW(simulation->stageFile(input_file, storage_service1)); + ASSERT_NO_THROW(simulation->stageFile(input_file, wrench::FileLocation::LOCATION(storage_service1))); // Running a "run a single task" simulation @@ -792,7 +827,7 @@ class OneSingleCoreTaskBogusPreFileCopyTestWMS : public wrench::WMS { throw std::runtime_error( "Got the expected 'file not found' exception, but the failure cause does not point to the correct file"); } - if (cause->getStorageService() != this->test->storage_service2) { + if (cause->getLocation()->getStorageService() != this->test->storage_service2) { throw std::runtime_error( "Got the expected 'file not found' exception, but the failure cause does not point to the correct storage service"); } @@ -835,11 +870,11 @@ void StandardJobExecutorTest::do_OneSingleCoreTaskBogusPreFileCopyTest_test() { // Create a Storage Service ASSERT_NO_THROW(storage_service1 = simulation->add( - new wrench::SimpleStorageService(hostname, 10000000000000.0))); + new wrench::SimpleStorageService(hostname, {"/"}))); // Create another Storage Service ASSERT_NO_THROW(storage_service2 = simulation->add( - new wrench::SimpleStorageService(hostname, 10000000000000.0))); + new wrench::SimpleStorageService(hostname, {"/"}))); // Create a WMS std::shared_ptr wms = nullptr;; @@ -1017,11 +1052,11 @@ void StandardJobExecutorTest::do_OneSingleCoreTaskMissingFileTest_test() { {}))); // Create a Storage Service ASSERT_NO_THROW(storage_service1 = simulation->add( - new wrench::SimpleStorageService(hostname, 10000000000000.0))); + new wrench::SimpleStorageService(hostname, {"/"}))); // Create another Storage Service ASSERT_NO_THROW(storage_service2 = simulation->add( - new wrench::SimpleStorageService(hostname, 10000000000000.0))); + new wrench::SimpleStorageService(hostname, {"/"}))); // Create a WMS std::shared_ptr wms = nullptr;; @@ -1219,7 +1254,7 @@ void StandardJobExecutorTest::do_DependentTasksTest_test() { // Create a Storage Service ASSERT_NO_THROW(storage_service1 = simulation->add( - new wrench::SimpleStorageService(hostname, 10000000000000.0))); + new wrench::SimpleStorageService(hostname, {"/"}))); // Create a Compute Service std::shared_ptr compute_service; @@ -1364,7 +1399,7 @@ void StandardJobExecutorTest::do_OneMultiCoreTaskTestCase1_test() { {}))); // Create a Storage Service ASSERT_NO_THROW(storage_service1 = simulation->add( - new wrench::SimpleStorageService(hostname, 10000000000000.0))); + new wrench::SimpleStorageService(hostname, {"/"}))); // Create a WMS std::shared_ptr wms = nullptr;; @@ -1519,7 +1554,7 @@ void StandardJobExecutorTest::do_OneMultiCoreTaskTestCase2_test() { {}))); // Create a Storage Service ASSERT_NO_THROW(storage_service1 = simulation->add( - new wrench::SimpleStorageService(hostname, 10000000000000.0))); + new wrench::SimpleStorageService(hostname, {"/"}))); // Create a WMS std::shared_ptr wms = nullptr;; @@ -1675,7 +1710,7 @@ void StandardJobExecutorTest::do_OneMultiCoreTaskTestCase3_test() { {}))); // Create a Storage Service ASSERT_NO_THROW(storage_service1 = simulation->add( - new wrench::SimpleStorageService(hostname, 10000000000000.0))); + new wrench::SimpleStorageService(hostname, {"/"}))); // Create a WMS std::shared_ptr wms = nullptr;; @@ -2033,11 +2068,11 @@ void StandardJobExecutorTest::do_TwoMultiCoreTasksTest_test() { {}))); // Create a Storage Services ASSERT_NO_THROW(storage_service1 = simulation->add( - new wrench::SimpleStorageService(hostname, 10000000000000.0))); + new wrench::SimpleStorageService(hostname, {"/"}))); // Create another Storage Services ASSERT_NO_THROW(storage_service2 = simulation->add( - new wrench::SimpleStorageService(hostname, 10000000000000.0))); + new wrench::SimpleStorageService(hostname, {"/"}))); // Create a WMS std::shared_ptr wms = nullptr;; @@ -2310,11 +2345,11 @@ void StandardJobExecutorTest::do_MultiHostTest_test() { {}))); // Create a Storage Services ASSERT_NO_THROW(storage_service1 = simulation->add( - new wrench::SimpleStorageService(hostname, 10000000000000.0))); + new wrench::SimpleStorageService(hostname, {"/"}))); // Create another Storage Services ASSERT_NO_THROW(storage_service2 = simulation->add( - new wrench::SimpleStorageService(hostname, 10000000000000.0))); + new wrench::SimpleStorageService(hostname, {"/"}))); // Create a WMS std::shared_ptr wms = nullptr;; @@ -2466,11 +2501,11 @@ void StandardJobExecutorTest::do_JobTerminationTestDuringAComputation_test() { {}))); // Create a Storage Services ASSERT_NO_THROW(storage_service1 = simulation->add( - new wrench::SimpleStorageService("Host4", 10000000000000.0))); + new wrench::SimpleStorageService("Host4", {"/"}))); // Create another Storage Services ASSERT_NO_THROW(storage_service2 = simulation->add( - new wrench::SimpleStorageService("Host4", 10000000000000.0))); + new wrench::SimpleStorageService("Host4", {"/"}))); // Create a WMS std::shared_ptr wms = nullptr;; @@ -2620,11 +2655,11 @@ void StandardJobExecutorTest::do_JobTerminationTestDuringATransfer_test() { {}))); // Create a Storage Services ASSERT_NO_THROW(storage_service1 = simulation->add( - new wrench::SimpleStorageService("Host4", 10000000000000.0))); + new wrench::SimpleStorageService("Host4", {"/"}))); // Create another Storage Services ASSERT_NO_THROW(storage_service2 = simulation->add( - new wrench::SimpleStorageService("Host4", 10000000000000.0))); + new wrench::SimpleStorageService("Host4", {"/"}))); // Create a WMS std::shared_ptr wms = nullptr;; @@ -2796,11 +2831,11 @@ void StandardJobExecutorTest::do_JobTerminationTestAtRandomTimes_test() { {}))); // Create a Storage Services ASSERT_NO_THROW(storage_service1 = simulation->add( - new wrench::SimpleStorageService("Host4", 10000000000000.0))); + new wrench::SimpleStorageService("Host4", {"/"}))); // Create another Storage Services ASSERT_NO_THROW(storage_service2 = simulation->add( - new wrench::SimpleStorageService("Host4", 10000000000000.0))); + new wrench::SimpleStorageService("Host4", {"/"}))); // Create a WMS std::shared_ptr wms = nullptr;; @@ -2992,11 +3027,11 @@ void StandardJobExecutorTest::do_NoTaskTest_test() { {}))); // Create a Storage Services ASSERT_NO_THROW(storage_service1 = simulation->add( - new wrench::SimpleStorageService(hostname, 10000000000000.0))); + new wrench::SimpleStorageService(hostname, {"/"}))); // Create another Storage Services ASSERT_NO_THROW(storage_service2 = simulation->add( - new wrench::SimpleStorageService(hostname, 10000000000000.0))); + new wrench::SimpleStorageService(hostname, {"/"}))); // Create a WMS std::shared_ptr wms = nullptr;; diff --git a/test/compute_services/VirtualizedClusterService/VirtualizedClusterServiceTest.cpp b/test/compute_services/VirtualizedClusterService/VirtualizedClusterServiceTest.cpp index 8cc0a22aff..1857fd4b1f 100644 --- a/test/compute_services/VirtualizedClusterService/VirtualizedClusterServiceTest.cpp +++ b/test/compute_services/VirtualizedClusterService/VirtualizedClusterServiceTest.cpp @@ -107,9 +107,36 @@ class VirtualizedClusterServiceTest : public ::testing::Test { "" " " " " - " " - " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " " " + " " + " " + " " + " " + " " + " " + " " + " " + " " " " " " " " @@ -155,22 +182,22 @@ void VirtualizedClusterServiceTest::do_ConstructorTest_test() { // Create a Cloud Service (WRONG PROPERTIES) ASSERT_THROW(compute_service = simulation->add( - new wrench::CloudComputeService(hostname, execution_hosts, 100, + new wrench::CloudComputeService(hostname, execution_hosts, {"/"}, {{wrench::CloudComputeServiceProperty::SUPPORTS_PILOT_JOBS, "true"}})), - std::invalid_argument); + std::invalid_argument); ASSERT_THROW(compute_service = simulation->add( - new wrench::CloudComputeService(hostname, execution_hosts, 100, + new wrench::CloudComputeService(hostname, execution_hosts, {"/"}, {{wrench::CloudComputeServiceProperty::SUPPORTS_STANDARD_JOBS, "true"}})), std::invalid_argument); ASSERT_THROW(compute_service = simulation->add( - new wrench::CloudComputeService(hostname, execution_hosts, 100, + new wrench::CloudComputeService(hostname, execution_hosts, {"/"}, {{wrench::CloudComputeServiceProperty::VM_BOOT_OVERHEAD_IN_SECONDS, "-1.0"}})), std::invalid_argument); ASSERT_THROW(compute_service = simulation->add( - new wrench::CloudComputeService(hostname, execution_hosts, 100, + new wrench::CloudComputeService(hostname, execution_hosts, {"/"}, {{wrench::CloudComputeServiceProperty::VM_RESOURCE_ALLOCATION_ALGORITHM, "bogus"}})), std::invalid_argument); @@ -259,8 +286,8 @@ class CloudStandardJobTestWMS : public wrench::WMS { // Create a 2-task job auto two_task_job = job_manager->createStandardJob({this->test->task1, this->test->task2}, {}, {std::make_tuple(this->test->input_file, - this->test->storage_service, - wrench::ComputeService::SCRATCH)}, + wrench::FileLocation::LOCATION(this->test->storage_service), + wrench::FileLocation::LOCATION(cs->getScratch()))}, {}, {}); // Try to submit the job directly to the CloudComputeService (which fails) @@ -387,12 +414,12 @@ void VirtualizedClusterServiceTest::do_StandardJobTaskTest_test() { // Create a Storage Service ASSERT_NO_THROW(storage_service = simulation->add( - new wrench::SimpleStorageService(hostname, 100.0))); + new wrench::SimpleStorageService(hostname, {"/"}))); // Create a Cloud Service std::vector execution_hosts = {simulation->getHostnameList()[1]}; ASSERT_NO_THROW(compute_service = simulation->add( - new wrench::CloudComputeService(hostname, execution_hosts, 100, + new wrench::CloudComputeService(hostname, execution_hosts, "/scratch", {{wrench::BareMetalComputeServiceProperty::SUPPORTS_PILOT_JOBS, "false"}}))); // Create a WMS @@ -406,7 +433,7 @@ void VirtualizedClusterServiceTest::do_StandardJobTaskTest_test() { ASSERT_NO_THROW(simulation->add(new wrench::FileRegistryService(hostname))); // Staging the input_file on the storage service - ASSERT_NO_THROW(simulation->stageFile(input_file, storage_service)); + ASSERT_NO_THROW(simulation->stageFile(input_file, wrench::FileLocation::LOCATION(storage_service))); // Running a "run a single task" simulation ASSERT_NO_THROW(simulation->launch()); @@ -445,12 +472,6 @@ class CloudStandardJobWithCustomVMNameTestWMS : public wrench::WMS { // Create a job manager auto job_manager = this->createJobManager(); - // Create a 2-task job - wrench::StandardJob *two_task_job = job_manager->createStandardJob({this->test->task1, this->test->task2}, {}, - {std::make_tuple(this->test->input_file, - this->test->storage_service, - wrench::ComputeService::SCRATCH)}, - {}, {}); // Create and start a VM auto vm_name = cs->createVM(2, 10, "my_custom_name"); @@ -470,6 +491,13 @@ class CloudStandardJobWithCustomVMNameTestWMS : public wrench::WMS { // Start the VM auto vm_cs = cs->startVM(vm_name); + // Create a 2-task job + wrench::StandardJob *two_task_job = job_manager->createStandardJob({this->test->task1, this->test->task2}, {}, + {std::make_tuple(this->test->input_file, + wrench::FileLocation::LOCATION(this->test->storage_service), + wrench::FileLocation::LOCATION(vm_cs->getScratch()))}, + {}, {}); + // Submit the 2-task job for execution try { job_manager->submitJob(two_task_job, vm_cs); @@ -514,12 +542,12 @@ void VirtualizedClusterServiceTest::do_StandardJobTaskWithCustomVMNameTest_test( // Create a Storage Service ASSERT_NO_THROW(storage_service = simulation->add( - new wrench::SimpleStorageService(hostname, 100.0))); + new wrench::SimpleStorageService(hostname, {"/"}))); // Create a Cloud Service std::vector execution_hosts = {simulation->getHostnameList()[1]}; ASSERT_NO_THROW(compute_service = simulation->add( - new wrench::CloudComputeService(hostname, execution_hosts, 100, + new wrench::CloudComputeService(hostname, execution_hosts, "/scratch", {{wrench::BareMetalComputeServiceProperty::SUPPORTS_PILOT_JOBS, "false"}}))); // Create a WMS @@ -533,7 +561,7 @@ void VirtualizedClusterServiceTest::do_StandardJobTaskWithCustomVMNameTest_test( ASSERT_NO_THROW(simulation->add(new wrench::FileRegistryService(hostname))); // Staging the input_file on the storage service - ASSERT_NO_THROW(simulation->stageFile(input_file, storage_service)); + ASSERT_NO_THROW(simulation->stageFile(input_file, wrench::FileLocation::LOCATION(storage_service))); // Running a "run a single task" simulation ASSERT_NO_THROW(simulation->launch()); @@ -571,15 +599,18 @@ class VirtualizedClusterVMMigrationTestWMS : public wrench::WMS { // Create a job manager auto job_manager = this->createJobManager(); + auto cs = *(this->getAvailableComputeServices().begin()); + // Create a 2-task job wrench::StandardJob *two_task_job = job_manager->createStandardJob( {this->test->task1, this->test->task2}, {}, - {std::make_tuple(this->test->input_file, this->test->storage_service, wrench::ComputeService::SCRATCH)}, + {std::make_tuple(this->test->input_file, + wrench::FileLocation::LOCATION(this->test->storage_service), + wrench::FileLocation::LOCATION(cs->getScratch()))}, {}, {}); // Submit the 2-task job for execution try { - auto cs = *(this->getAvailableComputeServices().begin()); std::string src_host = "QuadCoreHost"; auto vm_name = cs->createVM(2, 10); @@ -662,20 +693,20 @@ void VirtualizedClusterServiceTest::do_VMMigrationTest_test() { // Create a Storage Service ASSERT_NO_THROW(storage_service = simulation->add( - new wrench::SimpleStorageService(hostname, 100.0))); + new wrench::SimpleStorageService(hostname, {"/"}))); // Create a Virtualized Cluster Service with no hosts std::vector nothing; ASSERT_THROW(compute_service = simulation->add( - new wrench::VirtualizedClusterComputeService(hostname, nothing, 100.0, + new wrench::VirtualizedClusterComputeService(hostname, nothing, "/scratch", {{wrench::BareMetalComputeServiceProperty::SUPPORTS_PILOT_JOBS, "false"}})), std::invalid_argument); // Create a Virtualized Cluster Service std::vector execution_hosts = simulation->getHostnameList(); ASSERT_NO_THROW(compute_service = simulation->add( - new wrench::VirtualizedClusterComputeService(hostname, execution_hosts, 100.0, + new wrench::VirtualizedClusterComputeService(hostname, execution_hosts, "/scratch", {{wrench::BareMetalComputeServiceProperty::SUPPORTS_PILOT_JOBS, "false"}}))); @@ -690,7 +721,7 @@ void VirtualizedClusterServiceTest::do_VMMigrationTest_test() { ASSERT_NO_THROW(simulation->add(new wrench::FileRegistryService(hostname))); // Staging the input_file on the storage service - ASSERT_NO_THROW(simulation->stageFile(input_file, storage_service)); + ASSERT_NO_THROW(simulation->stageFile(input_file, wrench::FileLocation::LOCATION(storage_service))); // Running a "run a single task" simulation ASSERT_NO_THROW(simulation->launch()); @@ -782,12 +813,12 @@ void VirtualizedClusterServiceTest::do_NumCoresTest_test() { // Create a Storage Service ASSERT_NO_THROW(storage_service = simulation->add( - new wrench::SimpleStorageService(hostname, 100.0))); + new wrench::SimpleStorageService(hostname, {"/"}))); // Create a Cloud Service std::vector execution_hosts = {"QuadCoreHost", "DualCoreHost"}; ASSERT_NO_THROW(compute_service = simulation->add( - new wrench::CloudComputeService(hostname, execution_hosts, 0, + new wrench::CloudComputeService(hostname, execution_hosts, "", {{wrench::BareMetalComputeServiceProperty::SUPPORTS_PILOT_JOBS, "false"}}))); // Create a WMS @@ -802,7 +833,7 @@ void VirtualizedClusterServiceTest::do_NumCoresTest_test() { new wrench::FileRegistryService(hostname))); // Staging the input_file on the storage service - ASSERT_NO_THROW(simulation->stageFile(input_file, storage_service)); + ASSERT_NO_THROW(simulation->stageFile(input_file, wrench::FileLocation::LOCATION(storage_service))); // Running a "run a single task" simulation ASSERT_NO_THROW(simulation->launch()); @@ -889,12 +920,12 @@ void VirtualizedClusterServiceTest::do_StopAllVMsTest_test() { // Create a Storage Service ASSERT_NO_THROW(storage_service = simulation->add( - new wrench::SimpleStorageService(hostname, 100.0))); + new wrench::SimpleStorageService(hostname, {"/"}))); // Create a Cloud Service std::vector execution_hosts = {simulation->getHostnameList()[1]}; ASSERT_NO_THROW(compute_service = simulation->add( - new wrench::VirtualizedClusterComputeService(hostname, execution_hosts, 0, + new wrench::VirtualizedClusterComputeService(hostname, execution_hosts, "", {{wrench::BareMetalComputeServiceProperty::SUPPORTS_STANDARD_JOBS, "false"}}))); // Create a WMS @@ -909,7 +940,7 @@ void VirtualizedClusterServiceTest::do_StopAllVMsTest_test() { new wrench::FileRegistryService(hostname))); // Staging the input_file on the storage service - ASSERT_NO_THROW(simulation->stageFile(input_file, storage_service)); + ASSERT_NO_THROW(simulation->stageFile(input_file, wrench::FileLocation::LOCATION(storage_service))); // Running a "run a single task" simulation ASSERT_NO_THROW(simulation->launch()); @@ -1139,16 +1170,16 @@ void VirtualizedClusterServiceTest::do_ShutdownVMTest_test() { // Create a Storage Service ASSERT_NO_THROW(storage_service = simulation->add( - new wrench::SimpleStorageService(hostname, 100.0))); + new wrench::SimpleStorageService(hostname, {"/"}))); // Create a Cloud Service std::vector execution_hosts = {simulation->getHostnameList()[1]}; ASSERT_THROW(compute_service = simulation->add( - new wrench::VirtualizedClusterComputeService(hostname, execution_hosts, 0, + new wrench::VirtualizedClusterComputeService(hostname, execution_hosts, "", {{wrench::VirtualizedClusterComputeServiceProperty::SUPPORTS_PILOT_JOBS, "true"}})), std::invalid_argument); ASSERT_NO_THROW(compute_service = simulation->add( - new wrench::VirtualizedClusterComputeService(hostname, execution_hosts, 0, + new wrench::VirtualizedClusterComputeService(hostname, execution_hosts, "", {{wrench::VirtualizedClusterComputeServiceProperty::SUPPORTS_PILOT_JOBS, "false"}}))); // Create a WMS @@ -1163,7 +1194,7 @@ void VirtualizedClusterServiceTest::do_ShutdownVMTest_test() { new wrench::FileRegistryService(hostname))); // Staging the input_file on the storage service - ASSERT_NO_THROW(simulation->stageFile(input_file, storage_service)); + ASSERT_NO_THROW(simulation->stageFile(input_file, wrench::FileLocation::LOCATION(storage_service))); // Running a "run a single task" simulation ASSERT_NO_THROW(simulation->launch()); @@ -1269,12 +1300,12 @@ void VirtualizedClusterServiceTest::do_ShutdownVMAndThenShutdownServiceTest_test // Create a Storage Service ASSERT_NO_THROW(storage_service = simulation->add( - new wrench::SimpleStorageService(hostname, 100.0))); + new wrench::SimpleStorageService(hostname, {"/"}))); // Create a Cloud Service std::vector execution_hosts = {simulation->getHostnameList()[1]}; ASSERT_NO_THROW(compute_service = simulation->add( - new wrench::VirtualizedClusterComputeService(hostname, execution_hosts, 0, + new wrench::VirtualizedClusterComputeService(hostname, execution_hosts, "", {{wrench::BareMetalComputeServiceProperty::SUPPORTS_STANDARD_JOBS, "false"}}))); // Create a WMS @@ -1332,12 +1363,6 @@ class SubmitToVMTestWMS : public wrench::WMS { // Create a job manager auto job_manager = this->createJobManager(); - // Create standard jobs - wrench::StandardJob *job1 = job_manager->createStandardJob({this->test->task1}, {}, - {std::make_tuple(this->test->input_file, - this->test->storage_service, - wrench::ComputeService::SCRATCH)}, - {}, {}); wrench::StandardJob *job2 = job_manager->createStandardJob({this->test->task2}, {}, {std::make_tuple(this->test->input_file, this->test->storage_service, @@ -1365,6 +1390,11 @@ class SubmitToVMTestWMS : public wrench::WMS { for (auto &vm : vm_list) { cs->shutdownVM(std::get<0>(vm)); } + wrench::StandardJob *job1 = job_manager->createStandardJob({this->test->task1}, {}, + {std::make_tuple(this->test->input_file, + wrench::FileLocation::LOCATION(this->test->storage_service), + wrench::FileLocation::LOCATION(std::get<1>(vm_list[0])->getScratch()))}, + {}, {}); // Trying to submit to a VM that has been shutdown job_manager->submitJob(job1, std::get<1>(vm_list[0])); throw std::runtime_error("Should not be able to run job since VMs are stopped"); @@ -1383,6 +1413,12 @@ class SubmitToVMTestWMS : public wrench::WMS { throw std::runtime_error("Couldn't start VM: " + e.getCause()->toString()); } + wrench::StandardJob *job1 = job_manager->createStandardJob({this->test->task1}, {}, + {std::make_tuple(this->test->input_file, + wrench::FileLocation::LOCATION(this->test->storage_service), + wrench::FileLocation::LOCATION(std::get<1>(vm_list[1])->getScratch()))}, + {}, {}); + try { job_manager->submitJob(job1, std::get<1>(vm_list[1])); } catch (wrench::WorkflowExecutionException &e) { diff --git a/test/storage_services/SimpleStorageService/SimpleStorageServiceFunctionalTest.cpp b/test/storage_services/SimpleStorageService/SimpleStorageServiceFunctionalTest.cpp index 8d3a6a8574..414f7af06c 100644 --- a/test/storage_services/SimpleStorageService/SimpleStorageServiceFunctionalTest.cpp +++ b/test/storage_services/SimpleStorageService/SimpleStorageServiceFunctionalTest.cpp @@ -778,16 +778,18 @@ class SimpleStorageServiceAsynchronousFileCopyTestWMS : public wrench::WMS { // Initiate a file copy try { - data_movement_manager->initiateAsynchronousFileCopy(this->test->file_500, wrench::FileLocation::LOCATION(this->test->storage_service_1000), - this->test->storage_service_510); + data_movement_manager->initiateAsynchronousFileCopy(this->test->file_500, + wrench::FileLocation::LOCATION(this->test->storage_service_1000), + wrench::FileLocation::LOCATION(this->test->storage_service_510)); } catch (wrench::WorkflowExecutionException &e) { throw std::runtime_error("Got an exception while trying to initiate a file copy: " + std::string(e.what())); } // Initiate it again which should fail try { - data_movement_manager->initiateAsynchronousFileCopy(this->test->file_500, wrench::FileLocation::LOCATION(this->test->storage_service_1000), - this->test->storage_service_510); + data_movement_manager->initiateAsynchronousFileCopy(this->test->file_500, + wrench::FileLocation::LOCATION(this->test->storage_service_1000), + wrench::FileLocation::LOCATION(this->test->storage_service_510)); throw std::runtime_error("A duplicate asynchronous file copy should fail!"); } catch (wrench::WorkflowExecutionException &e) { auto cause = std::dynamic_pointer_cast(e.getCause()); @@ -799,11 +801,11 @@ class SimpleStorageServiceAsynchronousFileCopyTestWMS : public wrench::WMS { if (cause->getFile() != this->test->file_500) { throw std::runtime_error("Got expected failure cause, but failure cause does not point to the right file"); } - if (cause->getStorageService() != this->test->storage_service_510) { + if (cause->getDestinationLocation()->getStorageService() != this->test->storage_service_510) { throw std::runtime_error("Got expected failure cause, but failure cause does not point to the right storage service"); } - if (cause->getPartition() != "/") { - throw std::runtime_error("Got expected failure cause, but failure cause does not point to the right partition"); + if (cause->getDestinationLocation()->getAbsolutePathAtMountPoint() != "/") { + throw std::runtime_error("Got expected failure cause, but failure cause does not point to the right path"); } cause->toString(); // for coverage } @@ -855,10 +857,10 @@ void SimpleStorageServiceFunctionalTest::do_AsynchronousFileCopy_test() { // Create 2 Storage Services ASSERT_NO_THROW(storage_service_1000 = simulation->add( - new wrench::SimpleStorageService(hostname, 1000.0))); + new wrench::SimpleStorageService(hostname, {"/disk1000"}))); ASSERT_NO_THROW(storage_service_510 = simulation->add( - new wrench::SimpleStorageService(hostname, 500.0))); + new wrench::SimpleStorageService(hostname, {"/disk510"}))); // Create a WMS std::shared_ptr wms = nullptr; @@ -873,7 +875,7 @@ void SimpleStorageServiceFunctionalTest::do_AsynchronousFileCopy_test() { simulation->add(new wrench::FileRegistryService(hostname)); // Staging file_500 on the 1000-byte storage service - ASSERT_NO_THROW(simulation->stageFiles({{file_500->getID(), file_500}}, storage_service_1000)); + ASSERT_NO_THROW(simulation->stageFile(file_500, wrench::FileLocation::LOCATION(storage_service_1000))); // Running a "run a single task" simulation ASSERT_NO_THROW(simulation->launch()); @@ -912,8 +914,9 @@ class SimpleStorageServiceSynchronousFileCopyFailuresTestWMS : public wrench::WM // Do the file copy while space doesn't fit try { - data_movement_manager->doSynchronousFileCopy(this->test->file_500, wrench::FileLocation::LOCATION(this->test->storage_service_1000), - this->test->storage_service_100); + data_movement_manager->doSynchronousFileCopy(this->test->file_500, + wrench::FileLocation::LOCATION(this->test->storage_service_1000), + wrench::FileLocation::LOCATION(this->test->storage_service_100)); throw std::runtime_error("Should have gotten a 'not enough space' exception"); } catch (wrench::WorkflowExecutionException &e) { // Check Exception @@ -936,8 +939,9 @@ class SimpleStorageServiceSynchronousFileCopyFailuresTestWMS : public wrench::WM // Do a file copy from myself try { - data_movement_manager->doSynchronousFileCopy(this->test->file_500, this->test->storage_service_510, - this->test->storage_service_510); + data_movement_manager->doSynchronousFileCopy(this->test->file_500, + wrench::FileLocation::LOCATION(this->test->storage_service_510), + wrench::FileLocation::LOCATION(this->test->storage_service_510)); throw std::runtime_error("Should have gotten a 'can't copy from myself' exception"); } catch (std::invalid_argument &e) { } @@ -945,11 +949,12 @@ class SimpleStorageServiceSynchronousFileCopyFailuresTestWMS : public wrench::WM // Do the file copy for a file that's not there // First delete the file (we used to have an "already there" error) - this->test->storage_service_1000->deleteFile(this->test->file_500); + wrench::StorageService::deleteFile(this->test->file_500, wrench::FileLocation::LOCATION(this->test->storage_service_1000); try { - data_movement_manager->doSynchronousFileCopy(this->test->file_500, wrench::FileLocation::LOCATION(this->test->storage_service_510), - this->test->storage_service_1000); + data_movement_manager->doSynchronousFileCopy(this->test->file_500, + wrench::FileLocation::LOCATION(this->test->storage_service_510), + wrench::FileLocation::LOCATION(this->test->storage_service_1000)); throw std::runtime_error("Should have gotten a 'file not found' exception"); } catch (wrench::WorkflowExecutionException &e) { // Check Exception @@ -963,7 +968,7 @@ class SimpleStorageServiceSynchronousFileCopyFailuresTestWMS : public wrench::WM throw std::runtime_error( "Got the expected 'file not found' exception, but the failure cause does not point to the correct file"); } - if (cause->getStorageService() != wrench::FileLocation::LOCATION(this->test->storage_service_510)) { + if (cause->getLocation()->getStorageService() != wrench::FileLocation::LOCATION(this->test->storage_service_510)) { throw std::runtime_error( "Got the expected 'file not found' exception, but the failure cause does not point to the correct storage service"); } @@ -973,7 +978,8 @@ class SimpleStorageServiceSynchronousFileCopyFailuresTestWMS : public wrench::WM this->test->storage_service_1000->stop(); try { - data_movement_manager->doSynchronousFileCopy(this->test->file_500, this->test->storage_service_1000, + data_movement_manager->doSynchronousFileCopy(this->test->file_500, + wrench::FileLocation::LOCATION(this->test->storage_service_1000), wrench::FileLocation::LOCATION(this->test->storage_service_510)); throw std::runtime_error("Should have gotten a 'service is down' exception"); } catch (wrench::WorkflowExecutionException &e) { @@ -1045,13 +1051,13 @@ void SimpleStorageServiceFunctionalTest::do_SynchronousFileCopyFailures_test() { // Create 3 Storage Services ASSERT_NO_THROW(storage_service_1000 = simulation->add( - new wrench::SimpleStorageService(hostname, 1000.0))); + new wrench::SimpleStorageService(hostname, {"/disk1000"}))); ASSERT_NO_THROW(storage_service_510 = simulation->add( - new wrench::SimpleStorageService(hostname, 500.0))); + new wrench::SimpleStorageService(hostname, {"/disk510"}))); ASSERT_NO_THROW(storage_service_100 = simulation->add( - new wrench::SimpleStorageService(hostname, 100.0, {{"MAX_NUM_CONCURRENT_DATA_CONNECTIONS", "infinity"}}))); + new wrench::SimpleStorageService(hostname, {"/disk100"}, {{"MAX_NUM_CONCURRENT_DATA_CONNECTIONS", "infinity"}}))); // Create a WMS std::shared_ptr wms = nullptr; @@ -1264,13 +1270,13 @@ void SimpleStorageServiceFunctionalTest::do_AsynchronousFileCopyFailures_test() // Create 3 Storage Services ASSERT_NO_THROW(storage_service_1000 = simulation->add( - new wrench::SimpleStorageService(hostname, 1000.0))); + new wrench::SimpleStorageService(hostname, {"/disk1000"}))); ASSERT_NO_THROW(storage_service_510 = simulation->add( - new wrench::SimpleStorageService(hostname, 500.0))); + new wrench::SimpleStorageService(hostname, {"/disk510"}))); ASSERT_NO_THROW(storage_service_100 = simulation->add( - new wrench::SimpleStorageService(hostname, 100.0))); + new wrench::SimpleStorageService(hostname, {"/disk100"}))); // Create a WMS std::shared_ptr wms = nullptr;; @@ -1289,7 +1295,7 @@ void SimpleStorageServiceFunctionalTest::do_AsynchronousFileCopyFailures_test() simulation->add(new wrench::FileRegistryService(hostname)); // Staging file_500 on the 1000-byte storage service - ASSERT_NO_THROW(simulation->stageFiles({{file_500->getID(), file_500}}, storage_service_1000)); + ASSERT_NO_THROW(simulation->stageFile(file_500, wrench::FileLocation::LOCATION(storage_service_1000))); // Running a "run a single task" simulation ASSERT_NO_THROW(simulation->launch()); @@ -1350,8 +1356,9 @@ class PartitionsTestWMS : public wrench::WMS { // Do a very similar copy, but with "empty" partitions that default to "/" // Copy storage_service_1000:/:file_10 to storage_service_510:/:file_10 try { - data_movement_manager->initiateAsynchronousFileCopy(this->test->file_10, this->test->storage_service_1000, "", - this->test->storage_service_510, ""); + data_movement_manager->initiateAsynchronousFileCopy(this->test->file_10, + wrench::FileLocation::LOCATION(this->test->storage_service_1000, "/disk1000/"), + wrench::FileLocation::LOCATION(this->test->storage_service_510, "/disk510")); } catch (wrench::WorkflowExecutionException &e) { throw std::runtime_error("Got an unexpected exception"); } @@ -1369,7 +1376,7 @@ class PartitionsTestWMS : public wrench::WMS { // Remove the file at storage_service_510:/:file_10 try { - wrench::FileLocation::LOCATION(this->test->storage_service_510)->deleteFile(this->test->file_10, ""); + wrench::StorageService::deleteFile(this->test->file_10, wrench::FileLocation::LOCATION(this->test->storage_service_510, "/disk510")); } catch (wrench::WorkflowExecutionException &e) { throw std::runtime_error("Should be able to delete file storage_service_510:/:file_10"); } @@ -1378,8 +1385,9 @@ class PartitionsTestWMS : public wrench::WMS { // Copy storage_service_510:/:file_10 to storage_service_1000:foo:file_10: SHOULD NOT WORK try { - data_movement_manager->initiateAsynchronousFileCopy(this->test->file_10, wrench::FileLocation::LOCATION(this->test->storage_service_510), "/", - this->test->storage_service_1000, "foo"); + data_movement_manager->initiateAsynchronousFileCopy(this->test->file_10, + wrench::FileLocation::LOCATION(this->test->storage_service_510), + wrench::FileLocation::LOCATION(this->test->storage_service_1000, "/disk1000/foo")); } catch (wrench::WorkflowExecutionException &e) { throw std::runtime_error("Got an unexpected exception"); } @@ -1438,7 +1446,7 @@ class PartitionsTestWMS : public wrench::WMS { try { data_movement_manager->initiateAsynchronousFileCopy(this->test->file_10, wrench::FileLocation::LOCATION(this->test->storage_service_510, "/large_disk/foo")), - wrench::FileLocation::LOCATION(this->test->storage_service_510, "/large_disk/foo")); + wrench::FileLocation::LOCATION(this->test->storage_service_510, "/large_disk/foo")); throw std::runtime_error("Should not be able to copy a file onto itself"); } catch (std::invalid_argument &e) { } @@ -1450,7 +1458,7 @@ class PartitionsTestWMS : public wrench::WMS { if (not wrench::StorageService::lookupFile(this->test->file_10, wrench::FileLocation::LOCATION(this->test->storage_service_1000, "/large_disk"))) { throw std::runtime_error("File should be in storage_service_1000 at the mount point root"); } - if (not wrench::StorageService::lookupFile(this->test->file_10, wrench::FileLocation::LOCATION(this->test->storage_service_510, "/large_disk/foo"))) { + if (not wrench::StorageService::lookupFile(this->test->file_10, wrench::FileLocation::LOCATION(wrench::FileLocation::LOCATION(this->test->storage_service_510), "/large_disk/foo"))) { throw std::runtime_error("File should be in storage_service_510 at path /large_disk/foo/"); } if (not wrench::StorageService::lookupFile(this->test->file_10, wrench::FileLocation::LOCATION(this->test->storage_service_1000, "/large_disk/foo"))) { @@ -1473,8 +1481,8 @@ class PartitionsTestWMS : public wrench::WMS { // File copy from oneself to oneself! try { - data_movement_manager->initiateAsynchronousFileCopy(this->test->file_10, this->test->storage_service_510, "foo", - this->test->storage_service_510, "faa"); + data_movement_manager->initiateAsynchronousFileCopy(this->test->file_10, wrench::FileLocation::LOCATION(this->test->storage_service_510, "/foo"), + wrench::FileLocation::LOCATION(this->test->storage_service_510, "/faa"); } catch (wrench::WorkflowExecutionException &e) { throw std::runtime_error("Got an unexpected exception"); } @@ -1515,10 +1523,10 @@ void SimpleStorageServiceFunctionalTest::do_Partitions_test() { // Create 2 Storage Services ASSERT_NO_THROW(storage_service_1000 = simulation->add( - new wrench::SimpleStorageService(hostname, 1000.0))); + new wrench::SimpleStorageService(hostname, {"/disk1000"}))); ASSERT_NO_THROW(storage_service_510 = simulation->add( - new wrench::SimpleStorageService(hostname, 500.0))); + new wrench::SimpleStorageService(hostname, {"/disk510"}))); // Create a WMS @@ -1646,7 +1654,7 @@ void SimpleStorageServiceFunctionalTest::do_FileWrite_test() { // Create 2 Storage Services ASSERT_NO_THROW(storage_service_100 = simulation->add( - new wrench::SimpleStorageService(hostname, 100.0))); + new wrench::SimpleStorageService(hostname, {"/disk100"}))); // Create a WMS std::shared_ptr wms = nullptr;; diff --git a/test/wms/MultipleWMSTest.cpp b/test/wms/MultipleWMSTest.cpp index 462866cd45..e4fd43889e 100644 --- a/test/wms/MultipleWMSTest.cpp +++ b/test/wms/MultipleWMSTest.cpp @@ -31,8 +31,26 @@ class MultipleWMSTest : public ::testing::Test { "" " " " " - " " - " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " " " " " " " @@ -110,10 +128,15 @@ class DeferredWMSStartTestWMS : public wrench::WMS { // Get the file registry service auto file_registry_service = this->getAvailableFileRegistryService(); - std::set, std::shared_ptr>> pre_copies = {}; + // Get the cloud service + auto cs = *this->getAvailableComputeServices().begin(); + + std::set, std::shared_ptr>> pre_copies = {}; for (auto it : this->getWorkflow()->getInputFiles()) { - std::tuple, std::shared_ptr> each_copy = - std::make_tuple(it.second, this->test->storage_service, wrench::ComputeService::SCRATCH); + std::tuple, std::shared_ptr> each_copy = + std::make_tuple(it.second, + wrench::FileLocation::LOCATION(this->test->storage_service), + wrench::FileLocation::LOCATION(cs->getScratch())); pre_copies.insert(each_copy); } @@ -169,12 +192,12 @@ void MultipleWMSTest::do_deferredWMSStartOneWMS_test() { // Create a Storage Service ASSERT_NO_THROW(storage_service = simulation->add( - new wrench::SimpleStorageService(hostname, 100.0))); + new wrench::SimpleStorageService(hostname, {"/"}))); // Create a Cloud Service std::vector execution_hosts = {simulation->getHostnameList()[1]}; ASSERT_NO_THROW(compute_service = simulation->add(new wrench::CloudComputeService( - hostname, execution_hosts, 100.0, + hostname, execution_hosts, "/scratch", {{wrench::BareMetalComputeServiceProperty::SUPPORTS_PILOT_JOBS, "false"}}))); // Create a WMS @@ -190,7 +213,9 @@ void MultipleWMSTest::do_deferredWMSStartOneWMS_test() { new wrench::FileRegistryService(hostname))); // Staging the input_file on the storage service - ASSERT_NO_THROW(simulation->stageFiles(workflow->getInputFiles(), storage_service)); + for (auto const &f : workflow->getInputFiles()) { + ASSERT_NO_THROW(simulation->stageFile(f.second, wrench::FileLocation::LOCATION(storage_service))); + } // Running a "run a single task" simulation ASSERT_NO_THROW(simulation->launch()); @@ -220,12 +245,12 @@ void MultipleWMSTest::do_deferredWMSStartTwoWMS_test() { // Create a Storage Service ASSERT_NO_THROW(storage_service = simulation->add( - new wrench::SimpleStorageService(hostname, 100.0))); + new wrench::SimpleStorageService(hostname, {"/"}))); // Create a Cloud Service std::vector execution_hosts = {simulation->getHostnameList()[1]}; ASSERT_NO_THROW(compute_service = simulation->add( - new wrench::CloudComputeService(hostname, execution_hosts, 100.0, + new wrench::CloudComputeService(hostname, execution_hosts, "/scratch", {{wrench::BareMetalComputeServiceProperty::SUPPORTS_PILOT_JOBS, "false"}}))); // Create a WMS @@ -249,8 +274,14 @@ void MultipleWMSTest::do_deferredWMSStartTwoWMS_test() { new wrench::FileRegistryService(hostname))); // Staging the input_file on the storage service - ASSERT_NO_THROW(simulation->stageFiles(workflow->getInputFiles(), storage_service)); - ASSERT_NO_THROW(simulation->stageFiles(workflow2->getInputFiles(), storage_service)); + for (auto const &f : workflow->getInputFiles()) { + ASSERT_NO_THROW(simulation->stageFile(f.second, wrench::FileLocation::LOCATION(storage_service))); + + } + for (auto const &f : workflow2->getInputFiles()) { + ASSERT_NO_THROW(simulation->stageFile(f.second, wrench::FileLocation::LOCATION(storage_service))); + + } // Running a "run a single task" simulation ASSERT_NO_THROW(simulation->launch()); diff --git a/test/wms/WMSOptimizationsTest.cpp b/test/wms/WMSOptimizationsTest.cpp index af8104dd83..85564807fc 100644 --- a/test/wms/WMSOptimizationsTest.cpp +++ b/test/wms/WMSOptimizationsTest.cpp @@ -31,8 +31,26 @@ class WMSOptimizationsTest : public ::testing::Test { "" " " " " - " " - " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " " " " " " " @@ -166,13 +184,13 @@ void WMSOptimizationsTest::do_staticOptimization_test() { // Create a Storage Service ASSERT_NO_THROW(storage_service = simulation->add( - new wrench::SimpleStorageService(hostname, 100.0))); + new wrench::SimpleStorageService(hostname, {"/"}))); // Create a MHMC Service std::set execution_hosts = {simulation->getHostnameList()[1]}; ASSERT_NO_THROW(compute_service = simulation->add( new wrench::BareMetalComputeService( - hostname, execution_hosts, 100.0, + hostname, execution_hosts, "/scratch", {{wrench::BareMetalComputeServiceProperty::SUPPORTS_PILOT_JOBS, "false"}}))); // Create a WMS @@ -188,7 +206,9 @@ void WMSOptimizationsTest::do_staticOptimization_test() { ASSERT_NO_THROW(simulation->add(new wrench::FileRegistryService(hostname))); // Staging the input_file on the storage service - ASSERT_NO_THROW(simulation->stageFiles(workflow->getInputFiles(), storage_service)); + for (auto const &f : workflow->getInputFiles()) { + ASSERT_NO_THROW(simulation->stageFile(f.second, wrench::FileLocation::LOCATION(storage_service))); + } // Running a "run a single task" simulation ASSERT_NO_THROW(simulation->launch()); @@ -301,13 +321,13 @@ void WMSOptimizationsTest::do_dynamicOptimization_test() { // Create a Storage Service ASSERT_NO_THROW(storage_service = simulation->add( - new wrench::SimpleStorageService(hostname, 100.0))); + new wrench::SimpleStorageService(hostname, {"/"}))); // Create a MHMC Service std::set execution_hosts = {simulation->getHostnameList()[1]}; ASSERT_NO_THROW(compute_service = simulation->add( new wrench::BareMetalComputeService( - hostname, execution_hosts, 100.0, + hostname, execution_hosts, "/scratch", {{wrench::BareMetalComputeServiceProperty::SUPPORTS_PILOT_JOBS, "false"}}))); // Create a WMS @@ -323,7 +343,10 @@ void WMSOptimizationsTest::do_dynamicOptimization_test() { ASSERT_NO_THROW(simulation->add(new wrench::FileRegistryService(hostname))); // Staging the input_file on the storage service - ASSERT_NO_THROW(simulation->stageFiles(workflow->getInputFiles(), storage_service)); + // Staging the input_file on the storage service + for (auto const &f : workflow->getInputFiles()) { + ASSERT_NO_THROW(simulation->stageFile(f.second, wrench::FileLocation::LOCATION(storage_service))); + } // Running a "run a single task" simulation ASSERT_NO_THROW(simulation->launch()); diff --git a/test/wms/WMSTest.cpp b/test/wms/WMSTest.cpp index 524a59fc63..a3d96115c2 100644 --- a/test/wms/WMSTest.cpp +++ b/test/wms/WMSTest.cpp @@ -426,7 +426,7 @@ void WMSTest::do_CustomHandlerWMS_test() { std::vector batch_hosts; batch_hosts.push_back(hostname1); ASSERT_NO_THROW(cs_batch = simulation->add( - new wrench::BatchComputeService(hostname2, batch_hosts, 100.0, {}, {}))); + new wrench::BatchComputeService(hostname2, batch_hosts, "/scratch", {}, {}))); // Create a WMS