Skip to content

Commit

Permalink
tmp commit (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
henricasanova committed Sep 26, 2019
1 parent 3fad4da commit f62b9b7
Show file tree
Hide file tree
Showing 8 changed files with 312 additions and 170 deletions.
1 change: 1 addition & 0 deletions src/wrench/simulation/Simulation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,7 @@ namespace wrench {
}
}


/**
* @brief Get the current simulated date
* @return a date
Expand Down

Large diffs are not rendered by default.

95 changes: 65 additions & 30 deletions test/compute_services/StandardJobExecutorTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,45 @@ class StandardJobExecutorTest : public ::testing::Test {
"<!DOCTYPE platform SYSTEM \"http://simgrid.gforge.inria.fr/simgrid/simgrid.dtd\">"
"<platform version=\"4.1\"> "
" <zone id=\"AS0\" routing=\"Full\"> "
" <host id=\"Host1\" speed=\"1f\" core=\"10\"/> "
" <host id=\"Host2\" speed=\"1f\" core=\"10\"/> "
" <host id=\"Host3\" speed=\"1f\" core=\"10\"/> "
" <host id=\"Host1\" speed=\"1f\" core=\"10\"> "
" <disk id=\"large_disk\" read_bw=\"100MBps\" write_bw=\"40MBps\">"
" <prop id=\"size\" value=\"10000000000000\"/>"
" <prop id=\"mount\" value=\"/\"/>"
" </disk>"
" <disk id=\"scratch\" read_bw=\"100MBps\" write_bw=\"40MBps\">"
" <prop id=\"size\" value=\"101\"/>"
" <prop id=\"mount\" value=\"/scratch\"/>"
" </disk>"
" </host> "
" <host id=\"Host2\" speed=\"1f\" core=\"10\"> "
" <disk id=\"large_disk\" read_bw=\"100MBps\" write_bw=\"40MBps\">"
" <prop id=\"size\" value=\"10000000000000\"/>"
" <prop id=\"mount\" value=\"/\"/>"
" </disk>"
" <disk id=\"scratch\" read_bw=\"100MBps\" write_bw=\"40MBps\">"
" <prop id=\"size\" value=\"101\"/>"
" <prop id=\"mount\" value=\"/scratch\"/>"
" </disk>"
" </host> "
" <host id=\"Host3\" speed=\"1f\" core=\"10\"> "
" <disk id=\"large_disk\" read_bw=\"100MBps\" write_bw=\"40MBps\">"
" <prop id=\"size\" value=\"10000000000000\"/>"
" <prop id=\"mount\" value=\"/\"/>"
" </disk>"
" <disk id=\"scratch\" read_bw=\"100MBps\" write_bw=\"40MBps\">"
" <prop id=\"size\" value=\"101\"/>"
" <prop id=\"mount\" value=\"/scratch\"/>"
" </disk>"
" </host> "
" <host id=\"Host4\" speed=\"1f\" core=\"10\"> "
" <disk id=\"large_disk\" read_bw=\"100MBps\" write_bw=\"40MBps\">"
" <prop id=\"size\" value=\"10000000000000\"/>"
" <prop id=\"mount\" value=\"/\"/>"
" </disk>"
" <disk id=\"scratch\" read_bw=\"100MBps\" write_bw=\"40MBps\">"
" <prop id=\"size\" value=\"101\"/>"
" <prop id=\"mount\" value=\"/scratch\"/>"
" </disk>"
" <prop id=\"ram\" value=\"1024\"/> "
" </host> "
" <link id=\"1\" bandwidth=\"5000GBps\" latency=\"0us\"/>"
Expand Down Expand Up @@ -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<wrench::WMS> wms = nullptr;
Expand All @@ -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
Expand Down Expand Up @@ -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<wrench::WMS> wms = nullptr;;
Expand All @@ -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
Expand Down Expand Up @@ -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");
}
Expand Down Expand Up @@ -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<wrench::WMS> wms = nullptr;;
Expand Down Expand Up @@ -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<wrench::WMS> wms = nullptr;;
Expand Down Expand Up @@ -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<wrench::ComputeService> compute_service;
Expand Down Expand Up @@ -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<wrench::WMS> wms = nullptr;;
Expand Down Expand Up @@ -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<wrench::WMS> wms = nullptr;;
Expand Down Expand Up @@ -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<wrench::WMS> wms = nullptr;;
Expand Down Expand Up @@ -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<wrench::WMS> wms = nullptr;;
Expand Down Expand Up @@ -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<wrench::WMS> wms = nullptr;;
Expand Down Expand Up @@ -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<wrench::WMS> wms = nullptr;;
Expand Down Expand Up @@ -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<wrench::WMS> wms = nullptr;;
Expand Down Expand Up @@ -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<wrench::WMS> wms = nullptr;;
Expand Down Expand Up @@ -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<wrench::WMS> wms = nullptr;;
Expand Down
Loading

0 comments on commit f62b9b7

Please sign in to comment.