diff --git a/test/services/storage_services/SimpleStorageService/SimpleStorageServicePerformanceTest.cpp b/test/services/storage_services/SimpleStorageService/SimpleStorageServicePerformanceTest.cpp index 1cbccb66b3..cc6a0aa6e3 100755 --- a/test/services/storage_services/SimpleStorageService/SimpleStorageServicePerformanceTest.cpp +++ b/test/services/storage_services/SimpleStorageService/SimpleStorageServicePerformanceTest.cpp @@ -9,6 +9,8 @@ #include +#include +#include #include @@ -42,14 +44,14 @@ class SimpleStorageServicePerformanceTest : public ::testing::Test { sg_size_t buffer_size) { double expected_elapsed = 0; if (buffer_size >= total_size) { - return (total_size / bw_stage1) + (total_size / bw_stage2); + return ((double)total_size / bw_stage1) + ((double)total_size / bw_stage2); } else { double bottleneck_bandwidth = std::min(bw_stage1, bw_stage2); double num_full_buffers = std::floor(total_size / buffer_size); - return buffer_size / bw_stage1 + + return (double)buffer_size / bw_stage1 + (num_full_buffers - 1) * (buffer_size / bottleneck_bandwidth) + buffer_size / bw_stage2 + - (total_size - num_full_buffers * buffer_size) / bw_stage2; + ((double)total_size - num_full_buffers * buffer_size) / bw_stage2; } } @@ -57,18 +59,18 @@ class SimpleStorageServicePerformanceTest : public ::testing::Test { sg_size_t total_size, sg_size_t buffer_size) { double expected_elapsed = 0; if (buffer_size >= total_size) { - return (total_size / bw_stage1) + (total_size / bw_stage2) + (total_size / bw_stage3); + return ((double)total_size / bw_stage1) + ((double)total_size / bw_stage2) + ((double)total_size / bw_stage3); } else { double bottleneck_bandwidth = std::min(std::min(bw_stage1, bw_stage2), bw_stage3); double num_full_buffers = std::floor(total_size / buffer_size); - double last_nonfull_buffer_size = total_size - num_full_buffers * buffer_size; + double last_nonfull_buffer_size = total_size - num_full_buffers * (double)buffer_size; - return buffer_size / bw_stage1 + - buffer_size / std::min(bw_stage1, bw_stage2) + - (num_full_buffers - 2) * (buffer_size / bottleneck_bandwidth) + + return (double)buffer_size / bw_stage1 + + (double)buffer_size / std::min(bw_stage1, bw_stage2) + + (num_full_buffers - 2) * ((double)buffer_size / bottleneck_bandwidth) + std::max(last_nonfull_buffer_size / bw_stage1, - buffer_size / std::min(bw_stage2, bw_stage3)) + - std::max(last_nonfull_buffer_size / bw_stage2, buffer_size / bw_stage3) + + (double)buffer_size / std::min(bw_stage2, bw_stage3)) + + std::max(last_nonfull_buffer_size / bw_stage2, (double)buffer_size / bw_stage3) + last_nonfull_buffer_size / bw_stage3; } } @@ -151,7 +153,7 @@ class SimpleStorageServiceConcurrentFileCopiesTestWMS : public wrench::Execution public: SimpleStorageServiceConcurrentFileCopiesTestWMS(SimpleStorageServicePerformanceTest *test, - std::string hostname, + const std::string& hostname, sg_size_t buffer_size) : wrench::ExecutionController(hostname, "test"), test(test), buffer_size(buffer_size) { } @@ -278,7 +280,7 @@ void SimpleStorageServicePerformanceTest::do_ConcurrentFileCopies_test(sg_size_t {{wrench::StorageServiceProperty::BUFFER_SIZE, std::to_string(buffer_size)}}))); // Create a WMS - std::shared_ptr wms = nullptr; + std::shared_ptr wms; ASSERT_NO_THROW(wms = simulation->add( new SimpleStorageServiceConcurrentFileCopiesTestWMS( this, "WMSHost", buffer_size))); @@ -310,7 +312,7 @@ class SimpleStorageServiceFileReadTestWMS : public wrench::ExecutionController { public: SimpleStorageServiceFileReadTestWMS(SimpleStorageServicePerformanceTest *test, std::shared_ptr file_registry_service, - const std::string& hostname, sg_size_t buffer_size) : wrench::ExecutionController(hostname, "test"), test(test), file_registry_service(file_registry_service), buffer_size(buffer_size) { + const std::string& hostname, sg_size_t buffer_size) : wrench::ExecutionController(hostname, "test"), test(test), file_registry_service(std::move(std::move(file_registry_service))), buffer_size(buffer_size) { } private: diff --git a/test/simulation/simulation_output/SimulationTimestampFileReadTest.cpp b/test/simulation/simulation_output/SimulationTimestampFileReadTest.cpp index bdc812dd00..d18de1cbad 100755 --- a/test/simulation/simulation_output/SimulationTimestampFileReadTest.cpp +++ b/test/simulation/simulation_output/SimulationTimestampFileReadTest.cpp @@ -73,11 +73,11 @@ class SimulationTimestampFileReadTest : public ::testing::Test { workflow = wrench::Workflow::createWorkflow(); - file_1 = wrench::Simulation::addFile("file_1", 100.0); - file_2 = wrench::Simulation::addFile("file_2", 100.0); - file_3 = wrench::Simulation::addFile("file_3", 100.0); + file_1 = wrench::Simulation::addFile("file_1", 100); + file_2 = wrench::Simulation::addFile("file_2", 100); + file_3 = wrench::Simulation::addFile("file_3", 100); - xl_file = wrench::Simulation::addFile("xl_file", 1000000000.0); + xl_file = wrench::Simulation::addFile("xl_file", 1000000000); } std::string platform_file_path = UNIQUE_TMP_PATH_PREFIX + "platform.xml"; @@ -165,7 +165,6 @@ void SimulationTimestampFileReadTest::do_SimulationTimestampFileReadBasic_test() ASSERT_NO_THROW(storage_service = simulation->add(wrench::SimpleStorageService::createSimpleStorageService(host1, {"/"}, {{wrench::SimpleStorageServiceProperty::BUFFER_SIZE, "infinity"}}))); - std::shared_ptr file_registry_service = nullptr; ASSERT_NO_THROW(file_registry_service = simulation->add(new wrench::FileRegistryService(host1))); std::shared_ptr wms = nullptr;