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 f36e8fe commit 3fad4da
Show file tree
Hide file tree
Showing 11 changed files with 741 additions and 797 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ namespace wrench {

public:


static std::shared_ptr<FileLocation> LOCATION(std::shared_ptr<StorageService> ss);

static std::shared_ptr<FileLocation> LOCATION(std::shared_ptr<StorageService> ss,
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ void BareMetalComputeServiceTestScheduling::do_RAMPressure_test() {
// Create a Compute Service
ASSERT_NO_THROW(cs = simulation->add(
new wrench::BareMetalComputeService("Host1",
(std::set<std::string>){"Host1", "Host2"}, 0.0,
(std::set<std::string>){"Host1", "Host2"}, {},
{}, {})));
std::set<std::shared_ptr<wrench::ComputeService>> compute_services;
compute_services.insert(cs);
Expand Down Expand Up @@ -349,7 +349,7 @@ void BareMetalComputeServiceTestScheduling::do_LoadBalancing1_test() {
// Create a Compute Service
ASSERT_NO_THROW(cs = simulation->add(
new wrench::BareMetalComputeService("Host1",
(std::set<std::string>){"Host1", "Host2"}, 0.0,
(std::set<std::string>){"Host1", "Host2"}, "",
{}, {})));
std::set<std::shared_ptr<wrench::ComputeService>> compute_services;
compute_services.insert(cs);
Expand Down Expand Up @@ -483,7 +483,7 @@ void BareMetalComputeServiceTestScheduling::do_LoadBalancing2_test() {
// Create a Compute Service
ASSERT_NO_THROW(cs = simulation->add(
new wrench::BareMetalComputeService("Host1",
(std::set<std::string>){"Host1", "Host3"}, 0.0,
(std::set<std::string>){"Host1", "Host3"}, "",
{}, {})));
std::set<std::shared_ptr<wrench::ComputeService>> compute_services;
compute_services.insert(cs);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ class BareMetalComputeServiceTestStandardJobs : public ::testing::Test {
" <prop id=\"mount\" value=\"/\"/>"
" </disk>"
" <disk id=\"scratch\" read_bw=\"100MBps\" write_bw=\"40MBps\">"
" <prop id=\"size\" value=\"100\"/>"
" <prop id=\"size\" value=\"101\"/>"
" <prop id=\"mount\" value=\"/scratch\"/>"
" </disk>"
" </host>"
Expand All @@ -130,7 +130,7 @@ class BareMetalComputeServiceTestStandardJobs : public ::testing::Test {
" <prop id=\"mount\" value=\"/\"/>"
" </disk>"
" <disk id=\"scratch\" read_bw=\"100MBps\" write_bw=\"40MBps\">"
" <prop id=\"size\" value=\"100\"/>"
" <prop id=\"size\" value=\"101\"/>"
" <prop id=\"mount\" value=\"/scratch\"/>"
" </disk>"
" </host>"
Expand Down Expand Up @@ -291,7 +291,9 @@ class MulticoreComputeServiceBogusNumCoresTestWMS : public wrench::WMS {

// Create a 1-task job
auto two_core_task_job = job_manager->createStandardJob({this->test->task3}, {},
{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 1-task job for execution with too few cores
Expand Down Expand Up @@ -333,7 +335,7 @@ void BareMetalComputeServiceTestStandardJobs::do_BogusNumCores_test() {
ASSERT_NO_THROW(simulation->instantiatePlatform(platform_file_path));

// Get a hostname
std::string hostname = simulation->getHostnameList()[0];
std::string hostname = "DualCoreHost";

// Create A Storage Services
ASSERT_NO_THROW(storage_service = simulation->add(
Expand All @@ -342,8 +344,8 @@ void BareMetalComputeServiceTestStandardJobs::do_BogusNumCores_test() {
// 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))}, 101.0,
{}))); //scratch space of size 101
{std::make_pair(hostname, std::make_tuple(wrench::ComputeService::ALL_CORES, wrench::ComputeService::ALL_RAM))},
{"/scratch"}, {}))); //scratch space of size 101

// Create a WMS
std::shared_ptr<wrench::WMS> wms = nullptr;
Expand Down Expand Up @@ -400,9 +402,12 @@ class MulticoreComputeServiceTwoSingleCoreTasksTestWMS : public wrench::WMS {
auto file_registry_service = this->getAvailableFileRegistryService();

// 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)},
{}, {});
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(this->test->compute_service->getScratch()))},
{}, {});

// Submit the 2-task job for execution
job_manager->submitJob(two_task_job, this->test->compute_service);
Expand Down Expand Up @@ -463,9 +468,11 @@ void BareMetalComputeServiceTestStandardJobs::do_TwoSingleCoreTasks_test() {

// 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))}, 101.0,
{}))); //scratch space of size 101
new wrench::BareMetalComputeService(
hostname,
{std::make_pair(hostname, std::make_tuple(wrench::ComputeService::ALL_CORES, wrench::ComputeService::ALL_RAM))},
{"/scratch"},
{}))); //scratch space of size 101

// Create a WMS
std::shared_ptr<wrench::WMS> wms = nullptr;
Expand All @@ -480,7 +487,7 @@ void BareMetalComputeServiceTestStandardJobs::do_TwoSingleCoreTasks_test() {


// Staging the input file on the storage service
ASSERT_NO_THROW(simulation->stageFiles({{input_file->getID(), 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());
Expand Down Expand Up @@ -521,7 +528,9 @@ class MulticoreComputeServiceTwoDualCoreTasksCase1TestWMS : public wrench::WMS {

// Create a 2-task job
wrench::StandardJob *two_task_job = job_manager->createStandardJob({this->test->task3, this->test->task4}, {},
{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
Expand Down Expand Up @@ -587,7 +596,7 @@ void BareMetalComputeServiceTestStandardJobs::do_TwoDualCoreTasksCase1_test() {
ASSERT_NO_THROW(compute_service = simulation->add(
new wrench::BareMetalComputeService(hostname,
{std::make_pair("DualCoreHost", std::make_tuple(wrench::ComputeService::ALL_CORES, wrench::ComputeService::ALL_RAM))},
100.0, {})));
{"/scratch"}, {})));

// Create a WMS
std::shared_ptr<wrench::WMS> wms;
Expand All @@ -601,7 +610,7 @@ void BareMetalComputeServiceTestStandardJobs::do_TwoDualCoreTasksCase1_test() {
simulation->add(new wrench::FileRegistryService(hostname));

// Staging the input file on the storage service
ASSERT_NO_THROW(simulation->stageFiles({{input_file->getID(), 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());
Expand Down Expand Up @@ -643,7 +652,9 @@ class MulticoreComputeServiceTwoDualCoreTasksCase2TestWMS : public wrench::WMS {

// Create a 2-task job
wrench::StandardJob *two_task_job = 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
Expand Down
Loading

0 comments on commit 3fad4da

Please sign in to comment.