Skip to content

Commit

Permalink
debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
henricasanova committed Dec 19, 2023
1 parent e9a56c1 commit 0b9683f
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 29 deletions.
6 changes: 5 additions & 1 deletion src/wrench/simgrid_S4U_util/S4U_CommPort.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/wrench/simulation/Simulation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<wrench::ExecutionEvent> event;
try {
Expand Down Expand Up @@ -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));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<double>(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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)");
}
}

Expand All @@ -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));

Expand All @@ -295,18 +297,18 @@ void BareMetalComputeServiceLinkFailuresTest::do_MultiActionJobLinkFailure_test(
// Create a Compute Service
std::shared_ptr<wrench::BareMetalComputeService> 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<wrench::ExecutionController> 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());
Expand Down

0 comments on commit 0b9683f

Please sign in to comment.