diff --git a/src/wrench/simgrid_S4U_util/S4U_CommPort.cpp b/src/wrench/simgrid_S4U_util/S4U_CommPort.cpp index 94e414b5b2..d3403a2ef9 100755 --- a/src/wrench/simgrid_S4U_util/S4U_CommPort.cpp +++ b/src/wrench/simgrid_S4U_util/S4U_CommPort.cpp @@ -269,7 +269,11 @@ namespace wrench { #ifdef MESSAGE_MANAGER MessageManager::manageMessage(this, msg); #endif - this->s4u_mb->put_init(msg, (uint64_t) msg->payload)->detach(); + if (msg->payload != 0) { + this->s4u_mb->put_init(msg, (uint64_t) msg->payload)->detach(); + } else { + this->s4u_mq->put_init(msg)->start(); + } } /** diff --git a/src/wrench/simulation/Simulation.cpp b/src/wrench/simulation/Simulation.cpp index f6d8b5b2fe..cab774e539 100755 --- a/src/wrench/simulation/Simulation.cpp +++ b/src/wrench/simulation/Simulation.cpp @@ -157,7 +157,7 @@ namespace wrench { } else if (not strncmp(argv[i], "--wrench-default-control-message-size", strlen("--wrench-default-control-message-size"))) { char *equal_sign = strchr(argv[i], '='); if (!equal_sign) { - throw std::invalid_argument("Invalid ---wrench-default-control-message-size argument value"); + throw std::invalid_argument("Invalid --wrench-default-control-message-size argument value"); } // Check that the value is all digits char *ptr = equal_sign + 1; diff --git a/test/services/compute_services/bare_metal_standard_jobs/BareMetalComputeServiceTestStandardJobs.cpp b/test/services/compute_services/bare_metal_standard_jobs/BareMetalComputeServiceTestStandardJobs.cpp index 68a73870d3..7529a62a92 100644 --- a/test/services/compute_services/bare_metal_standard_jobs/BareMetalComputeServiceTestStandardJobs.cpp +++ b/test/services/compute_services/bare_metal_standard_jobs/BareMetalComputeServiceTestStandardJobs.cpp @@ -1603,16 +1603,13 @@ class BareMetalComputeServiceShutdownStorageServiceBeforeJobIsSubmittedTestWMS : // Create a 2-task1 job auto two_task_job = job_manager->createStandardJob({this->test->task1, this->test->task2}); - std::cerr << "SHUTTING DOWN THE SS\n"; // Shutdown the storage service this->test->storage_service->stop(); // Submit the 2-task1 job for execution - std::cerr << "SUBMITTING THE JOB\n"; job_manager->submitJob(two_task_job, this->test->compute_service); - std::cerr << "WAITING FOR FAILURE NOTIFICATION\n"; // Wait for the job failure notification std::shared_ptr event; try { @@ -1651,10 +1648,10 @@ void BareMetalComputeServiceTestStandardJobs::do_ShutdownStorageServiceBeforeJob // Create and initialize a simulation auto simulation = wrench::Simulation::createSimulation(); - int argc = 2; + int argc = 1; char **argv = (char **) calloc(argc, sizeof(char *)); argv[0] = strdup("unit_test"); - argv[1] = strdup("--wrench-full-log"); +// argv[1] = strdup("--wrench-full-log"); ASSERT_NO_THROW(simulation->init(&argc, argv)); diff --git a/test/services/helper_services/action_executor/FileReadActionExecutorTest.cpp b/test/services/helper_services/action_executor/FileReadActionExecutorTest.cpp index ffd93cffa5..0d3dc14f32 100755 --- a/test/services/helper_services/action_executor/FileReadActionExecutorTest.cpp +++ b/test/services/helper_services/action_executor/FileReadActionExecutorTest.cpp @@ -178,21 +178,12 @@ class FileReadActionExecutorSuccessTestWMS : public wrench::ExecutionController // Is the start-date sensible? RUNTIME_DBL_EQ(file_read_action->getStartDate(), 0.0, "action start date", EPSILON); -// if (file_read_action->getStartDate() < 0.0 or file_read_action->getStartDate() > EPSILON) { -// throw std::runtime_error("Unexpected action start date: " + std::to_string(file_read_action->getStartDate())); -// } // Is the end-date sensible? - RUNTIME_DBL_EQ(file_read_action->getEndDate(), 10.847442, "action end date", EPSILON); -// if (std::abs(file_read_action->getEndDate() - 10.847442) > EPSILON) { -// throw std::runtime_error("Unexpected action end date: " + std::to_string(file_read_action->getEndDate())); -// } + RUNTIME_DBL_EQ(file_read_action->getEndDate(), 10.83, "action end date", EPSILON); // Is the state sensible? RUNTIME_EQ(file_read_action->getState(), wrench::Action::State::COMPLETED, "action state"); -// if (file_read_action->getState() != wrench::Action::State::COMPLETED) { -// throw std::runtime_error("Unexpected action state: " + file_read_action->getStateAsString()); -// } return 0; } diff --git a/test/simulated_failures/link_failures/BareMetalComputeServiceLinkFailuresTest.cpp b/test/simulated_failures/link_failures/BareMetalComputeServiceLinkFailuresTest.cpp index d673a43bbd..81053e0ace 100755 --- a/test/simulated_failures/link_failures/BareMetalComputeServiceLinkFailuresTest.cpp +++ b/test/simulated_failures/link_failures/BareMetalComputeServiceLinkFailuresTest.cpp @@ -265,7 +265,7 @@ class MultiActionJobLinkFailureTestWMS : public wrench::ExecutionController { for (const auto &a: job->getActions()) { if (a->getState() != wrench::Action::FAILED) { - throw std::runtime_error("Invalid action state"); + throw std::runtime_error("Invalid action state " + a->getStateAsString() + " (expecting FAILED)"); } } @@ -281,11 +281,13 @@ void BareMetalComputeServiceLinkFailuresTest::do_MultiActionJobLinkFailure_test( // Create and initialize a simulation auto simulation = wrench::Simulation::createSimulation(); - int argc = 2; + int argc = 3; auto argv = (char **) calloc(argc, sizeof(char *)); - argv[0] = strdup("multi_action_test"); - argv[1] = strdup("--wrench-link-shutdown-simulation"); - // argv[2] = strdup("--wrench-full-log"); + int argi = 0; + argv[argi++] = strdup("multi_action_test"); + argv[argi++] = strdup("--wrench-link-shutdown-simulation"); + argv[argi++] = strdup("--wrench-default-control-message-size=1024"); +// argv[3] = strdup("--wrench-full-log"); ASSERT_NO_THROW(simulation->init(&argc, argv)); @@ -295,18 +297,18 @@ void BareMetalComputeServiceLinkFailuresTest::do_MultiActionJobLinkFailure_test( // Create a Compute Service std::shared_ptr compute_service; ASSERT_NO_THROW(compute_service = simulation->add( - new wrench::BareMetalComputeService("Host3", - {std::make_pair("Host3", - std::make_tuple(wrench::ComputeService::ALL_CORES, - wrench::ComputeService::ALL_RAM))}, - {"/scratch"}, - {{wrench::BareMetalComputeServiceProperty::SCRATCH_SPACE_BUFFER_SIZE, "10MB"}}))); + new wrench::BareMetalComputeService("Host3", + {std::make_pair("Host3", + std::make_tuple(wrench::ComputeService::ALL_CORES, + wrench::ComputeService::ALL_RAM))}, + {"/scratch"}, + {{wrench::BareMetalComputeServiceProperty::SCRATCH_SPACE_BUFFER_SIZE, "10MB"}}))); // Create a WMS std::shared_ptr wms = nullptr; std::string hostname = "Host1"; ASSERT_NO_THROW(wms = simulation->add( - new MultiActionJobLinkFailureTestWMS(this, workflow, compute_service, hostname))); + new MultiActionJobLinkFailureTestWMS(this, workflow, compute_service, hostname))); // Running a "do nothing" simulation ASSERT_NO_THROW(simulation->launch());