From 4d55471d7faa98151c1e8e5a29cad40ee00934b2 Mon Sep 17 00:00:00 2001 From: Henri Casanova Date: Wed, 16 Oct 2024 23:12:00 -1000 Subject: [PATCH] debugging output-- --- .../action_execution_service/ActionExecutionService.h | 2 +- .../services/storage/compound/CompoundStorageService.h | 6 +++--- .../services/storage/compound/CompoundStorageService.cpp | 8 ++++---- .../storage/storage_helper_classes/FileTransferThread.cpp | 1 - .../link_failures/StorageServiceLinkFailuresTest.cpp | 3 --- 5 files changed, 8 insertions(+), 12 deletions(-) diff --git a/include/wrench/services/helper_services/action_execution_service/ActionExecutionService.h b/include/wrench/services/helper_services/action_execution_service/ActionExecutionService.h index 8b8c418030..353f84e910 100644 --- a/include/wrench/services/helper_services/action_execution_service/ActionExecutionService.h +++ b/include/wrench/services/helper_services/action_execution_service/ActionExecutionService.h @@ -96,7 +96,7 @@ namespace wrench { std::map> compute_resources; - // Core availabilities (for each hosts, how many cores and how many bytes of RAM are currently available on it) + // Core availabilities (for each host, how many cores and how many bytes of RAM are currently available on it) std::unordered_map ram_availabilities; std::unordered_map running_thread_counts; diff --git a/include/wrench/services/storage/compound/CompoundStorageService.h b/include/wrench/services/storage/compound/CompoundStorageService.h index 2e28f57f16..039353bf6d 100644 --- a/include/wrench/services/storage/compound/CompoundStorageService.h +++ b/include/wrench/services/storage/compound/CompoundStorageService.h @@ -202,9 +202,9 @@ namespace wrench { std::vector> lookupFileLocation(const std::shared_ptr &file, S4U_CommPort *answer_commport); - std::vector> lookupOrDesignateStorageService(const std::shared_ptr location); + std::vector> lookupOrDesignateStorageService(const std::shared_ptr& location); - std::vector> lookupOrDesignateStorageService(const std::shared_ptr location, unsigned int stripe_count); + std::vector> lookupOrDesignateStorageService(const std::shared_ptr& location, unsigned int stripe_count); bool hasFile(const std::shared_ptr &location) override; @@ -298,7 +298,7 @@ namespace wrench { int main() override; - std::vector> lookupOrDesignateStorageService(const std::shared_ptr concrete_file_location, + std::vector> lookupOrDesignateStorageService(const std::shared_ptr& concrete_file_location, unsigned int stripe_count, S4U_CommPort *answer_commport); diff --git a/src/wrench/services/storage/compound/CompoundStorageService.cpp b/src/wrench/services/storage/compound/CompoundStorageService.cpp index 060c913219..cf7b13ecb1 100644 --- a/src/wrench/services/storage/compound/CompoundStorageService.cpp +++ b/src/wrench/services/storage/compound/CompoundStorageService.cpp @@ -69,7 +69,7 @@ namespace wrench { "Must specify at least one valid StorageService"); } - if (std::any_of(storage_services.begin(), storage_services.end(), [](const auto &elem) { return elem == NULL; })) { + if (std::any_of(storage_services.begin(), storage_services.end(), [](const auto &elem) { return elem == nullptr; })) { throw std::invalid_argument("One of the StorageServices provided is not initialized"); } @@ -337,7 +337,7 @@ namespace wrench { * @return A vector of shared_ptr on a FileLocation if the DataFile is known to the CompoundStorageService or could be allocated * or empty vector if it's not / could not be allocated. */ - std::vector> CompoundStorageService::lookupOrDesignateStorageService(const std::shared_ptr file, unsigned int stripe_count, S4U_CommPort *answer_commport) { + std::vector> CompoundStorageService::lookupOrDesignateStorageService(const std::shared_ptr& file, unsigned int stripe_count, S4U_CommPort *answer_commport) { WRENCH_INFO("CSS::lookupOrDesignateStorageService() - DataFile + commport"); this->commport->putMessage(new CompoundStorageAllocationRequestMessage( @@ -361,7 +361,7 @@ namespace wrench { * @return A shared_ptr on a FileLocation if the DataFile is known to the CompoundStorageService or could be allocated * or nullptr if it's not. */ - std::vector> CompoundStorageService::lookupOrDesignateStorageService(const std::shared_ptr location) { + std::vector> CompoundStorageService::lookupOrDesignateStorageService(const std::shared_ptr& location) { auto temp_commport = S4U_CommPort::getTemporaryCommPort(); @@ -383,7 +383,7 @@ namespace wrench { * @return A shared_ptr on a FileLocation if the DataFile is known to the CompoundStorageService or could be allocated * or nullptr if it's not. */ - std::vector> CompoundStorageService::lookupOrDesignateStorageService(const std::shared_ptr location, unsigned int stripe_count) { + std::vector> CompoundStorageService::lookupOrDesignateStorageService(const std::shared_ptr& location, unsigned int stripe_count) { auto temp_commport = S4U_CommPort::getTemporaryCommPort(); diff --git a/src/wrench/services/storage/storage_helper_classes/FileTransferThread.cpp b/src/wrench/services/storage/storage_helper_classes/FileTransferThread.cpp index 9e99249e52..8bd2ea8bb1 100644 --- a/src/wrench/services/storage/storage_helper_classes/FileTransferThread.cpp +++ b/src/wrench/services/storage/storage_helper_classes/FileTransferThread.cpp @@ -13,7 +13,6 @@ #include "wrench/services/storage/storage_helpers/FileTransferThreadMessage.h" #include -#include #include #include //#include diff --git a/test/simulated_failures/link_failures/StorageServiceLinkFailuresTest.cpp b/test/simulated_failures/link_failures/StorageServiceLinkFailuresTest.cpp index 21eff16605..a7097db014 100644 --- a/test/simulated_failures/link_failures/StorageServiceLinkFailuresTest.cpp +++ b/test/simulated_failures/link_failures/StorageServiceLinkFailuresTest.cpp @@ -116,15 +116,12 @@ class StorageServiceLinkFailuresTestWMS : public wrench::ExecutionController { std::shared_ptr findRandomFileOnStorageService(const std::shared_ptr& ss) { std::uniform_int_distribution dist_files(0, this->test->files.size() - 1); - std::cerr << "IN FINDING RANDOM FILE!\n"; for (int trial = 0; trial < NUM_FILES; trial++) { auto potential_file = this->test->files.at(dist_files(rng)); if (wrench::StorageService::lookupFileAtLocation(wrench::FileLocation::LOCATION(ss, potential_file))) { - std::cerr << "FOUND ONE!!\n"; return potential_file; } } - std::cerr << "DIDN'T FIND ONE!!\n"; return nullptr; }