From 3de179c2e70561e5f788b97783620f751a45b344 Mon Sep 17 00:00:00 2001 From: Henri Casanova Date: Wed, 16 Oct 2024 08:18:48 -1000 Subject: [PATCH] more double removals --- .../wrench/services/storage/StorageService.h | 12 ++++++------ .../services/storage/StorageServiceMessage.h | 12 ++++++------ .../storage/compound/CompoundStorageService.h | 10 +++++----- .../compound/CompoundStorageServiceMessage.h | 10 +++++----- .../storage/proxy/StorageServiceProxy.h | 6 +++--- .../storage/simple/SimpleStorageService.h | 8 ++++---- .../simple/SimpleStorageServiceBufferized.h | 2 +- .../simple/SimpleStorageServiceNonBufferized.h | 4 ++-- .../FileTransferThreadMessage.h | 2 +- include/wrench/services/storage/xrootd/Node.h | 4 ++-- src/wrench/services/storage/StorageService.cpp | 4 ++-- .../services/storage/StorageServiceMessage.cpp | 10 +++++----- .../compound/CompoundStorageService.cpp | 8 ++++---- .../compound/CompoundStorageServiceMessage.cpp | 10 +++++----- .../storage/proxy/StorageServiceProxy.cpp | 6 +++--- .../storage/simple/SimpleStorageService.cpp | 18 +++++++++--------- .../simple/SimpleStorageServiceBufferized.cpp | 6 +++--- src/wrench/services/storage/xrootd/Node.cpp | 4 ++-- src/wrench/simgrid_S4U_util/S4U_Simulation.cpp | 7 ++++--- src/wrench/util/UnitParser.cpp | 4 +++- .../SimulationTimestampFileCopyTest.cpp | 2 +- 21 files changed, 76 insertions(+), 73 deletions(-) diff --git a/include/wrench/services/storage/StorageService.h b/include/wrench/services/storage/StorageService.h index 82580bcca4..d3eb59b34e 100755 --- a/include/wrench/services/storage/StorageService.h +++ b/include/wrench/services/storage/StorageService.h @@ -407,14 +407,14 @@ namespace wrench { * @brief Get the storage service's total space (in zero simulated time) * @return a capacity in bytes */ - virtual double getTotalSpace() = 0; + virtual sg_size_t getTotalSpace() = 0; /** Service free space method */ /** * @brief Get the storage service's total free space (incurs simulated overhead) * @return a capacity in bytes */ - virtual double getTotalFreeSpace(); + virtual sg_size_t getTotalFreeSpace(); /** Service free space method */ /** @@ -422,7 +422,7 @@ namespace wrench { * @brief path a path * @return a capacity in bytes */ - virtual double getTotalFreeSpaceAtPath(const std::string &path); + virtual sg_size_t getTotalFreeSpaceAtPath(const std::string &path); /** Service free space tracing (doesn't incur simulated overhead) */ /** @@ -430,7 +430,7 @@ namespace wrench { * @return Current free space in bytes * */ - virtual double getTotalFreeSpaceZeroTime() { + virtual sg_size_t getTotalFreeSpaceZeroTime() { throw std::runtime_error("StorageService::traceTotalFreeSpace: should have been overridden by derived class"); } @@ -440,7 +440,7 @@ namespace wrench { * @return Current number of registered Datafile for all filesystem(s) from this service * */ - virtual double getTotalFilesZeroTime() { + virtual unsigned long getTotalFilesZeroTime() { throw std::runtime_error("StorageService::traceTotalFiles: should have been overridden by derived class"); } @@ -483,7 +483,7 @@ namespace wrench { * @brief Determine the storage service's buffer size * @return a size in bytes */ - virtual double getBufferSize() const = 0; + virtual sg_size_t getBufferSize() const = 0; /** * @brief Determines whether the storage service is a scratch service of a ComputeService diff --git a/include/wrench/services/storage/StorageServiceMessage.h b/include/wrench/services/storage/StorageServiceMessage.h index 6029d7643d..12adcc9828 100755 --- a/include/wrench/services/storage/StorageServiceMessage.h +++ b/include/wrench/services/storage/StorageServiceMessage.h @@ -193,9 +193,9 @@ namespace wrench { StorageServiceFileWriteAnswerMessage(std::shared_ptr &location, bool success, std::shared_ptr failure_cause, - std::map data_write_commport_and_bytes, + std::map data_write_commport_and_bytes, sg_size_t buffer_size, - double payload); + sg_size_t payload); /** @brief The file location hould be written */ std::shared_ptr location; @@ -204,7 +204,7 @@ namespace wrench { /** @brief The cause of the failure, if any, or nullptr */ std::shared_ptr failure_cause; /** @brief The set of destination commports and the number of bytes to send to each */ - std::map data_write_commport_and_bytes; + std::map data_write_commport_and_bytes; /** @brief The buffer size to use */ sg_size_t buffer_size; }; @@ -218,7 +218,7 @@ namespace wrench { simgrid::s4u::Host *requesting_host, std::shared_ptr location, sg_size_t num_bytes_to_read, - double payload); + sg_size_t payload); StorageServiceFileReadRequestMessage(StorageServiceFileReadRequestMessage &other); StorageServiceFileReadRequestMessage(StorageServiceFileReadRequestMessage *other); /** @brief The commport_name to which the answer message should be sent */ @@ -242,7 +242,7 @@ namespace wrench { S4U_CommPort *commport_to_receive_the_file_content, sg_size_t buffer_size, unsigned long number_of_sources, - double payload); + sg_size_t payload); /** @brief The location of the file */ std::shared_ptr location; @@ -264,7 +264,7 @@ namespace wrench { class StorageServiceFileContentChunkMessage : public StorageServiceMessage { public: explicit StorageServiceFileContentChunkMessage(std::shared_ptr file, - double chunk_size, bool last_chunk); + sg_size_t chunk_size, bool last_chunk); /** @brief The file */ std::shared_ptr file; diff --git a/include/wrench/services/storage/compound/CompoundStorageService.h b/include/wrench/services/storage/compound/CompoundStorageService.h index 88e7c1edca..2e28f57f16 100644 --- a/include/wrench/services/storage/compound/CompoundStorageService.h +++ b/include/wrench/services/storage/compound/CompoundStorageService.h @@ -60,7 +60,7 @@ namespace wrench { /** @brief Storage service */ std::shared_ptr service; /** @brief Free space in byte */ - double free_space; + sg_size_t free_space; /** @brief the file count */ uint64_t file_count; }; @@ -128,10 +128,10 @@ namespace wrench { double getLoad() override; // Overload StorageService's implementation. - double getTotalSpace() override; + sg_size_t getTotalSpace() override; // Overload StorageService's implementation. - double getTotalFreeSpaceAtPath(const std::string &path) override; + sg_size_t getTotalFreeSpaceAtPath(const std::string &path) override; // Overload StorageService's implementation. void setIsScratch(bool is_scratch) override; @@ -148,7 +148,7 @@ namespace wrench { * @brief Determine the storage service's buffer size * @return a size in bytes */ - double getBufferSize() const override { + sg_size_t getBufferSize() const override { return 0; } @@ -324,7 +324,7 @@ namespace wrench { * Should usually be user-provided, or will be * set to the smallest disk size as default. */ - double max_chunk_size = 0; + sg_size_t max_chunk_size = 0; /** * @brief Whether to strip a file in the CSS or in the external allocation function. diff --git a/include/wrench/services/storage/compound/CompoundStorageServiceMessage.h b/include/wrench/services/storage/compound/CompoundStorageServiceMessage.h index 3f30bc3ed8..6e543ba688 100644 --- a/include/wrench/services/storage/compound/CompoundStorageServiceMessage.h +++ b/include/wrench/services/storage/compound/CompoundStorageServiceMessage.h @@ -27,7 +27,7 @@ namespace wrench { */ class CompoundStorageServiceMessage : public StorageServiceMessage { protected: - CompoundStorageServiceMessage(double payload); + CompoundStorageServiceMessage(sg_size_t payload); }; /** @@ -38,7 +38,7 @@ namespace wrench { CompoundStorageAllocationRequestMessage(S4U_CommPort *answer_commport, std::shared_ptr file, unsigned int stripe_count, - double payload); + sg_size_t payload); /** @brief CommPort to which the answer message should be sent */ S4U_CommPort *answer_commport; @@ -53,7 +53,7 @@ namespace wrench { */ class CompoundStorageAllocationAnswerMessage : public CompoundStorageServiceMessage { public: - CompoundStorageAllocationAnswerMessage(std::vector> locations, double payload); + CompoundStorageAllocationAnswerMessage(std::vector> locations, sg_size_t payload); /** @brief Known or newly allocated FileLocations for requested file */ std::vector> locations; @@ -64,7 +64,7 @@ namespace wrench { */ class CompoundStorageLookupRequestMessage : public CompoundStorageServiceMessage { public: - CompoundStorageLookupRequestMessage(S4U_CommPort *answer_commport, std::shared_ptr file, double payload); + CompoundStorageLookupRequestMessage(S4U_CommPort *answer_commport, std::shared_ptr file, sg_size_t payload); /** @brief CommPort to which the answer message should be sent */ S4U_CommPort *answer_commport; @@ -77,7 +77,7 @@ namespace wrench { */ class CompoundStorageLookupAnswerMessage : public CompoundStorageServiceMessage { public: - CompoundStorageLookupAnswerMessage(std::vector> locations, double payload); + CompoundStorageLookupAnswerMessage(std::vector> locations, sg_size_t payload); /** @brief Known FileLocations for requested file */ std::vector> locations; diff --git a/include/wrench/services/storage/proxy/StorageServiceProxy.h b/include/wrench/services/storage/proxy/StorageServiceProxy.h index 18dd025e43..e045daf905 100755 --- a/include/wrench/services/storage/proxy/StorageServiceProxy.h +++ b/include/wrench/services/storage/proxy/StorageServiceProxy.h @@ -34,8 +34,8 @@ namespace wrench { using StorageService::writeFile; - double getTotalSpace() override; - double getTotalFreeSpaceAtPath(const std::string &path) override; + sg_size_t getTotalSpace() override; + sg_size_t getTotalFreeSpaceAtPath(const std::string &path) override; /** * @brief Return the storage service's default mountpoint, if any. @@ -84,7 +84,7 @@ namespace wrench { bool isBufferized() const override;//cache - double getBufferSize() const override;//cache + sg_size_t getBufferSize() const override;//cache bool hasFile(const std::shared_ptr &location) override; diff --git a/include/wrench/services/storage/simple/SimpleStorageService.h b/include/wrench/services/storage/simple/SimpleStorageService.h index 5b05189cba..f3169736bd 100755 --- a/include/wrench/services/storage/simple/SimpleStorageService.h +++ b/include/wrench/services/storage/simple/SimpleStorageService.h @@ -102,11 +102,11 @@ namespace wrench { bool hasMultipleMountPoints(); bool hasMountPoint(const std::string &mp); - double getTotalSpace() override; + sg_size_t getTotalSpace() override; - double getTotalFreeSpaceZeroTime() override; + sg_size_t getTotalFreeSpaceZeroTime() override; - double getTotalFilesZeroTime() override; + unsigned long getTotalFilesZeroTime() override; std::string getBaseRootPath() override; @@ -192,7 +192,7 @@ namespace wrench { * @brief Determine the storage service's buffer size * @return a size in bytes */ - double getBufferSize() const override { + sg_size_t getBufferSize() const override { return this->buffer_size; } diff --git a/include/wrench/services/storage/simple/SimpleStorageServiceBufferized.h b/include/wrench/services/storage/simple/SimpleStorageServiceBufferized.h index cec69fceed..ab839cc435 100755 --- a/include/wrench/services/storage/simple/SimpleStorageServiceBufferized.h +++ b/include/wrench/services/storage/simple/SimpleStorageServiceBufferized.h @@ -65,7 +65,7 @@ namespace wrench { /** \cond INTERNAL **/ /***********************/ void cleanup(bool has_returned_from_main, int return_value) override; - double countRunningFileTransferThreads(); + unsigned long countRunningFileTransferThreads(); /***********************/ /** \endcond **/ diff --git a/include/wrench/services/storage/simple/SimpleStorageServiceNonBufferized.h b/include/wrench/services/storage/simple/SimpleStorageServiceNonBufferized.h index afea006fb9..ce857b538d 100644 --- a/include/wrench/services/storage/simple/SimpleStorageServiceNonBufferized.h +++ b/include/wrench/services/storage/simple/SimpleStorageServiceNonBufferized.h @@ -60,7 +60,7 @@ namespace wrench { /** @brief commport_name to report to */ S4U_CommPort *commport; /** @brief transfer size */ - double transfer_size; + sg_size_t transfer_size; /** @brief SG IO op */ simgrid::s4u::IoPtr stream; @@ -89,7 +89,7 @@ namespace wrench { simgrid::s4u::Host *dst_host, simgrid::s4u::Disk *dst_disk, S4U_CommPort *commport, - double transfer_size) : src_location(std::move(src_location)), src_opened_file(std::move(src_opened_file)), + sg_size_t transfer_size) : src_location(std::move(src_location)), src_opened_file(std::move(src_opened_file)), src_host(src_host), src_disk(src_disk), dst_location(std::move(dst_location)), dst_opened_file(std::move(dst_opened_file)), dst_host(dst_host), dst_disk(dst_disk), diff --git a/include/wrench/services/storage/storage_helpers/FileTransferThreadMessage.h b/include/wrench/services/storage/storage_helpers/FileTransferThreadMessage.h index a98c3cc973..795cb3e45b 100755 --- a/include/wrench/services/storage/storage_helpers/FileTransferThreadMessage.h +++ b/include/wrench/services/storage/storage_helpers/FileTransferThreadMessage.h @@ -35,7 +35,7 @@ namespace wrench { * @brief Constructor * @param payload: the message payload */ - FileTransferThreadMessage(double payload) : ServiceMessage(payload) {} + FileTransferThreadMessage(sg_size_t payload) : ServiceMessage(payload) {} }; diff --git a/include/wrench/services/storage/xrootd/Node.h b/include/wrench/services/storage/xrootd/Node.h index 1cd724d8fa..741ae05e5d 100755 --- a/include/wrench/services/storage/xrootd/Node.h +++ b/include/wrench/services/storage/xrootd/Node.h @@ -60,9 +60,9 @@ namespace wrench { virtual double getFileLastWriteDate(const std::shared_ptr &location) override; - virtual double getTotalSpace() override; + virtual sg_size_t getTotalSpace() override; virtual bool isBufferized() const override; - virtual double getBufferSize() const override; + virtual sg_size_t getBufferSize() const override; virtual bool reserveSpace(std::shared_ptr &location) override; virtual void unreserveSpace(std::shared_ptr &location) override; diff --git a/src/wrench/services/storage/StorageService.cpp b/src/wrench/services/storage/StorageService.cpp index cf8649c5d8..e378f9697a 100755 --- a/src/wrench/services/storage/StorageService.cpp +++ b/src/wrench/services/storage/StorageService.cpp @@ -171,7 +171,7 @@ namespace wrench { * @return A number of bytes * */ - double StorageService::getTotalFreeSpace() { + sg_size_t StorageService::getTotalFreeSpace() { return getTotalFreeSpaceAtPath(""); } @@ -184,7 +184,7 @@ namespace wrench { * * @return A number of bytes (or 0 if the path is invalid) */ - double StorageService::getTotalFreeSpaceAtPath(const std::string &path) { + sg_size_t StorageService::getTotalFreeSpaceAtPath(const std::string &path) { assertServiceIsUp(); // Send a message to the daemon diff --git a/src/wrench/services/storage/StorageServiceMessage.cpp b/src/wrench/services/storage/StorageServiceMessage.cpp index a9c89f67bb..cd50157202 100644 --- a/src/wrench/services/storage/StorageServiceMessage.cpp +++ b/src/wrench/services/storage/StorageServiceMessage.cpp @@ -248,9 +248,9 @@ namespace wrench { StorageServiceFileWriteAnswerMessage::StorageServiceFileWriteAnswerMessage(std::shared_ptr &location, bool success, std::shared_ptr failure_cause, - std::map data_write_commports_and_bytes, + std::map data_write_commports_and_bytes, sg_size_t buffer_size, - double payload) : StorageServiceMessage(payload) { + sg_size_t payload) : StorageServiceMessage(payload) { #ifdef WRENCH_INTERNAL_EXCEPTIONS if ((location == nullptr) || (success && (data_write_commport == nullptr)) || @@ -281,7 +281,7 @@ namespace wrench { simgrid::s4u::Host *requesting_host, std::shared_ptr location, sg_size_t num_bytes_to_read, - double payload) : StorageServiceMessage(payload) { + sg_size_t payload) : StorageServiceMessage(payload) { #ifdef WRENCH_INTERNAL_EXCEPTIONS @@ -330,7 +330,7 @@ namespace wrench { S4U_CommPort *commport_to_receive_the_file_content, sg_size_t buffer_size, unsigned long number_of_sources, - double payload) : StorageServiceMessage(payload) { + sg_size_t payload) : StorageServiceMessage(payload) { #ifdef WRENCH_INTERNAL_EXCEPTIONS if ((location == nullptr) || (success && (failure_cause != nullptr)) || (!success && (failure_cause == nullptr))) { @@ -354,7 +354,7 @@ namespace wrench { * @param last_chunk: whether this is the last chunk in the file */ StorageServiceFileContentChunkMessage::StorageServiceFileContentChunkMessage( - std::shared_ptr file, double chunk_size, bool last_chunk) : StorageServiceMessage(chunk_size) { + std::shared_ptr file, sg_size_t chunk_size, bool last_chunk) : StorageServiceMessage(chunk_size) { #ifdef WRENCH_INTERNAL_EXCEPTIONS if (file == nullptr) { throw std::invalid_argument( diff --git a/src/wrench/services/storage/compound/CompoundStorageService.cpp b/src/wrench/services/storage/compound/CompoundStorageService.cpp index 71e74ecf2e..b8b06c34d5 100644 --- a/src/wrench/services/storage/compound/CompoundStorageService.cpp +++ b/src/wrench/services/storage/compound/CompoundStorageService.cpp @@ -958,7 +958,7 @@ namespace wrench { // this->traceInternalStorageUse(IOAction::WriteEnd, designated_locations_subset); for (const auto &loc: designated_locations_subset) { - WRENCH_DEBUG("CSS::writeFile(): For location %s, free space = %f", loc->getStorageService()->getName().c_str(), loc->getStorageService()->getTotalFreeSpace()); + WRENCH_DEBUG("CSS::writeFile(): For location %s, free space = %llu", loc->getStorageService()->getName().c_str(), loc->getStorageService()->getTotalFreeSpace()); } WRENCH_INFO("CSS::writeFile(): All writes done and ack"); @@ -1125,9 +1125,9 @@ namespace wrench { * * @return A number of bytes */ - double CompoundStorageService::getTotalSpace() { + sg_size_t CompoundStorageService::getTotalSpace() { // WRENCH_INFO("CompoundStorageService::getTotalSpace"); - double free_space = 0.0; + sg_size_t free_space = 0.0; for (const auto &storage_server: this->storage_services) { for (const auto &service: storage_server.second) { free_space += service->getTotalSpace(); @@ -1145,7 +1145,7 @@ namespace wrench { * @return The free space in bytes at the path * */ - double CompoundStorageService::getTotalFreeSpaceAtPath(const std::string &path) { + sg_size_t CompoundStorageService::getTotalFreeSpaceAtPath(const std::string &path) { WRENCH_DEBUG("CSS::getFreeSpace Forwarding request to internal services"); double free_space = 0.0; diff --git a/src/wrench/services/storage/compound/CompoundStorageServiceMessage.cpp b/src/wrench/services/storage/compound/CompoundStorageServiceMessage.cpp index 5808a64b2e..aa7b92d065 100644 --- a/src/wrench/services/storage/compound/CompoundStorageServiceMessage.cpp +++ b/src/wrench/services/storage/compound/CompoundStorageServiceMessage.cpp @@ -17,7 +17,7 @@ namespace wrench { * @brief Constructor * @param payload: the message size in bytes */ - CompoundStorageServiceMessage::CompoundStorageServiceMessage(double payload) : StorageServiceMessage(payload) {} + CompoundStorageServiceMessage::CompoundStorageServiceMessage(sg_size_t payload) : StorageServiceMessage(payload) {} /** * @brief Constructor @@ -30,7 +30,7 @@ namespace wrench { CompoundStorageAllocationRequestMessage::CompoundStorageAllocationRequestMessage(S4U_CommPort *answer_commport, std::shared_ptr file, unsigned int stripe_count, - double payload) + sg_size_t payload) : CompoundStorageServiceMessage(payload) { #ifdef WRENCH_INTERNAL_EXCEPTIONS if (answer_commport == nullptr) { @@ -50,7 +50,7 @@ namespace wrench { * */ CompoundStorageAllocationAnswerMessage::CompoundStorageAllocationAnswerMessage( - std::vector> locations, double payload) + std::vector> locations, sg_size_t payload) : CompoundStorageServiceMessage(payload) { this->locations = std::move(locations); } @@ -63,7 +63,7 @@ namespace wrench { * */ CompoundStorageLookupRequestMessage::CompoundStorageLookupRequestMessage(S4U_CommPort *answer_commport, - std::shared_ptr file, double payload) + std::shared_ptr file, sg_size_t payload) : CompoundStorageServiceMessage(payload) { #ifdef WRENCH_INTERNAL_EXCEPTIONS if (answer_commport == nullptr) { @@ -82,7 +82,7 @@ namespace wrench { * */ CompoundStorageLookupAnswerMessage::CompoundStorageLookupAnswerMessage( - std::vector> locations, double payload) + std::vector> locations, sg_size_t payload) : CompoundStorageServiceMessage(payload) { this->locations = std::move(locations); } diff --git a/src/wrench/services/storage/proxy/StorageServiceProxy.cpp b/src/wrench/services/storage/proxy/StorageServiceProxy.cpp index c8ed7ee429..8c5cc84af9 100644 --- a/src/wrench/services/storage/proxy/StorageServiceProxy.cpp +++ b/src/wrench/services/storage/proxy/StorageServiceProxy.cpp @@ -268,7 +268,7 @@ namespace wrench { * @return The free space in bytes of each mount point, as a map * */ - double StorageServiceProxy::getTotalFreeSpaceAtPath(const std::string &path) { + sg_size_t StorageServiceProxy::getTotalFreeSpaceAtPath(const std::string &path) { if (remote) { return remote->getTotalFreeSpaceAtPath(path); } @@ -281,7 +281,7 @@ namespace wrench { * @return The free space in bytes of each mount point, as a map * */ - double StorageServiceProxy::getTotalSpace() { + sg_size_t StorageServiceProxy::getTotalSpace() { if (remote) { return remote->getTotalSpace(); } @@ -312,7 +312,7 @@ namespace wrench { * @brief Get the buffer size of the cache (which could be 0 or >0), or 0 if there is no cache * @return a size in bytes */ - double StorageServiceProxy::getBufferSize() const { + sg_size_t StorageServiceProxy::getBufferSize() const { if (cache) { return cache->getBufferSize(); } else { diff --git a/src/wrench/services/storage/simple/SimpleStorageService.cpp b/src/wrench/services/storage/simple/SimpleStorageService.cpp index 07d0b55c2b..264636ef9f 100644 --- a/src/wrench/services/storage/simple/SimpleStorageService.cpp +++ b/src/wrench/services/storage/simple/SimpleStorageService.cpp @@ -206,11 +206,11 @@ namespace wrench { * @brief Get the total static capacity of the storage service (in zero simulation time) * @return capacity of the storage service in bytes */ - double SimpleStorageService::getTotalSpace() { - double capacity = 0.0; + sg_size_t SimpleStorageService::getTotalSpace() { + sg_size_t capacity = 0; auto partitions = this->file_system->get_partitions(); for (auto const &p: partitions) { - capacity += (double)p->get_size(); + capacity += p->get_size(); } return capacity; } @@ -220,11 +220,11 @@ namespace wrench { * for IO tracing purpose. * @return total free space in bytes */ - double SimpleStorageService::getTotalFreeSpaceZeroTime() { - double free_space = 0; + sg_size_t SimpleStorageService::getTotalFreeSpaceZeroTime() { + sg_size_t free_space = 0; auto partitions = this->file_system->get_partitions(); for (auto const &p: partitions) { - free_space += (double)p->get_free_space(); + free_space += p->get_free_space(); } return free_space; } @@ -234,11 +234,11 @@ namespace wrench { * for IO tracing purposes * @return total number of files */ - double SimpleStorageService::getTotalFilesZeroTime() { - double num_files = 0; + unsigned long SimpleStorageService::getTotalFilesZeroTime() { + unsigned long num_files = 0; auto partitions = this->file_system->get_partitions(); for (auto const &p: partitions) { - num_files += (double)p->get_num_files(); + num_files += p->get_num_files(); } return num_files; } diff --git a/src/wrench/services/storage/simple/SimpleStorageServiceBufferized.cpp b/src/wrench/services/storage/simple/SimpleStorageServiceBufferized.cpp index 87b88bc8d0..370b40340f 100644 --- a/src/wrench/services/storage/simple/SimpleStorageServiceBufferized.cpp +++ b/src/wrench/services/storage/simple/SimpleStorageServiceBufferized.cpp @@ -528,8 +528,8 @@ namespace wrench { * @brief Get number of File Transfer Threads that are currently running or are pending * @return The number of threads */ - double SimpleStorageServiceBufferized::countRunningFileTransferThreads() { - return (double) this->running_file_transfer_threads.size() + (double) this->pending_file_transfer_threads.size(); + unsigned long SimpleStorageServiceBufferized::countRunningFileTransferThreads() { + return this->running_file_transfer_threads.size() + this->pending_file_transfer_threads.size(); } /** @@ -537,7 +537,7 @@ namespace wrench { * @return the load on the service */ double SimpleStorageServiceBufferized::getLoad() { - return countRunningFileTransferThreads(); + return (double)countRunningFileTransferThreads(); } diff --git a/src/wrench/services/storage/xrootd/Node.cpp b/src/wrench/services/storage/xrootd/Node.cpp index 8881434977..2c463a909f 100644 --- a/src/wrench/services/storage/xrootd/Node.cpp +++ b/src/wrench/services/storage/xrootd/Node.cpp @@ -1022,7 +1022,7 @@ namespace wrench { * @brief Get the storage service's total space (in zero simulated time) * @return a capacity in bytes */ - double Node::getTotalSpace() { + sg_size_t Node::getTotalSpace() { if (internalStorage) { return internalStorage->getTotalSpace(); } else { @@ -1047,7 +1047,7 @@ namespace wrench { * @brief Determine the storage service's buffer size * @return a size in bytes */ - double Node::getBufferSize() const { + sg_size_t Node::getBufferSize() const { if (internalStorage) { return internalStorage->getBufferSize(); } else { diff --git a/src/wrench/simgrid_S4U_util/S4U_Simulation.cpp b/src/wrench/simgrid_S4U_util/S4U_Simulation.cpp index 3f789eb050..6208dada14 100755 --- a/src/wrench/simgrid_S4U_util/S4U_Simulation.cpp +++ b/src/wrench/simgrid_S4U_util/S4U_Simulation.cpp @@ -10,6 +10,7 @@ #include #include +#include #include #include #include @@ -710,7 +711,7 @@ namespace wrench { * @return a memory_manager_service capacity in bytes */ sg_size_t S4U_Simulation::getHostMemoryCapacity(simgrid::s4u::Host *host) { - static std::map memoized; + static std::map memoized; if (memoized.find(host) != memoized.end()) { return memoized[host]; @@ -1099,7 +1100,7 @@ namespace wrench { continue; } - double capacity; + sg_size_t capacity; const char *capacity_str = d->get_property("size"); if (capacity_str) { @@ -1110,7 +1111,7 @@ namespace wrench { " at host " + hostname + " has invalid size"); } } else { - capacity = DBL_MAX;// Default size if no size property specified + capacity = LONG_LONG_MAX;// Default size if no size property specified } return capacity; diff --git a/src/wrench/util/UnitParser.cpp b/src/wrench/util/UnitParser.cpp index 953ccb1160..6a3beb2486 100755 --- a/src/wrench/util/UnitParser.cpp +++ b/src/wrench/util/UnitParser.cpp @@ -106,7 +106,9 @@ namespace wrench { * */ sg_size_t UnitParser::parse_size(const std::string &string) { - static const UnitParser::unit_scale units{std::make_tuple("B", 1.0, 10, true)}; + static const UnitParser::unit_scale units{std::make_tuple("B", 1.0, 10, true), + std::make_tuple("B", 1.0, 2, true) + }; try { double value = parseValueWithUnit(string, units, "B"); // default: bytes if (value == DBL_MAX) { diff --git a/test/simulation/simulation_output/SimulationTimestampFileCopyTest.cpp b/test/simulation/simulation_output/SimulationTimestampFileCopyTest.cpp index b6f3d9a923..e35f430f6c 100755 --- a/test/simulation/simulation_output/SimulationTimestampFileCopyTest.cpp +++ b/test/simulation/simulation_output/SimulationTimestampFileCopyTest.cpp @@ -71,7 +71,7 @@ class SimulationTimestampFileCopyTest : public ::testing::Test { file_2 = wrench::Simulation::addFile("file_2", 100); file_3 = wrench::Simulation::addFile("file_3", 100); - xl_file = wrench::Simulation::addFile("xl_file", 1000000000); + xl_file = wrench::Simulation::addFile("xl_file", 1000000000ULL); too_large_file = wrench::Simulation::addFile("too_large_file", 10000000000000000000ULL); }