Skip to content

Commit

Permalink
double removal
Browse files Browse the repository at this point in the history
  • Loading branch information
henricasanova committed Oct 16, 2024
1 parent a509b25 commit f3cf3cf
Showing 1 changed file with 17 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
WRENCH_LOG_CATEGORY(simple_storage_service_performance_test, "Log category for SimpleStorageServicePerformanceTest");


#define FILE_SIZE (10 * 1000 * 1000 * 1000)// 10 GB
#define MBPS_BANDWIDTH 100 // 100 MB
#define STORAGE_SIZE (100 * FILE_SIZE)
#define FILE_SIZE (10ULL * 1000ULL * 1000ULL * 1000ULL)// 10 GB
#define MBPS_BANDWIDTH 100.0 // 100 MB
#define STORAGE_SIZE (100ULL * FILE_SIZE)

class SimpleStorageServicePerformanceTest : public ::testing::Test {

Expand All @@ -35,11 +35,11 @@ class SimpleStorageServicePerformanceTest : public ::testing::Test {

std::shared_ptr<wrench::ComputeService> compute_service = nullptr;

void do_FileRead_test(double buffer_size);
void do_ConcurrentFileCopies_test(double buffer_size);
void do_FileRead_test(sg_size_t buffer_size);
void do_ConcurrentFileCopies_test(sg_size_t buffer_size);

static double computeExpectedTwoStagePipelineTime(double bw_stage1, double bw_stage2, double total_size,
double buffer_size) {
static double computeExpectedTwoStagePipelineTime(double bw_stage1, double bw_stage2, 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);
Expand All @@ -54,7 +54,7 @@ class SimpleStorageServicePerformanceTest : public ::testing::Test {
}

static double computeExpectedThreeStagePipelineTime(double bw_stage1, double bw_stage2, double bw_stage3,
double total_size, double buffer_size) {
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);
Expand Down Expand Up @@ -152,13 +152,13 @@ class SimpleStorageServiceConcurrentFileCopiesTestWMS : public wrench::Execution
public:
SimpleStorageServiceConcurrentFileCopiesTestWMS(SimpleStorageServicePerformanceTest *test,
std::string hostname,
double buffer_size) : wrench::ExecutionController(hostname, "test"), test(test), buffer_size(buffer_size) {
sg_size_t buffer_size) : wrench::ExecutionController(hostname, "test"), test(test), buffer_size(buffer_size) {
}

private:
SimpleStorageServicePerformanceTest *test;
std::shared_ptr<wrench::FileRegistryService> file_registry_service;
double buffer_size;
sg_size_t buffer_size;

int main() override {

Expand Down Expand Up @@ -242,7 +242,7 @@ class SimpleStorageServiceConcurrentFileCopiesTestWMS : public wrench::Execution
};

TEST_F(SimpleStorageServicePerformanceTest, ConcurrentFileCopies) {
DO_TEST_WITH_FORK_ONE_ARG(do_ConcurrentFileCopies_test, DBL_MAX)
DO_TEST_WITH_FORK_ONE_ARG(do_ConcurrentFileCopies_test, LONG_LONG_MAX)
DO_TEST_WITH_FORK_ONE_ARG(do_ConcurrentFileCopies_test, FILE_SIZE / 2);
DO_TEST_WITH_FORK_ONE_ARG(do_ConcurrentFileCopies_test, FILE_SIZE / 10);
DO_TEST_WITH_FORK_ONE_ARG(do_ConcurrentFileCopies_test, FILE_SIZE / 10 + FILE_SIZE / 3);
Expand All @@ -251,7 +251,7 @@ TEST_F(SimpleStorageServicePerformanceTest, ConcurrentFileCopies) {
DO_TEST_WITH_FORK_ONE_ARG(do_ConcurrentFileCopies_test, FILE_SIZE / 100);
}

void SimpleStorageServicePerformanceTest::do_ConcurrentFileCopies_test(double buffer_size) {
void SimpleStorageServicePerformanceTest::do_ConcurrentFileCopies_test(sg_size_t buffer_size) {

// Create and initialize a simulation
auto simulation = wrench::Simulation::createSimulation();
Expand Down Expand Up @@ -310,13 +310,13 @@ class SimpleStorageServiceFileReadTestWMS : public wrench::ExecutionController {
public:
SimpleStorageServiceFileReadTestWMS(SimpleStorageServicePerformanceTest *test,
std::shared_ptr<wrench::FileRegistryService> file_registry_service,
std::string hostname, double 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(file_registry_service), buffer_size(buffer_size) {
}

private:
SimpleStorageServicePerformanceTest *test;
std::shared_ptr<wrench::FileRegistryService> file_registry_service;
double buffer_size;
sg_size_t buffer_size;

int main() override {

Expand All @@ -343,15 +343,15 @@ class SimpleStorageServiceFileReadTestWMS : public wrench::ExecutionController {
throw std::runtime_error("Incorrect file read time " + std::to_string(elapsed) +
" (expected: " + std::to_string(expected_elapsed) +
"; buffer size = " +
(buffer_size == DBL_MAX ? "infty" : std::to_string(buffer_size)) + ")");
(buffer_size == LONG_LONG_MAX ? "infty" : std::to_string(buffer_size)) + ")");
}

return 0;
}
};

TEST_F(SimpleStorageServicePerformanceTest, FileRead) {
DO_TEST_WITH_FORK_ONE_ARG(do_FileRead_test, DBL_MAX);
DO_TEST_WITH_FORK_ONE_ARG(do_FileRead_test, LONG_LONG_MAX);
DO_TEST_WITH_FORK_ONE_ARG(do_FileRead_test, FILE_SIZE / 2);
DO_TEST_WITH_FORK_ONE_ARG(do_FileRead_test, FILE_SIZE / 10);
DO_TEST_WITH_FORK_ONE_ARG(do_FileRead_test, FILE_SIZE / 10 + FILE_SIZE / 3);
Expand All @@ -362,7 +362,7 @@ TEST_F(SimpleStorageServicePerformanceTest, FileRead) {
}


void SimpleStorageServicePerformanceTest::do_FileRead_test(double buffer_size) {
void SimpleStorageServicePerformanceTest::do_FileRead_test(sg_size_t buffer_size) {

// Create and initialize a simulation
auto simulation = wrench::Simulation::createSimulation();
Expand Down

0 comments on commit f3cf3cf

Please sign in to comment.