Skip to content

Commit

Permalink
code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
henricasanova committed Oct 16, 2024
1 parent 0c3704d commit c0d48b2
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 17 deletions.
10 changes: 5 additions & 5 deletions include/wrench/services/storage/StorageServiceMessage.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ namespace wrench {
*/
class StorageServiceMessage : public ServiceMessage {
protected:
StorageServiceMessage(sg_size_t payload);
explicit StorageServiceMessage(sg_size_t payload);
};


Expand All @@ -54,10 +54,10 @@ namespace wrench {
*/
class StorageServiceFreeSpaceAnswerMessage : public StorageServiceMessage {
public:
StorageServiceFreeSpaceAnswerMessage(double free_space, sg_size_t payload);
StorageServiceFreeSpaceAnswerMessage(sg_size_t free_space, sg_size_t payload);

/** @brief The amount of free space in bytes */
double free_space;
sg_size_t free_space;
};

/**
Expand Down Expand Up @@ -220,11 +220,11 @@ namespace wrench {
sg_size_t num_bytes_to_read,
sg_size_t payload);
StorageServiceFileReadRequestMessage(StorageServiceFileReadRequestMessage &other);
StorageServiceFileReadRequestMessage(StorageServiceFileReadRequestMessage *other);
explicit StorageServiceFileReadRequestMessage(StorageServiceFileReadRequestMessage *other);
/** @brief The commport_name to which the answer message should be sent */
S4U_CommPort *answer_commport;
/** @brief The requesting host */
simgrid::s4u::Host *requesting_host;
simgrid::s4u::Host *requesting_host = nullptr;
/** @brief The file to read */
std::shared_ptr<FileLocation> location;
/** @brief The number of bytes to read */
Expand Down
5 changes: 1 addition & 4 deletions src/wrench/services/storage/StorageServiceMessage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,7 @@
#include "wrench/services/storage/StorageServiceMessage.h"
#include <wrench/data_file/DataFile.h>
#include <wrench/simulation/SimulationTimestampTypes.h>
#include <wrench/simulation/Simulation.h>
#include <wrench/simulation/SimulationOutput.h>
#include <wrench/services/compute/cloud/CloudComputeService.h>
#include <wrench/services/compute/virtualized_cluster/VirtualizedClusterComputeService.h>
#include <wrench/services/storage/StorageService.h>

#include <utility>
Expand Down Expand Up @@ -60,7 +57,7 @@ namespace wrench {
*
*/
StorageServiceFreeSpaceAnswerMessage::StorageServiceFreeSpaceAnswerMessage(
double free_space, sg_size_t payload)
sg_size_t free_space, sg_size_t payload)
: StorageServiceMessage(payload) {
this->free_space = free_space;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1148,7 +1148,7 @@ namespace wrench {
sg_size_t CompoundStorageService::getTotalFreeSpaceAtPath(const std::string &path) {
WRENCH_DEBUG("CSS::getFreeSpace Forwarding request to internal services");

double free_space = 0.0;
sg_size_t free_space = 0;
for (const auto &storage_server: this->storage_services) {
for (const auto &service: storage_server.second) {
free_space += service->getTotalFreeSpaceAtPath(path);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ namespace wrench {
bool SimpleStorageService::processFreeSpaceRequest(S4U_CommPort *answer_commport, const std::string &path) {

// TODO: Remove the sanitize
double free_space = 0.0;
sg_size_t free_space = 0;
if (not path.empty()) {
auto sanitized_path = FileLocation::sanitizePath(path);
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,16 +157,16 @@ void SimulationTimestampDiskReadWriteTest::do_SimulationTimestampDiskReadWriteBa
ASSERT_EQ(5, diskwrite_timestamps.size());

// Coverage
diskread_timestamps.front()->getContent()->getBytes();
diskread_timestamps.front()->getContent()->getCounter();
diskread_timestamps.front()->getContent()->getDate();
auto rb = diskread_timestamps.front()->getContent()->getBytes();
auto rc = diskread_timestamps.front()->getContent()->getCounter();
auto rd = diskread_timestamps.front()->getContent()->getDate();
diskread_timestamps.front()->getContent()->getEndpoint();
diskread_timestamps.front()->getContent()->getHostname();
diskread_timestamps.front()->getContent()->getMount();

diskwrite_timestamps.front()->getContent()->getBytes();
diskwrite_timestamps.front()->getContent()->getCounter();
diskwrite_timestamps.front()->getContent()->getDate();
auto wb = diskwrite_timestamps.front()->getContent()->getBytes();
auto wc = diskwrite_timestamps.front()->getContent()->getCounter();
auto wd = diskwrite_timestamps.front()->getContent()->getDate();
diskwrite_timestamps.front()->getContent()->getEndpoint();
diskwrite_timestamps.front()->getContent()->getHostname();
diskwrite_timestamps.front()->getContent()->getMount();
Expand Down

0 comments on commit c0d48b2

Please sign in to comment.