diff --git a/include/wrench/action/FileReadAction.h b/include/wrench/action/FileReadAction.h index 90d02d2f61..2110b1aead 100755 --- a/include/wrench/action/FileReadAction.h +++ b/include/wrench/action/FileReadAction.h @@ -33,7 +33,7 @@ namespace wrench { std::shared_ptr getFile() const; std::vector> getFileLocations() const; std::shared_ptr getUsedFileLocation() const; - double getNumBytesToRead() const; + sg_size_t getNumBytesToRead() const; bool usesScratch() const override; protected: @@ -41,7 +41,7 @@ namespace wrench { FileReadAction(const std::string &name, std::vector> file_locations, - double num_bytes_to_read); + sg_size_t num_bytes_to_read); void execute(const std::shared_ptr &action_executor) override; @@ -52,7 +52,7 @@ namespace wrench { std::shared_ptr file; std::vector> file_locations; std::shared_ptr used_location; - double num_bytes_to_read; + sg_size_t num_bytes_to_read; }; diff --git a/include/wrench/execution_controller/ExecutionController.h b/include/wrench/execution_controller/ExecutionController.h index 14d48807d3..7f29d1ea8f 100755 --- a/include/wrench/execution_controller/ExecutionController.h +++ b/include/wrench/execution_controller/ExecutionController.h @@ -61,20 +61,20 @@ namespace wrench { void waitForAndProcessNextEvent(); bool waitForAndProcessNextEvent(double timeout); - virtual void processEventCompoundJobFailure(std::shared_ptr); - virtual void processEventCompoundJobCompletion(std::shared_ptr); + virtual void processEventCompoundJobFailure(const std::shared_ptr &event); + virtual void processEventCompoundJobCompletion(const std::shared_ptr &event); - virtual void processEventStandardJobCompletion(std::shared_ptr); - virtual void processEventStandardJobFailure(std::shared_ptr); + virtual void processEventStandardJobCompletion(const std::shared_ptr &event); + virtual void processEventStandardJobFailure(const std::shared_ptr &event); - virtual void processEventPilotJobStart(std::shared_ptr); - virtual void processEventPilotJobExpiration(std::shared_ptr); + virtual void processEventPilotJobStart(const std::shared_ptr &event); + virtual void processEventPilotJobExpiration(const std::shared_ptr &event); - virtual void processEventFileCopyCompletion(std::shared_ptr); - virtual void processEventFileCopyFailure(std::shared_ptr); + virtual void processEventFileCopyCompletion(const std::shared_ptr &event); + virtual void processEventFileCopyFailure(const std::shared_ptr &event); - virtual void processEventTimer(std::shared_ptr); + virtual void processEventTimer(const std::shared_ptr &event); void setDaemonized(bool daemonized); @@ -90,7 +90,7 @@ namespace wrench { friend class DataMovementManager; friend class JobManager; - bool daemonized = false; + bool daemonized_ = false; private: virtual int main() = 0; diff --git a/include/wrench/job/CompoundJob.h b/include/wrench/job/CompoundJob.h index 834bd3c29d..ae145a19a9 100755 --- a/include/wrench/job/CompoundJob.h +++ b/include/wrench/job/CompoundJob.h @@ -83,7 +83,7 @@ namespace wrench { std::shared_ptr addFileReadAction(const std::string &name, const std::shared_ptr &file, const std::shared_ptr &storageService, - double num_bytes_to_read); + sg_size_t num_bytes_to_read); std::shared_ptr addFileReadAction(const std::string &name, const std::shared_ptr &file_location); @@ -93,11 +93,11 @@ namespace wrench { std::shared_ptr addFileReadAction(const std::string &name, const std::shared_ptr &file_location, - double num_bytes_to_read); + sg_size_t num_bytes_to_read); std::shared_ptr addFileReadAction(const std::string &name, const std::vector> &file_locations, - double num_bytes_to_read); + sg_size_t num_bytes_to_read); std::shared_ptr addFileWriteAction(const std::string &name, const std::shared_ptr &file, @@ -132,13 +132,13 @@ namespace wrench { std::shared_ptr addComputeAction(const std::string &name, double flops, - double ram, + sg_size_t ram, unsigned long min_num_cores, unsigned long max_num_cores, const std::shared_ptr ¶llel_model); std::shared_ptr addCustomAction(const std::string &name, - double ram, + sg_size_t ram, unsigned long num_cores, const std::function action_executor)> &lambda_execute, const std::function action_executor)> &lambda_terminate); @@ -170,7 +170,7 @@ namespace wrench { unsigned long getMinimumRequiredNumCores(); - double getMinimumRequiredMemory(); + sg_size_t getMinimumRequiredMemory(); /***********************/ diff --git a/include/wrench/simgrid_S4U_util/S4U_CommPort.h b/include/wrench/simgrid_S4U_util/S4U_CommPort.h index 7d8fc5b3c6..02b120c6d4 100644 --- a/include/wrench/simgrid_S4U_util/S4U_CommPort.h +++ b/include/wrench/simgrid_S4U_util/S4U_CommPort.h @@ -68,11 +68,11 @@ namespace wrench { #ifndef NDEBUG this->templateWaitingLogUpdate(get_type_name(), id); #endif - message.release(); + message.release(); // NOLINT(bugprone-unused-return-value) return std::unique_ptr(msg); } else { std::cerr << "message = " << message.get() << "\n"; - throw std::runtime_error(error_prefix + " Unexpected [" + ((message.get() != nullptr) ? message->getName() : "null-message") + "] message while waiting for " + + throw std::runtime_error(error_prefix + " Unexpected [" + ((message != nullptr) ? message->getName() : "null-message") + "] message while waiting for " + get_type_name() + ". Request ID: " + std::to_string(id)); } } @@ -98,7 +98,7 @@ namespace wrench { auto message = this->getMessage(timeout, false); if (auto msg = dynamic_cast(message.get())) { - message.release(); + message.release(); // NOLINT(bugprone-unused-return-value) #ifndef NDEBUG this->templateWaitingLogUpdate(tn, id); #endif @@ -163,7 +163,7 @@ namespace wrench { * @brief Return the commport's name (as a C++ string) * @return the commport's name */ - [[nodiscard]] const std::string get_name() const { + [[nodiscard]] std::string get_name() const { return this->name; } diff --git a/include/wrench/simgrid_S4U_util/S4U_Daemon.h b/include/wrench/simgrid_S4U_util/S4U_Daemon.h index 1dc7833697..39163d4c76 100644 --- a/include/wrench/simgrid_S4U_util/S4U_Daemon.h +++ b/include/wrench/simgrid_S4U_util/S4U_Daemon.h @@ -74,7 +74,7 @@ namespace wrench { virtual ~S4U_Daemon(); - void startDaemon(bool _daemonized, bool _auto_restart); + void startDaemon(bool daemonized, bool auto_restart); void createLifeSaver(std::shared_ptr reference); void deleteLifeSaver(); @@ -133,7 +133,7 @@ namespace wrench { protected: /** @brief a pointer to the simulation object */ - Simulation *simulation; + Simulation *simulation_; /** @brief The service's state */ State state; @@ -169,10 +169,10 @@ namespace wrench { simgrid::s4u::MutexPtr daemon_lock; - bool has_returned_from_main = false;// Set to true after main returns - int return_value = 0; // Set to the value returned by main - bool daemonized{}; // Set to true if daemon is daemonized - bool auto_restart{}; // Set to true if daemon is supposed to auto-restart + bool has_returned_from_main_ = false;// Set to true after main returns + int return_value_ = 0; // Set to the value returned by main + bool daemonized_=true; // Whether the daemon is daemonized (will be overwritten by start()) + bool auto_restart_=false; // Whether the daemon is supposed to auto-restart (will be overwritten by start()) static int num_non_daemonized_actors_running; diff --git a/include/wrench/simgrid_S4U_util/S4U_Simulation.h b/include/wrench/simgrid_S4U_util/S4U_Simulation.h index d4835e8180..7f18fe5e09 100644 --- a/include/wrench/simgrid_S4U_util/S4U_Simulation.h +++ b/include/wrench/simgrid_S4U_util/S4U_Simulation.h @@ -12,6 +12,7 @@ #define WRENCH_S4U_SIMULATION_H #include +#include #include #include diff --git a/include/wrench/simulation/Simulation.h b/include/wrench/simulation/Simulation.h index fb86b33468..c9275d13b3 100755 --- a/include/wrench/simulation/Simulation.h +++ b/include/wrench/simulation/Simulation.h @@ -124,31 +124,11 @@ namespace wrench { // double getEnergyTimestamp(const std::string &hostname, bool can_record = false); // pstate related calls - static int getNumberofPstates(const std::string &hostname); + static int getNumberOfPstates(const std::string &hostname); static double getMinPowerConsumption(const std::string &hostname); static double getMaxPowerConsumption(const std::string &hostname); static std::vector getListOfPstates(const std::string &hostname); -// /** -// * @brief Creates a file copy on a storage service before the simulation begins -// * @param file: a file -// * @param storage_service: a storage service -// */ -// void stageFile(const std::shared_ptr file, const std::shared_ptr &storage_service) { -// this->stageFile(wrench::FileLocation::LOCATION(storage_service, file)); -// } -// /** -// * @brief Creates a file copy on a storage service before the simulation begins -// * @param file: a file -// * @param storage_service: a storage service -// * @param path: a path -// */ -// void stageFile(const std::shared_ptr file, const std::shared_ptr &storage_service, const std::string &path) { -// this->stageFile(wrench::FileLocation::LOCATION(storage_service, path, file)); -// } -// -// void stageFile(const std::shared_ptr &location); - /***********************/ /** \cond DEVELOPER */ /***********************/ @@ -216,7 +196,7 @@ namespace wrench { MemoryManager *getMemoryManagerByHost(const std::string &hostname); #endif - static double getMemoryCapacity(); + static sg_size_t getMemoryCapacity(); static unsigned long getNumCores(); static double getFlopRate(); static std::string getHostName(); @@ -253,8 +233,7 @@ namespace wrench { std::set> memory_managers; #endif - static int unique_disk_sequence_number; - +// static int unique_disk_sequence_number; void platformSanityCheck(); void checkSimulationSetup(); diff --git a/include/wrench/simulation/SimulationOutput.h b/include/wrench/simulation/SimulationOutput.h index 6363ca317d..721b37dcad 100755 --- a/include/wrench/simulation/SimulationOutput.h +++ b/include/wrench/simulation/SimulationOutput.h @@ -123,21 +123,21 @@ namespace wrench { std::shared_ptr dst); int - addTimestampDiskReadStart(double date, std::string hostname, std::string mount, double bytes); + addTimestampDiskReadStart(double date, std::string hostname, std::string mount, sg_size_t bytes); void - addTimestampDiskReadFailure(double date, const std::string &hostname, const std::string &mount, double bytes, int unique_sequence_number); + addTimestampDiskReadFailure(double date, const std::string &hostname, const std::string &mount, sg_size_t bytes, int unique_sequence_number); - void addTimestampDiskReadCompletion(double date, const std::string &hostname, const std::string &mount, double bytes, + void addTimestampDiskReadCompletion(double date, const std::string &hostname, const std::string &mount, sg_size_t bytes, int unique_sequence_number); int - addTimestampDiskWriteStart(double date, std::string hostname, std::string mount, double bytes); + addTimestampDiskWriteStart(double date, std::string hostname, std::string mount, sg_size_t bytes); void - addTimestampDiskWriteFailure(double date, const std::string &hostname, const std::string &mount, double bytes, int unique_sequence_number); + addTimestampDiskWriteFailure(double date, const std::string &hostname, const std::string &mount, sg_size_t bytes, int unique_sequence_number); - void addTimestampDiskWriteCompletion(double date, const std::string &hostname, const std::string &mount, double bytes, + void addTimestampDiskWriteCompletion(double date, const std::string &hostname, const std::string &mount, sg_size_t bytes, int unique_sequence_number); void addTimestampPstateSet(double date, const std::string &hostname, int pstate); diff --git a/include/wrench/workflow/parallel_model/AmdahlParallelModel.h b/include/wrench/workflow/parallel_model/AmdahlParallelModel.h index 8f48c1c171..ac181795e0 100755 --- a/include/wrench/workflow/parallel_model/AmdahlParallelModel.h +++ b/include/wrench/workflow/parallel_model/AmdahlParallelModel.h @@ -22,7 +22,7 @@ namespace wrench { class AmdahlParallelModel : public ParallelModel { public: - double getAlpha() const; + [[nodiscard]] double getAlpha() const; void setAlpha(double alpha); /***********************/ @@ -41,8 +41,8 @@ namespace wrench { private: friend class ParallelModel; - AmdahlParallelModel(double alpha); - double alpha;// Fraction of the work that's parallelizable + explicit AmdahlParallelModel(double alpha); + double alpha_;// Fraction of the work that's parallelizable }; diff --git a/include/wrench/workflow/parallel_model/ConstantEfficiencyParallelModel.h b/include/wrench/workflow/parallel_model/ConstantEfficiencyParallelModel.h index 201cd9ba66..750cfc0b7a 100755 --- a/include/wrench/workflow/parallel_model/ConstantEfficiencyParallelModel.h +++ b/include/wrench/workflow/parallel_model/ConstantEfficiencyParallelModel.h @@ -41,7 +41,7 @@ namespace wrench { friend class ParallelModel; ConstantEfficiencyParallelModel(double efficiency); - double efficiency;// Parallel efficiency + double efficiency_;// Parallel efficiency }; diff --git a/src/wrench/action/FileReadAction.cpp b/src/wrench/action/FileReadAction.cpp index e153764265..4c94a83da5 100755 --- a/src/wrench/action/FileReadAction.cpp +++ b/src/wrench/action/FileReadAction.cpp @@ -28,11 +28,11 @@ namespace wrench { * @brief Constructor * @param name: the action's name (if empty, a unique name will be picked for you) * @param file_locations: the locations to read from (will be tried in order until one succeeds) - * @param num_bytes_to_read: the number of bytes to read (if < 0: read the whole file) + * @param num_bytes_to_read: the number of bytes to read (if == 0: read the whole file) */ FileReadAction::FileReadAction(const std::string &name, std::vector> file_locations, - double num_bytes_to_read) : Action(name, "file_read_"), + sg_size_t num_bytes_to_read) : Action(name, "file_read_"), file_locations(file_locations) { this->file = file_locations.at(0)->getFile(); @@ -42,7 +42,7 @@ namespace wrench { } } - if (num_bytes_to_read < 0.0) { + if (num_bytes_to_read == 0) { this->num_bytes_to_read = this->file->getSize(); } else if (num_bytes_to_read <= this->file->getSize()) { this->num_bytes_to_read = num_bytes_to_read; @@ -119,7 +119,7 @@ namespace wrench { * @brief Return the number of bytes to read by this action * @return A number of bytes */ - double FileReadAction::getNumBytesToRead() const { + sg_size_t FileReadAction::getNumBytesToRead() const { return this->num_bytes_to_read; } diff --git a/src/wrench/execution_controller/ExecutionController.cpp b/src/wrench/execution_controller/ExecutionController.cpp index 09fa67f604..d51edabb43 100755 --- a/src/wrench/execution_controller/ExecutionController.cpp +++ b/src/wrench/execution_controller/ExecutionController.cpp @@ -41,7 +41,7 @@ namespace wrench { std::shared_ptr ExecutionController::createJobManager() { std::shared_ptr job_manager = std::shared_ptr( new JobManager(this->hostname, this->commport)); - job_manager->simulation = this->simulation; + job_manager->simulation_ = this->simulation_; job_manager->start(job_manager, true, false);// Always daemonize, no auto-restart return job_manager; @@ -54,7 +54,7 @@ namespace wrench { std::shared_ptr ExecutionController::createDataMovementManager() { auto data_movement_manager = std::shared_ptr( new DataMovementManager(this->hostname, this->commport)); - data_movement_manager->simulation = this->simulation; + data_movement_manager->simulation_ = this->simulation_; data_movement_manager->start(data_movement_manager, true, false);// Always daemonize, no auto-restart return data_movement_manager; @@ -70,7 +70,7 @@ namespace wrench { std::shared_ptr ExecutionController::createEnergyMeter(const std::map &measurement_periods) { auto energy_meter_raw_ptr = new EnergyMeterService(this->hostname, measurement_periods); std::shared_ptr energy_meter = std::shared_ptr(energy_meter_raw_ptr); - energy_meter->setSimulation(this->simulation); + energy_meter->setSimulation(this->simulation_); energy_meter->start(energy_meter, true, false);// Always daemonize, no auto-restart return energy_meter; } @@ -85,7 +85,7 @@ namespace wrench { ExecutionController::createEnergyMeter(const std::vector &hostnames, double measurement_period) { auto energy_meter_raw_ptr = new EnergyMeterService(this->hostname, hostnames, measurement_period); std::shared_ptr energy_meter = std::shared_ptr(energy_meter_raw_ptr); - energy_meter->setSimulation(this->simulation); + energy_meter->setSimulation(this->simulation_); energy_meter->start(energy_meter, true, false);// Always daemonize, no auto-restart return energy_meter; } @@ -100,7 +100,7 @@ namespace wrench { std::shared_ptr ExecutionController::createBandwidthMeter(const std::map &measurement_periods) { auto bandwidth_meter_raw_ptr = new BandwidthMeterService(this->hostname, measurement_periods); std::shared_ptr bandwidth_meter = std::shared_ptr(bandwidth_meter_raw_ptr); - bandwidth_meter->setSimulation(this->simulation); + bandwidth_meter->setSimulation(this->simulation_); bandwidth_meter->start(bandwidth_meter, true, false);// Always daemonize, no auto-restart return bandwidth_meter; } @@ -115,7 +115,7 @@ namespace wrench { ExecutionController::createBandwidthMeter(const std::vector &link_names, double measurement_period) { auto bandwidth_meter_raw_ptr = new BandwidthMeterService(this->hostname, link_names, measurement_period); std::shared_ptr bandwidth_meter = std::shared_ptr(bandwidth_meter_raw_ptr); - bandwidth_meter->setSimulation(this->simulation); + bandwidth_meter->setSimulation(this->simulation_); bandwidth_meter->start(bandwidth_meter, true, false);// Always daemonize, no auto-restart return bandwidth_meter; } @@ -127,7 +127,7 @@ namespace wrench { * @param message: a string message that will be in the generated TimerEvent */ void ExecutionController::setTimer(double date, std::string message) { - Alarm::createAndStartAlarm(this->simulation, date, this->hostname, this->commport, + Alarm::createAndStartAlarm(this->simulation_, date, this->hostname, this->commport, new ExecutionControllerAlarmTimerMessage(std::move(message), 0), "wms_timer"); } @@ -170,22 +170,22 @@ namespace wrench { if (auto real_event = std::dynamic_pointer_cast(event)) { processEventCompoundJobCompletion(real_event); - } else if (auto real_event = std::dynamic_pointer_cast(event)) { - processEventCompoundJobFailure(real_event); - } else if (auto real_event = std::dynamic_pointer_cast(event)) { - processEventStandardJobCompletion(real_event); - } else if (auto real_event = std::dynamic_pointer_cast(event)) { - processEventStandardJobFailure(real_event); - } else if (auto real_event = std::dynamic_pointer_cast(event)) { - processEventPilotJobStart(real_event); - } else if (auto real_event = std::dynamic_pointer_cast(event)) { - processEventPilotJobExpiration(real_event); - } else if (auto real_event = std::dynamic_pointer_cast(event)) { - processEventFileCopyCompletion(real_event); - } else if (auto real_event = std::dynamic_pointer_cast(event)) { - processEventFileCopyFailure(real_event); - } else if (auto real_event = std::dynamic_pointer_cast(event)) { - processEventTimer(real_event); + } else if (auto cjf_event = std::dynamic_pointer_cast(event)) { + processEventCompoundJobFailure(cjf_event); + } else if (auto sjc_event = std::dynamic_pointer_cast(event)) { + processEventStandardJobCompletion(sjc_event); + } else if (auto sjf_event = std::dynamic_pointer_cast(event)) { + processEventStandardJobFailure(sjf_event); + } else if (auto pjs_event = std::dynamic_pointer_cast(event)) { + processEventPilotJobStart(pjs_event); + } else if (auto pje_event = std::dynamic_pointer_cast(event)) { + processEventPilotJobExpiration(pje_event); + } else if (auto fcc_event = std::dynamic_pointer_cast(event)) { + processEventFileCopyCompletion(fcc_event); + } else if (auto fcf_event = std::dynamic_pointer_cast(event)) { + processEventFileCopyFailure(fcf_event); + } else if (auto t_event = std::dynamic_pointer_cast(event)) { + processEventTimer(t_event); } else { throw std::runtime_error("SimpleExecutionController::main(): Unknown workflow execution event: " + event->toString()); } @@ -198,7 +198,7 @@ namespace wrench { * * @param event: a StandardJobCompletedEvent */ - void ExecutionController::processEventStandardJobCompletion(std::shared_ptr event) { + void ExecutionController::processEventStandardJobCompletion(const std::shared_ptr &event) { auto standard_job = event->standard_job; WRENCH_INFO("In default event-handler: Notified that a %ld-task job has completed", standard_job->getNumTasks()); } @@ -208,7 +208,7 @@ namespace wrench { * * @param event: a StandardJobFailedEvent */ - void ExecutionController::processEventStandardJobFailure(std::shared_ptr event) { + void ExecutionController::processEventStandardJobFailure(const std::shared_ptr &event) { WRENCH_INFO("In default event-handler: Notified that a standard job has failed (all its tasks are back in the ready state)"); } @@ -217,7 +217,7 @@ namespace wrench { * * @param event: a PilotJobStartedEvent */ - void ExecutionController::processEventPilotJobStart(std::shared_ptr event) { + void ExecutionController::processEventPilotJobStart(const std::shared_ptr &event) { WRENCH_INFO("In default event-handler: Notified that a pilot job has started!"); } @@ -226,7 +226,7 @@ namespace wrench { * * @param event: a PilotJobExpiredEvent */ - void ExecutionController::processEventPilotJobExpiration(std::shared_ptr event) { + void ExecutionController::processEventPilotJobExpiration(const std::shared_ptr &event) { WRENCH_INFO("In default event-handler: Notified that a pilot job has expired!"); } @@ -235,7 +235,7 @@ namespace wrench { * * @param event: a FileCopyCompletedEvent */ - void ExecutionController::processEventFileCopyCompletion(std::shared_ptr event) { + void ExecutionController::processEventFileCopyCompletion(const std::shared_ptr &event) { WRENCH_INFO("In default event-handler: Notified that a file copy is completed!"); } @@ -244,7 +244,7 @@ namespace wrench { * * @param event: a FileCopyFailedEvent */ - void ExecutionController::processEventFileCopyFailure(std::shared_ptr event) { + void ExecutionController::processEventFileCopyFailure(const std::shared_ptr &event) { WRENCH_INFO("In default event-handler: Notified that a file copy has failed!"); } @@ -253,7 +253,7 @@ namespace wrench { * * @param event: a TimerEvent */ - void ExecutionController::processEventTimer(std::shared_ptr event) { + void ExecutionController::processEventTimer(const std::shared_ptr &event) { WRENCH_INFO("In default event-handler: Notified that a time has gone off!"); } @@ -262,7 +262,7 @@ namespace wrench { * * @param event: a CompoundJobCompletedEvent */ - void ExecutionController::processEventCompoundJobCompletion(std::shared_ptr event) { + void ExecutionController::processEventCompoundJobCompletion(const std::shared_ptr &event) { WRENCH_INFO("In default event-handler: Notified that a %zu-action job has completed", event->job->getActions().size()); } @@ -271,7 +271,7 @@ namespace wrench { * * @param event: a CompoundJobFailedEvent */ - void ExecutionController::processEventCompoundJobFailure(std::shared_ptr event) { + void ExecutionController::processEventCompoundJobFailure(const std::shared_ptr &event) { WRENCH_INFO("In default event-handler: Notified that a standard job has failed (all its tasks are back in the ready state)"); } @@ -281,7 +281,7 @@ namespace wrench { * @param daemonized: true if the controller should be daemonized, false otherwise */ void ExecutionController::setDaemonized(bool daemonized) { - this->daemonized = daemonized; + this->daemonized_ = daemonized; } }// namespace wrench diff --git a/src/wrench/job/CompoundJob.cpp b/src/wrench/job/CompoundJob.cpp index 48c8411b38..77674934ff 100644 --- a/src/wrench/job/CompoundJob.cpp +++ b/src/wrench/job/CompoundJob.cpp @@ -113,7 +113,7 @@ namespace wrench { */ std::shared_ptr CompoundJob::addComputeAction(const std::string &name, double flops, - double ram, + sg_size_t ram, unsigned long min_num_cores, unsigned long max_num_cores, const std::shared_ptr ¶llel_model) { @@ -141,13 +141,13 @@ namespace wrench { * @param name: the action's name (if empty, a unique name will be picked for you) * @param file: the file to read * @param storage_service: the storage service to read the file from - * @param num_bytes_to_read: the number of bytes to read + * @param num_bytes_to_read: the number of bytes to read (if 0, read the whole file) * @return a file read action */ std::shared_ptr CompoundJob::addFileReadAction(const std::string &name, const std::shared_ptr &file, const std::shared_ptr &storage_service, - const double num_bytes_to_read) { + const sg_size_t num_bytes_to_read) { return addFileReadAction(name, FileLocation::LOCATION(storage_service, file), num_bytes_to_read); } @@ -201,19 +201,19 @@ namespace wrench { std::shared_ptr CompoundJob::addFileReadAction(const std::string &name, const std::shared_ptr &file_location) { std::vector> v = {file_location}; - return this->addFileReadAction(name, v, -1.0); + return this->addFileReadAction(name, v, 0); } /** * @brief Add a file read action to the job * @param name: the action's name (if empty, a unique name will be picked for you) * @param file_location: the file's location - * @param num_bytes_to_read: the number of bytes to read + * @param num_bytes_to_read: the number of bytes to read (if zero, read the whole file) * @return a file read action */ std::shared_ptr CompoundJob::addFileReadAction(const std::string &name, const std::shared_ptr &file_location, - const double num_bytes_to_read) { + const sg_size_t num_bytes_to_read) { std::vector> v = {file_location}; return this->addFileReadAction(name, v, num_bytes_to_read); } @@ -227,19 +227,19 @@ namespace wrench { */ std::shared_ptr CompoundJob::addFileReadAction(const std::string &name, const std::vector> &file_locations) { - return this->addFileReadAction(name, file_locations, -1.0); + return this->addFileReadAction(name, file_locations, 0); } /** * @brief Add a file read action to the job * @param name: the action's name (if empty, a unique name will be picked for you) * @param file_locations: the locations to read the file from (will be tried in order until one succeeds) - * @param num_bytes_to_read: number of bytes to read + * @param num_bytes_to_read: number of bytes to read (if zero, read the whole file) * @return a file read action */ std::shared_ptr CompoundJob::addFileReadAction(const std::string &name, const std::vector> &file_locations, - const double num_bytes_to_read) { + const sg_size_t num_bytes_to_read) { auto new_action = std::shared_ptr( new FileReadAction(name, file_locations, num_bytes_to_read)); this->addAction(new_action); @@ -335,7 +335,7 @@ namespace wrench { * @return a custom action */ std::shared_ptr CompoundJob::addCustomAction(const std::string &name, - double ram, + sg_size_t ram, unsigned long num_cores, const std::function)> &lambda_execute, const std::function)> &lambda_terminate) { @@ -699,8 +699,8 @@ namespace wrench { * @brief Get the minimum required amount of memory to run the job * @return a number of bytes */ - double CompoundJob::getMinimumRequiredMemory() { - double min_ram = 0; + sg_size_t CompoundJob::getMinimumRequiredMemory() { + sg_size_t min_ram = 0; for (auto const &action: this->actions) { min_ram = (min_ram < action->getMinRAMFootprint() ? action->getMinRAMFootprint() : min_ram); } diff --git a/src/wrench/managers/data_movement_manager/DataMovementManager.cpp b/src/wrench/managers/data_movement_manager/DataMovementManager.cpp index 523c509322..c10423333a 100644 --- a/src/wrench/managers/data_movement_manager/DataMovementManager.cpp +++ b/src/wrench/managers/data_movement_manager/DataMovementManager.cpp @@ -119,7 +119,7 @@ namespace wrench { this->pending_file_reads.push_front(std::make_unique(location, num_bytes)); // Initiate the read in a thread auto frt = std::make_shared(this->hostname, this->commport, location, num_bytes); - frt->setSimulation(this->simulation); + frt->setSimulation(this->simulation_); frt->start(frt, true, false); } @@ -146,9 +146,9 @@ namespace wrench { this->pending_file_writes.push_front(std::make_unique(location, file_registry_service)); - // Initiate the write in a thread + // Initiate the write operation in a thread auto fwt = std::make_shared(this->hostname, this->commport, location); - fwt->setSimulation(this->simulation); + fwt->setSimulation(this->simulation_); fwt->start(fwt, true, false); } diff --git a/src/wrench/managers/data_movement_manager/DataMovementManagerMessage.cpp b/src/wrench/managers/data_movement_manager/DataMovementManagerMessage.cpp index 5b3132ba7e..adb9e4ec9b 100755 --- a/src/wrench/managers/data_movement_manager/DataMovementManagerMessage.cpp +++ b/src/wrench/managers/data_movement_manager/DataMovementManagerMessage.cpp @@ -19,7 +19,6 @@ namespace wrench { DataMovementManagerMessage::DataMovementManagerMessage() : SimulationMessage(0) { } - /** * @brief Constructor * @param src_location: the source location diff --git a/src/wrench/managers/job_manager/JobManager.cpp b/src/wrench/managers/job_manager/JobManager.cpp index 13a0ba5203..7510b7fd98 100644 --- a/src/wrench/managers/job_manager/JobManager.cpp +++ b/src/wrench/managers/job_manager/JobManager.cpp @@ -597,7 +597,7 @@ namespace wrench { "_one_shot_bm", std::dynamic_pointer_cast(execution_service->getParentService())->getScratch())); - bm_cs->simulation = executor->getSimulation(); + bm_cs->simulation_ = executor->getSimulation(); bm_cs->start(bm_cs, true, false);// Daemonized, no auto-restart job->compute_service = bm_cs; @@ -715,7 +715,7 @@ namespace wrench { std::map, WorkflowTask::State> state_changes; std::set> failure_count_increments; std::shared_ptr job_failure_cause; - job->processCompoundJobOutcome(state_changes, failure_count_increments, job_failure_cause, this->simulation); + job->processCompoundJobOutcome(state_changes, failure_count_increments, job_failure_cause, this->simulation_); job->applyTaskUpdates(state_changes, failure_count_increments); } @@ -928,7 +928,7 @@ namespace wrench { std::map, WorkflowTask::State> state_changes; std::set> failure_count_increments; std::shared_ptr job_failure_cause; - job->processCompoundJobOutcome(state_changes, failure_count_increments, job_failure_cause, this->simulation); + job->processCompoundJobOutcome(state_changes, failure_count_increments, job_failure_cause, this->simulation_); // remove the job from the "dispatched" list this->jobs_dispatched.erase(job->compound_job); @@ -960,13 +960,13 @@ namespace wrench { std::map, WorkflowTask::State> state_changes; std::set> failure_count_increments; std::shared_ptr job_failure_cause; - job->processCompoundJobOutcome(state_changes, failure_count_increments, job_failure_cause, this->simulation); + job->processCompoundJobOutcome(state_changes, failure_count_increments, job_failure_cause, this->simulation_); // Fix the failure cause in case it's a failure cause that refers to a job (in which case it is // right now referring to the compound job instead of the standard job - if (auto actual_cause = std::dynamic_pointer_cast(job_failure_cause)) { + if (std::dynamic_pointer_cast(job_failure_cause)) { job_failure_cause = std::make_shared(job); - } else if (auto actual_cause = std::dynamic_pointer_cast(job_failure_cause)) { + } else if (std::dynamic_pointer_cast(job_failure_cause)) { job_failure_cause = std::make_shared(job); } else if (auto actual_cause = std::dynamic_pointer_cast(job_failure_cause)) { job_failure_cause = std::make_shared(job, actual_cause->getService()); diff --git a/src/wrench/services/compute/ComputeService.cpp b/src/wrench/services/compute/ComputeService.cpp index ff17a2afcc..86e0dbb826 100644 --- a/src/wrench/services/compute/ComputeService.cpp +++ b/src/wrench/services/compute/ComputeService.cpp @@ -161,7 +161,7 @@ namespace wrench { // Set the storage service's network timeout to that of this compute service ss->setNetworkTimeoutValue(this->getNetworkTimeoutValue()); this->scratch_space_storage_service = - this->simulation->startNewService(ss); + this->simulation_->startNewService(ss); } /** diff --git a/src/wrench/services/compute/bare_metal/BareMetalComputeService.cpp b/src/wrench/services/compute/bare_metal/BareMetalComputeService.cpp index 9fd70f36d6..76152970a6 100644 --- a/src/wrench/services/compute/bare_metal/BareMetalComputeService.cpp +++ b/src/wrench/services/compute/bare_metal/BareMetalComputeService.cpp @@ -356,7 +356,7 @@ namespace wrench { {ActionExecutionServiceProperty::TERMINATE_WHENEVER_ALL_RESOURCES_ARE_DOWN, this->getPropertyValueAsString(BareMetalComputeServiceProperty::TERMINATE_WHENEVER_ALL_RESOURCES_ARE_DOWN)}, }, {})); - this->action_execution_service->setSimulation(this->simulation); + this->action_execution_service->setSimulation(this->simulation_); } /** @@ -373,7 +373,7 @@ namespace wrench { // Start the ActionExecutionService this->action_execution_service->setParentService(this->getSharedPtr()); - this->action_execution_service->setSimulation(this->simulation); + this->action_execution_service->setSimulation(this->simulation_); this->action_execution_service->start(this->action_execution_service, true, false); if (this->getPropertyValueAsBoolean(BareMetalComputeServiceProperty::TERMINATE_WHENEVER_ALL_RESOURCES_ARE_DOWN)) { @@ -381,7 +381,7 @@ namespace wrench { auto termination_detector = std::make_shared( this->hostname, this->action_execution_service, this->commport, false, true); - termination_detector->setSimulation(this->simulation); + termination_detector->setSimulation(this->simulation_); termination_detector->start(termination_detector, true, false);// Daemonized, no auto-restart } diff --git a/src/wrench/services/compute/bare_metal/BareMetalComputeServiceOneShot.cpp b/src/wrench/services/compute/bare_metal/BareMetalComputeServiceOneShot.cpp index ad3f3094ea..66072b7f77 100755 --- a/src/wrench/services/compute/bare_metal/BareMetalComputeServiceOneShot.cpp +++ b/src/wrench/services/compute/bare_metal/BareMetalComputeServiceOneShot.cpp @@ -67,7 +67,7 @@ namespace wrench { // Start the ActionExecutionService this->action_execution_service->setParentService(this->getSharedPtr()); - this->action_execution_service->setSimulation(this->simulation); + this->action_execution_service->setSimulation(this->simulation_); this->action_execution_service->start(this->action_execution_service, true, false); /** Note that the code below doesn't do any checks at all, the job had better be well-formed **/ diff --git a/src/wrench/services/compute/batch/BatchComputeService.cpp b/src/wrench/services/compute/batch/BatchComputeService.cpp index 373007b3ba..bd7b55f4e0 100644 --- a/src/wrench/services/compute/batch/BatchComputeService.cpp +++ b/src/wrench/services/compute/batch/BatchComputeService.cpp @@ -1000,7 +1000,7 @@ namespace wrench { "_one_shot_bm_", this->getScratch())); - executor->simulation = this->simulation; + executor->simulation_ = this->simulation_; executor->start(executor, true, false);// Daemonized, no auto-restart batch_job->setBeginTimestamp(S4U_Simulation::getClock()); batch_job->setEndingTimestamp(S4U_Simulation::getClock() + (double) allocated_time); @@ -1013,7 +1013,7 @@ namespace wrench { auto msg = new AlarmJobTimeOutMessage(batch_job, 0); - std::shared_ptr alarm_ptr = Alarm::createAndStartAlarm(this->simulation, + std::shared_ptr alarm_ptr = Alarm::createAndStartAlarm(this->simulation_, batch_job->getEndingTimestamp(), this->hostname, this->commport, msg, @@ -1110,7 +1110,7 @@ namespace wrench { this->getPropertyValueAsBoolean( BatchComputeServiceProperty::USE_REAL_RUNTIMES_AS_REQUESTED_RUNTIMES_IN_WORKLOAD_TRACE_FILE), this->workload_trace); - this->workload_trace_replayer->setSimulation(this->simulation); + this->workload_trace_replayer->setSimulation(this->simulation_); this->workload_trace_replayer->start(this->workload_trace_replayer, true, false);// Daemonized, no auto-restart } diff --git a/src/wrench/services/compute/batch/workload_helper_classes/WorkloadTraceFileReplayer.cpp b/src/wrench/services/compute/batch/workload_helper_classes/WorkloadTraceFileReplayer.cpp index 4d7823e5fc..89b6e884e1 100644 --- a/src/wrench/services/compute/batch/workload_helper_classes/WorkloadTraceFileReplayer.cpp +++ b/src/wrench/services/compute/batch/workload_helper_classes/WorkloadTraceFileReplayer.cpp @@ -50,7 +50,7 @@ namespace wrench { this->hostname, job_manager); // Start the WorkloadTraceFileReplayerEventReceiver - event_receiver->setSimulation(this->simulation); + event_receiver->setSimulation(this->simulation_); event_receiver->start(event_receiver, true, false);// Daemonized, no auto-restart double core_flop_rate = (*(this->batch_service->getCoreFlopRate(false).begin())).second; diff --git a/src/wrench/services/compute/cloud/CloudComputeService.cpp b/src/wrench/services/compute/cloud/CloudComputeService.cpp index 61ed126300..dadc83ad29 100644 --- a/src/wrench/services/compute/cloud/CloudComputeService.cpp +++ b/src/wrench/services/compute/cloud/CloudComputeService.cpp @@ -808,7 +808,7 @@ namespace wrench { plist, vm->getMessagePayloadList(), this->getScratch())); - cs->simulation = this->simulation; + cs->simulation_ = this->simulation_; std::get<2>(this->vm_list[vm_name]) = cs; } @@ -820,7 +820,7 @@ namespace wrench { auto termination_detector = std::make_shared( this->hostname, cs, this->commport, false, true); - termination_detector->setSimulation(this->simulation); + termination_detector->setSimulation(this->simulation_); termination_detector->start(termination_detector, true, false);// Daemonized, no auto-restart msg_to_send_back = new CloudComputeServiceStartVMAnswerMessage( diff --git a/src/wrench/services/compute/htcondor/HTCondorCentralManagerService.cpp b/src/wrench/services/compute/htcondor/HTCondorCentralManagerService.cpp index 98e0be4b2e..2f36e80758 100644 --- a/src/wrench/services/compute/htcondor/HTCondorCentralManagerService.cpp +++ b/src/wrench/services/compute/htcondor/HTCondorCentralManagerService.cpp @@ -151,7 +151,7 @@ namespace wrench { this->fcfs, this->compute_services, this->running_jobs, this->pending_jobs, this->commport); - negotiator->setSimulation(this->simulation); + negotiator->setSimulation(this->simulation_); negotiator->start(negotiator, true, false);// Daemonized, no auto-restart } } diff --git a/src/wrench/services/compute/htcondor/HTCondorComputeService.cpp b/src/wrench/services/compute/htcondor/HTCondorComputeService.cpp index 97d6d87d3f..ab390167f4 100644 --- a/src/wrench/services/compute/htcondor/HTCondorComputeService.cpp +++ b/src/wrench/services/compute/htcondor/HTCondorComputeService.cpp @@ -187,7 +187,7 @@ namespace wrench { this->commport->get_cname()); // start the central manager service - this->central_manager->setSimulation(this->simulation); + this->central_manager->setSimulation(this->simulation_); this->central_manager->start(this->central_manager, true, false);// Daemonized, no auto-restart // Start the Scratch Storage Service diff --git a/src/wrench/services/file_registry/FileRegistryService.cpp b/src/wrench/services/file_registry/FileRegistryService.cpp index 32300a7970..2d6fe9250c 100644 --- a/src/wrench/services/file_registry/FileRegistryService.cpp +++ b/src/wrench/services/file_registry/FileRegistryService.cpp @@ -128,7 +128,7 @@ namespace wrench { throw std::invalid_argument("FileRegistryService::addEntry(): Invalid nullptr argument"); } - if (not this->simulation->isRunning()) { + if (not this->simulation_->isRunning()) { this->addEntryToDatabase(location); return; } @@ -158,7 +158,7 @@ namespace wrench { throw std::invalid_argument(" FileRegistryService::removeEntry(): Invalid nullptr argument"); } - if (not this->simulation->isRunning()) { + if (not this->simulation_->isRunning()) { bool success = removeEntryFromDatabase(location); if (!success) { WRENCH_WARN( diff --git a/src/wrench/services/helper_services/action_execution_service/ActionExecutionService.cpp b/src/wrench/services/helper_services/action_execution_service/ActionExecutionService.cpp index b4a48fddc9..0375b44e27 100644 --- a/src/wrench/services/helper_services/action_execution_service/ActionExecutionService.cpp +++ b/src/wrench/services/helper_services/action_execution_service/ActionExecutionService.cpp @@ -295,7 +295,7 @@ namespace wrench { this->host_state_change_monitor = std::shared_ptr( new HostStateChangeDetector(this->hostname, hosts_to_monitor, true, true, true, this->getSharedPtr(), this->commport)); - this->host_state_change_monitor->setSimulation(this->simulation); + this->host_state_change_monitor->setSimulation(this->simulation_); this->host_state_change_monitor->start(this->host_state_change_monitor, true, false);// Daemonized, no auto-restart } @@ -472,7 +472,7 @@ namespace wrench { action, this->getSharedPtr())); - action_executor->setSimulation(this->simulation); + action_executor->setSimulation(this->simulation_); try { action_executor->start(action_executor, true, false);// Daemonized, no auto-restart } catch (ExecutionException &e) { @@ -485,7 +485,7 @@ namespace wrench { // action executor has died) auto failure_detector = std::shared_ptr( new ServiceTerminationDetector(this->hostname, action_executor, this->commport, true, false)); - failure_detector->setSimulation(this->simulation); + failure_detector->setSimulation(this->simulation_); failure_detector->start(failure_detector, true, false);// Daemonized, no auto-restart // Keep track of this action executor diff --git a/src/wrench/services/helper_services/alarm/Alarm.cpp b/src/wrench/services/helper_services/alarm/Alarm.cpp index 4b0410149e..93e1df787d 100755 --- a/src/wrench/services/helper_services/alarm/Alarm.cpp +++ b/src/wrench/services/helper_services/alarm/Alarm.cpp @@ -86,7 +86,7 @@ namespace wrench { SimulationMessage *msg, std::string suffix) { std::shared_ptr alarm_ptr = std::shared_ptr( new Alarm(date, std::move(hostname), reply_commport, msg, std::move(suffix))); - alarm_ptr->simulation = simulation; + alarm_ptr->simulation_ = simulation; alarm_ptr->start(alarm_ptr, true, false);// Daemonized, no auto-restart return alarm_ptr; } diff --git a/src/wrench/services/memory/MemoryManager.cpp b/src/wrench/services/memory/MemoryManager.cpp index d5fc287fcc..750373fde7 100755 --- a/src/wrench/services/memory/MemoryManager.cpp +++ b/src/wrench/services/memory/MemoryManager.cpp @@ -691,7 +691,7 @@ namespace wrench { * @brief Append to the log */ void MemoryManager::log() { - this->time_log.push_back(this->simulation->getCurrentSimulatedDate()); + this->time_log.push_back(this->simulation_->getCurrentSimulatedDate()); this->dirty_log.push_back(this->dirty); this->cached_log.push_back(this->cached); this->free_log.push_back(this->free); diff --git a/src/wrench/services/metering/BandwidthMeterService.cpp b/src/wrench/services/metering/BandwidthMeterService.cpp index e13c76116d..1f1bb81655 100644 --- a/src/wrench/services/metering/BandwidthMeterService.cpp +++ b/src/wrench/services/metering/BandwidthMeterService.cpp @@ -123,7 +123,7 @@ namespace wrench { // Take measurements for (auto &l: this->time_to_next_measurement) { if (l.second < EPSILON) { - this->simulation->getLinkUsage(l.first, true); + this->simulation_->getLinkUsage(l.first, true); this->time_to_next_measurement[l.first] = this->measurement_periods[l.first]; } } diff --git a/src/wrench/services/metering/EnergyMeterService.cpp b/src/wrench/services/metering/EnergyMeterService.cpp index e6bdb96878..1c9c0214b9 100755 --- a/src/wrench/services/metering/EnergyMeterService.cpp +++ b/src/wrench/services/metering/EnergyMeterService.cpp @@ -122,7 +122,7 @@ namespace wrench { // Take measurements for (auto &h: this->time_to_next_measurement) { if (h.second < EPSILON) { - this->simulation->getEnergyConsumed(h.first, true); + this->simulation_->getEnergyConsumed(h.first, true); this->time_to_next_measurement[h.first] = this->measurement_periods[h.first]; } } diff --git a/src/wrench/services/network_proximity/NetworkProximityReceiverDaemon.cpp b/src/wrench/services/network_proximity/NetworkProximityReceiverDaemon.cpp index 19df1e12a1..f18dd9ddd1 100644 --- a/src/wrench/services/network_proximity/NetworkProximityReceiverDaemon.cpp +++ b/src/wrench/services/network_proximity/NetworkProximityReceiverDaemon.cpp @@ -10,11 +10,9 @@ #include #include -#include #include #include #include -#include #include "wrench/services/network_proximity/NetworkProximityMessage.h" #include "wrench/exceptions/ExecutionException.h" @@ -35,7 +33,7 @@ namespace wrench { const std::string& hostname, const WRENCH_MESSAGE_PAYLOADCOLLECTION_TYPE& messagepayload_list) : Service(hostname, "network_proximity_receiver_daemon") { setMessagePayloads(messagepayload_list, {}); - this->simulation = simulation; + this->simulation_ = simulation; } /** diff --git a/src/wrench/services/network_proximity/NetworkProximitySenderDaemon.cpp b/src/wrench/services/network_proximity/NetworkProximitySenderDaemon.cpp index d4ecdcb004..350ea5cfc3 100644 --- a/src/wrench/services/network_proximity/NetworkProximitySenderDaemon.cpp +++ b/src/wrench/services/network_proximity/NetworkProximitySenderDaemon.cpp @@ -69,7 +69,7 @@ namespace wrench { // Set the message payloads setMessagePayloads(messagepayload_list, {}); - this->simulation = simulation; + this->simulation_ = simulation; this->message_size = message_size; this->measurement_period = measurement_period; this->max_noise = noise; diff --git a/src/wrench/services/network_proximity/NetworkProximityService.cpp b/src/wrench/services/network_proximity/NetworkProximityService.cpp index 615cd2de82..98ad50b838 100644 --- a/src/wrench/services/network_proximity/NetworkProximityService.cpp +++ b/src/wrench/services/network_proximity/NetworkProximityService.cpp @@ -183,7 +183,7 @@ namespace wrench { for (const auto &h: this->hosts_in_network) { // Set up network sender daemons auto np_sender_daemon = std::make_shared( - this->simulation, h, this->commport, + this->simulation_, h, this->commport, this->getPropertyValueAsDouble( NetworkProximityServiceProperty::NETWORK_PROXIMITY_MESSAGE_SIZE), this->getPropertyValueAsTimeInSecond( @@ -195,7 +195,7 @@ namespace wrench { this->messagepayload_list); this->network_sender_daemons.push_back(np_sender_daemon); - auto np_receiver_daemon = std::make_shared(this->simulation, h, this->messagepayload_list); + auto np_receiver_daemon = std::make_shared(this->simulation_, h, this->messagepayload_list); this->network_receiver_daemons.push_back(np_receiver_daemon); // if this network service type is 'vivaldi', set up the coordinate lookup table diff --git a/src/wrench/services/storage/StorageService.cpp b/src/wrench/services/storage/StorageService.cpp index 8a13f1f092..cf8649c5d8 100755 --- a/src/wrench/services/storage/StorageService.cpp +++ b/src/wrench/services/storage/StorageService.cpp @@ -459,7 +459,7 @@ namespace wrench { // Send a message to the daemon of the dst service auto answer_commport = S4U_Daemon::getRunningActorRecvCommPort(); - src_location->getStorageService()->simulation->getOutput().addTimestampFileCopyStart(Simulation::getCurrentSimulatedDate(), file, + src_location->getStorageService()->getSimulation()->getOutput().addTimestampFileCopyStart(Simulation::getCurrentSimulatedDate(), file, src_location, dst_location); commport_to_contact->putMessage( @@ -522,7 +522,7 @@ namespace wrench { commport_to_contact = dst_location->getStorageService()->commport; } - src_location->getStorageService()->simulation->getOutput().addTimestampFileCopyStart(Simulation::getCurrentSimulatedDate(), file, + src_location->getStorageService()->getSimulation()->getOutput().addTimestampFileCopyStart(Simulation::getCurrentSimulatedDate(), file, src_location, dst_location); diff --git a/src/wrench/services/storage/compound/CompoundStorageService.cpp b/src/wrench/services/storage/compound/CompoundStorageService.cpp index 5b9f847160..75ef190477 100644 --- a/src/wrench/services/storage/compound/CompoundStorageService.cpp +++ b/src/wrench/services/storage/compound/CompoundStorageService.cpp @@ -201,7 +201,7 @@ namespace wrench { } parts.push_back(part_file); // parts.push_back( -// this->simulation->addFile(file_name + "_stripe_" + std::to_string(part_id), this->max_chunk_size)); +// this->simulation_->addFile(file_name + "_stripe_" + std::to_string(part_id), this->max_chunk_size)); part_id++; remaining -= this->max_chunk_size; } @@ -606,7 +606,7 @@ namespace wrench { commport_to_contact = dst_parts[copy_idx]->getStorageService()->commport; } - this->simulation->getOutput().addTimestampFileCopyStart(Simulation::getCurrentSimulatedDate(), file, + this->simulation_->getOutput().addTimestampFileCopyStart(Simulation::getCurrentSimulatedDate(), file, src_parts[copy_idx], dst_parts[copy_idx]); commport_to_contact->dputMessage( @@ -743,7 +743,7 @@ namespace wrench { commport_to_contact = dst_parts[copy_idx]->getStorageService()->commport; } - this->simulation->getOutput().addTimestampFileCopyStart(Simulation::getCurrentSimulatedDate(), file, + this->simulation_->getOutput().addTimestampFileCopyStart(Simulation::getCurrentSimulatedDate(), file, src_parts[copy_idx], dst_parts[copy_idx]); diff --git a/src/wrench/services/storage/simple/SimpleStorageService.cpp b/src/wrench/services/storage/simple/SimpleStorageService.cpp index 33ada64206..0de0b0b914 100644 --- a/src/wrench/services/storage/simple/SimpleStorageService.cpp +++ b/src/wrench/services/storage/simple/SimpleStorageService.cpp @@ -24,7 +24,6 @@ #include #include #include -#include #include namespace sgfs = simgrid::fsmod; @@ -587,5 +586,4 @@ namespace wrench { return nullptr; } - }// namespace wrench diff --git a/src/wrench/services/storage/simple/SimpleStorageServiceBufferized.cpp b/src/wrench/services/storage/simple/SimpleStorageServiceBufferized.cpp index dfaab76516..e4d6c3c828 100644 --- a/src/wrench/services/storage/simple/SimpleStorageServiceBufferized.cpp +++ b/src/wrench/services/storage/simple/SimpleStorageServiceBufferized.cpp @@ -10,9 +10,6 @@ #include #include #include -#include -#include -#include #include #include @@ -24,7 +21,7 @@ #include #include #include -#include +//#include namespace sgfs = simgrid::fsmod; @@ -100,7 +97,7 @@ namespace wrench { } } // Start periodical flushing via a memory manager - this->memory_manager = MemoryManager::initAndStart(this->simulation, memory_disk, 0.4, 5, 30, this->hostname); + this->memory_manager = MemoryManager::initAndStart(this->simulation_, memory_disk, 0.4, 5, 30, this->hostname); // memory_manager_ptr->log(); } #endif @@ -242,7 +239,7 @@ namespace wrench { answer_commport, nullptr, this->buffer_size); - ftt->setSimulation(this->simulation); + ftt->setSimulation(this->simulation_); // Add it to the Pool of pending data communications this->pending_file_transfer_threads.push_back(ftt); @@ -286,7 +283,7 @@ namespace wrench { 1, this->getMessagePayloadValue(StorageServiceMessagePayload::FILE_READ_ANSWER_MESSAGE_PAYLOAD))); } catch (ExecutionException &e) { - return true;// oh well + return true;// oh! well } // If success, then follow up with sending the file (ASYNCHRONOUSLY!) @@ -304,7 +301,7 @@ namespace wrench { nullptr, nullptr, buffer_size); - ftt->setSimulation(this->simulation); + ftt->setSimulation(this->simulation_); // Add it to the Pool of pending data communications this->pending_file_transfer_threads.push_front(ftt); @@ -333,7 +330,7 @@ namespace wrench { auto failure_cause = validateFileCopyRequest(src_location, dst_location, src_opened_file, dst_opened_file); if (failure_cause) { - this->simulation->getOutput().addTimestampFileCopyFailure(Simulation::getCurrentSimulatedDate(), src_location->getFile(), src_location, dst_location); + this->simulation_->getOutput().addTimestampFileCopyFailure(Simulation::getCurrentSimulatedDate(), src_location->getFile(), src_location, dst_location); try { answer_commport->putMessage( new StorageServiceFileCopyAnswerMessage( @@ -372,7 +369,7 @@ namespace wrench { nullptr, answer_commport, this->buffer_size); - ftt->setSimulation(this->simulation); + ftt->setSimulation(this->simulation_); this->pending_file_transfer_threads.push_back(ftt); return true; @@ -457,7 +454,7 @@ namespace wrench { // Deal with time stamps, previously we could test whether a real timestamp was passed, now this. // Maybe no corresponding timestamp. try { - this->simulation->getOutput().addTimestampFileCopyCompletion(Simulation::getCurrentSimulatedDate(), + this->simulation_->getOutput().addTimestampFileCopyCompletion(Simulation::getCurrentSimulatedDate(), src_location->getFile(), src_location, dst_location); } catch (invalid_argument &ignore) { } @@ -507,7 +504,7 @@ namespace wrench { if (ftt->dst_location->getStorageService() == shared_from_this()) { WRENCH_INFO("File %s stored", ftt->dst_location->getFile()->getID().c_str()); try { - this->simulation->getOutput().addTimestampFileCopyCompletion( + this->simulation_->getOutput().addTimestampFileCopyCompletion( Simulation::getCurrentSimulatedDate(), ftt->dst_location->getFile(), ftt->src_location, ftt->dst_location); } catch (invalid_argument &ignore) { } diff --git a/src/wrench/services/storage/simple/SimpleStorageServiceNonBufferized.cpp b/src/wrench/services/storage/simple/SimpleStorageServiceNonBufferized.cpp index 1202400d56..28e49e1a35 100644 --- a/src/wrench/services/storage/simple/SimpleStorageServiceNonBufferized.cpp +++ b/src/wrench/services/storage/simple/SimpleStorageServiceNonBufferized.cpp @@ -22,7 +22,7 @@ #include #include #include -#include +//#include WRENCH_LOG_CATEGORY(wrench_core_simple_storage_service_non_bufferized, "Log category for Simple Storage Service Non Bufferized"); @@ -113,7 +113,7 @@ namespace wrench { // this->createFile(transaction->dst_location); WRENCH_INFO("File %s stored", transaction->dst_location->getFile()->getID().c_str()); try { - this->simulation->getOutput().addTimestampFileCopyCompletion( + this->simulation_->getOutput().addTimestampFileCopyCompletion( Simulation::getCurrentSimulatedDate(), transaction->dst_location->getFile(), transaction->src_location, transaction->dst_location); } catch (invalid_argument &ignore) { } @@ -186,7 +186,7 @@ namespace wrench { } // Start periodical flushing via a memory manager - this->memory_manager = MemoryManager::initAndStart(this->simulation, memory_disk, 0.4, 5, 30, this->hostname); + this->memory_manager = MemoryManager::initAndStart(this->simulation_, memory_disk, 0.4, 5, 30, this->hostname); } #endif @@ -486,7 +486,7 @@ namespace wrench { auto failure_cause = validateFileCopyRequest(src_location, dst_location, src_opened_file, dst_opened_file); if (failure_cause) { - this->simulation->getOutput().addTimestampFileCopyFailure(Simulation::getCurrentSimulatedDate(), src_location->getFile(), src_location, dst_location); + this->simulation_->getOutput().addTimestampFileCopyFailure(Simulation::getCurrentSimulatedDate(), src_location->getFile(), src_location, dst_location); try { answer_commport->dputMessage( new StorageServiceFileCopyAnswerMessage( diff --git a/src/wrench/services/storage/storage_helper_classes/FileTransferThread.cpp b/src/wrench/services/storage/storage_helper_classes/FileTransferThread.cpp index 5907e6e1db..9c7dca0411 100644 --- a/src/wrench/services/storage/storage_helper_classes/FileTransferThread.cpp +++ b/src/wrench/services/storage/storage_helper_classes/FileTransferThread.cpp @@ -16,7 +16,7 @@ #include #include #include -#include +//#include WRENCH_LOG_CATEGORY(wrench_core_file_transfer_thread, "Log category for File Transfer Thread"); @@ -327,9 +327,9 @@ namespace wrench { if (!dst_ss) { throw std::runtime_error("FileTransferThread::receiveFileFromNetwork(): Storage Service should be a SimpleStorageService for disk write"); } - int unique_disk_sequence_number_write = this->simulation->getOutput().addTimestampDiskWriteStart(Simulation::getCurrentSimulatedDate(), hostname, dst_opened_file->get_path(), msg->payload); + int unique_disk_sequence_number_write = this->simulation_->getOutput().addTimestampDiskWriteStart(Simulation::getCurrentSimulatedDate(), hostname, dst_opened_file->get_path(), msg->payload); this->dst_opened_file->write(msg->payload); - this->simulation->getOutput().addTimestampDiskWriteCompletion(Simulation::getCurrentSimulatedDate(), hostname, dst_opened_file->get_path(), msg->payload, unique_disk_sequence_number_write); + this->simulation_->getOutput().addTimestampDiskWriteCompletion(Simulation::getCurrentSimulatedDate(), hostname, dst_opened_file->get_path(), msg->payload, unique_disk_sequence_number_write); // simulation->writeToDisk(msg->payload, location->getStorageService()->hostname, // dst_location->getDiskOrNull()); #ifdef PAGE_CACHE_SIMULATION @@ -366,9 +366,9 @@ namespace wrench { throw std::runtime_error("FileTransferThread::receiveFileFromNetwork(): Writing to disk can only be to a SimpleStorageService"); } // simulation->writeToDisk(msg->payload, ss->hostname, location->getDiskOrNull()); - int unique_disk_sequence_number_write = this->simulation->getOutput().addTimestampDiskWriteStart(Simulation::getCurrentSimulatedDate(), hostname, this->dst_opened_file->get_path(), msg->payload); + int unique_disk_sequence_number_write = this->simulation_->getOutput().addTimestampDiskWriteStart(Simulation::getCurrentSimulatedDate(), hostname, this->dst_opened_file->get_path(), msg->payload); this->dst_opened_file->write(msg->payload); - this->simulation->getOutput().addTimestampDiskWriteCompletion(Simulation::getCurrentSimulatedDate(), hostname, this->dst_opened_file->get_path(), msg->payload, unique_disk_sequence_number_write); + this->simulation_->getOutput().addTimestampDiskWriteCompletion(Simulation::getCurrentSimulatedDate(), hostname, this->dst_opened_file->get_path(), msg->payload, unique_disk_sequence_number_write); #ifdef PAGE_CACHE_SIMULATION @@ -430,9 +430,9 @@ namespace wrench { throw std::runtime_error("FileTransferThread::receiveFileFromNetwork(): Writing to disk can only be to a SimpleStorageService"); } // simulation->readFromDisk(chunk_size, ss->hostname, location->getDiskOrNull()); - int unique_disk_sequence_number_read = this->simulation->getOutput().addTimestampDiskReadStart(Simulation::getCurrentSimulatedDate(), hostname, src_opened_file->get_path(), chunk_size); + int unique_disk_sequence_number_read = this->simulation_->getOutput().addTimestampDiskReadStart(Simulation::getCurrentSimulatedDate(), hostname, src_opened_file->get_path(), chunk_size); this->src_opened_file->read(chunk_size); - this->simulation->getOutput().addTimestampDiskReadCompletion(Simulation::getCurrentSimulatedDate(), hostname, src_opened_file->get_path(), chunk_size, unique_disk_sequence_number_read); + this->simulation_->getOutput().addTimestampDiskReadCompletion(Simulation::getCurrentSimulatedDate(), hostname, src_opened_file->get_path(), chunk_size, unique_disk_sequence_number_read); #ifdef PAGE_CACHE_SIMULATION } #endif @@ -492,12 +492,12 @@ namespace wrench { double remaining = f->getSize(); while (remaining > DBL_EPSILON) { double to_read = std::min(remaining, this->buffer_size); - int unique_disk_sequence_number_read = this->simulation->getOutput().addTimestampDiskReadStart(Simulation::getCurrentSimulatedDate(), hostname, src_opened_file->get_path(), to_read); + int unique_disk_sequence_number_read = this->simulation_->getOutput().addTimestampDiskReadStart(Simulation::getCurrentSimulatedDate(), hostname, src_opened_file->get_path(), to_read); src_opened_file->read(to_read); - this->simulation->getOutput().addTimestampDiskReadCompletion(Simulation::getCurrentSimulatedDate(), hostname, src_opened_file->get_path(), to_read, unique_disk_sequence_number_read); - int unique_disk_sequence_number_write = this->simulation->getOutput().addTimestampDiskWriteStart(Simulation::getCurrentSimulatedDate(), hostname, dst_opened_file->get_path(), to_read); + this->simulation_->getOutput().addTimestampDiskReadCompletion(Simulation::getCurrentSimulatedDate(), hostname, src_opened_file->get_path(), to_read, unique_disk_sequence_number_read); + int unique_disk_sequence_number_write = this->simulation_->getOutput().addTimestampDiskWriteStart(Simulation::getCurrentSimulatedDate(), hostname, dst_opened_file->get_path(), to_read); dst_opened_file->write(to_read); - this->simulation->getOutput().addTimestampDiskReadCompletion(Simulation::getCurrentSimulatedDate(), hostname, dst_opened_file->get_path(), to_read, unique_disk_sequence_number_write); + this->simulation_->getOutput().addTimestampDiskReadCompletion(Simulation::getCurrentSimulatedDate(), hostname, dst_opened_file->get_path(), to_read, unique_disk_sequence_number_write); remaining -= to_read; } } @@ -592,9 +592,9 @@ namespace wrench { // simulation->writeToDisk(msg->payload, // dst_ss->getHostname(), // dst_loc->getDiskOrNull()); - int unique_disk_sequence_number_write = this->simulation->getOutput().addTimestampDiskWriteStart(Simulation::getCurrentSimulatedDate(), hostname, dst_opened_file->get_path(), msg->payload); + int unique_disk_sequence_number_write = this->simulation_->getOutput().addTimestampDiskWriteStart(Simulation::getCurrentSimulatedDate(), hostname, dst_opened_file->get_path(), msg->payload); dst_opened_file->write(msg->payload); - this->simulation->getOutput().addTimestampDiskWriteCompletion(Simulation::getCurrentSimulatedDate(), hostname, dst_opened_file->get_path(), msg->payload, unique_disk_sequence_number_write); + this->simulation_->getOutput().addTimestampDiskWriteCompletion(Simulation::getCurrentSimulatedDate(), hostname, dst_opened_file->get_path(), msg->payload, unique_disk_sequence_number_write); #ifdef PAGE_CACHE_SIMULATION } @@ -622,9 +622,9 @@ namespace wrench { // simulation->writeToDisk(msg->payload, // dst_ss->getHostname(), // dst_loc->getDiskOrNull()); - int unique_disk_sequence_number_write = this->simulation->getOutput().addTimestampDiskWriteStart(Simulation::getCurrentSimulatedDate(), hostname, dst_opened_file->get_path(), msg->payload); + int unique_disk_sequence_number_write = this->simulation_->getOutput().addTimestampDiskWriteStart(Simulation::getCurrentSimulatedDate(), hostname, dst_opened_file->get_path(), msg->payload); dst_opened_file->write(msg->payload); - this->simulation->getOutput().addTimestampDiskWriteCompletion(Simulation::getCurrentSimulatedDate(), hostname, dst_opened_file->get_path(), msg->payload, unique_disk_sequence_number_write); + this->simulation_->getOutput().addTimestampDiskWriteCompletion(Simulation::getCurrentSimulatedDate(), hostname, dst_opened_file->get_path(), msg->payload, unique_disk_sequence_number_write); #ifdef PAGE_CACHE_SIMULATION } diff --git a/src/wrench/services/storage/xrootd/Node.cpp b/src/wrench/services/storage/xrootd/Node.cpp index b35d24cf6b..8a133bd18a 100644 --- a/src/wrench/services/storage/xrootd/Node.cpp +++ b/src/wrench/services/storage/xrootd/Node.cpp @@ -303,7 +303,7 @@ namespace wrench { if (!children.empty()) {//recursive search shared_ptr answered = make_shared(false); - Alarm::createAndStartAlarm(this->simulation, wrench::S4U_Simulation::getClock() + this->getPropertyValueAsTimeInSecond(Property::FILE_NOT_FOUND_TIMEOUT), this->hostname, this->commport, + Alarm::createAndStartAlarm(this->simulation_, wrench::S4U_Simulation::getClock() + this->getPropertyValueAsTimeInSecond(Property::FILE_NOT_FOUND_TIMEOUT), this->hostname, this->commport, new FileNotFoundAlarm(msg->answer_commport, file, false, answered), "XROOTD_FileNotFoundAlarm"); if (reduced) { WRENCH_DEBUG("Starting advanced lookup for %s", file->getID().c_str()); @@ -403,7 +403,7 @@ namespace wrench { if (!children.empty()) {//recursive search shared_ptr answered = make_shared(false); - Alarm::createAndStartAlarm(this->simulation, wrench::S4U_Simulation::getClock() + this->getPropertyValueAsTimeInSecond(Property::FILE_NOT_FOUND_TIMEOUT), this->hostname, this->commport, + Alarm::createAndStartAlarm(this->simulation_, wrench::S4U_Simulation::getClock() + this->getPropertyValueAsTimeInSecond(Property::FILE_NOT_FOUND_TIMEOUT), this->hostname, this->commport, new FileNotFoundAlarm(msg->answer_commport, file, true, answered), "XROOTD_FileNotFoundAlarm"); if (reduced) { WRENCH_DEBUG("Starting advanced search for %s", file->getID().c_str()); diff --git a/src/wrench/simgrid_S4U_util/S4U_Daemon.cpp b/src/wrench/simgrid_S4U_util/S4U_Daemon.cpp index 174b186ebd..552db0cb5f 100644 --- a/src/wrench/simgrid_S4U_util/S4U_Daemon.cpp +++ b/src/wrench/simgrid_S4U_util/S4U_Daemon.cpp @@ -75,11 +75,11 @@ namespace wrench { this->daemon_lock = simgrid::s4u::Mutex::create(); this->hostname = hostname; this->host = S4U_Simulation::get_host_or_vm_by_name(hostname); - this->simulation = nullptr; + this->simulation_ = nullptr; unsigned long seq = S4U_CommPort::generateUniqueSequenceNumber(); this->process_name = process_name_prefix + "_" + std::to_string(seq); - this->has_returned_from_main = false; + this->has_returned_from_main_ = false; // std::cerr << "IN DAEMON CONSTRUCTOR: " << this->process_name << "\n"; this->commport = S4U_CommPort::getTemporaryCommPort(); @@ -177,7 +177,7 @@ namespace wrench { } // Check that the simulation pointer is set - if (not this->simulation) { + if (not this->simulation_) { throw std::runtime_error( "S4U_Daemon::startDaemon(): You must set the simulation field before calling startDaemon() (" + this->getName() + ")"); @@ -188,9 +188,9 @@ namespace wrench { throw ExecutionException(std::make_shared(hostname)); } - this->daemonized = daemonized; - this->auto_restart = auto_restart; - this->has_returned_from_main = false; + this->daemonized_ = daemonized; + this->auto_restart_ = auto_restart; + this->has_returned_from_main_ = false; // this->commport = this->initial_commport + "_#" + std::to_string(this->num_starts); // Create the s4u_actor @@ -213,17 +213,17 @@ namespace wrench { // right away, in which case calling daemonize() on it cases the calling actor to // terminate immediately. This is a weird simgrid::s4u behavior/bug, that may be // fixed at some point, but this test saves us for now. - if (not this->has_returned_from_main) { + if (not this->has_returned_from_main_) { this->setupOnExitFunction(); - if (this->daemonized) { + if (this->daemonized_) { this->s4u_actor->daemonize(); } else { S4U_Daemon::num_non_daemonized_actors_running++; } - if (this->auto_restart) { + if (this->auto_restart_) { this->s4u_actor->set_auto_restart(true); } } @@ -234,7 +234,7 @@ namespace wrench { */ void S4U_Daemon::setupOnExitFunction() { this->s4u_actor->on_exit([this](bool failed) { - if (not this->daemonized) { + if (not this->daemonized_) { S4U_Daemon::num_non_daemonized_actors_running--; } // std::cerr << "*** NUM_NON_DAEMIONIZED_ACTORS_RUNNING = " << S4U_Daemon::num_non_daemonized_actors_running << "\n"; @@ -260,7 +260,7 @@ namespace wrench { * @return true or false */ bool S4U_Daemon::isSetToAutoRestart() const { - return this->auto_restart; + return this->auto_restart_; } /** @@ -268,7 +268,7 @@ namespace wrench { * @return true or false */ bool S4U_Daemon::isDaemonized() const { - return this->daemonized; + return this->daemonized_; } /** @@ -290,8 +290,8 @@ namespace wrench { // until the host has a >0 pstate S4U_Simulation::computeZeroFlop(); this->state = State::UP; - this->return_value = this->main(); - this->has_returned_from_main = true; + this->return_value_ = this->main(); + this->has_returned_from_main_ = true; this->state = State::DOWN; S4U_Daemon::map_actor_to_recv_commport.erase(simgrid::s4u::this_actor::get_pid()); @@ -310,7 +310,7 @@ namespace wrench { */ bool S4U_Daemon::killActor() { // Do the kill only if valid actor and not already done - if ((this->s4u_actor != nullptr) && (not this->has_returned_from_main)) { + if ((this->s4u_actor != nullptr) && (not this->has_returned_from_main_)) { try { this->s4u_actor->kill(); } catch (simgrid::Exception &e) { @@ -318,7 +318,7 @@ namespace wrench { } // Really not sure why now we're setting this to true... but if we don't some tests fail. // Something to investigate at some point - this->has_returned_from_main = true; + this->has_returned_from_main_ = true; return true; } else { return false; @@ -329,7 +329,7 @@ namespace wrench { * @brief Suspend the daemon/actor. */ void S4U_Daemon::suspendActor() { - if ((this->s4u_actor != nullptr) && (not this->has_returned_from_main)) { + if ((this->s4u_actor != nullptr) && (not this->has_returned_from_main_)) { this->s4u_actor->suspend(); } } @@ -338,7 +338,7 @@ namespace wrench { * @brief Resume the daemon/actor. */ void S4U_Daemon::resumeActor() { - if ((this->s4u_actor != nullptr) && (not this->has_returned_from_main)) { + if ((this->s4u_actor != nullptr) && (not this->has_returned_from_main_)) { this->s4u_actor->resume(); } } @@ -364,7 +364,7 @@ namespace wrench { * @return The true or false */ bool S4U_Daemon::hasReturnedFromMain() const { - return this->has_returned_from_main; + return this->has_returned_from_main_; } /** @@ -372,7 +372,7 @@ namespace wrench { * @return The return value */ int S4U_Daemon::getReturnValue() const { - return this->return_value; + return this->return_value_; } /** @@ -415,7 +415,7 @@ namespace wrench { * @return a simulation */ Simulation *S4U_Daemon::getSimulation() { - return this->simulation; + return this->simulation_; } /** @@ -423,7 +423,7 @@ namespace wrench { * @param simulation: a simulation */ void S4U_Daemon::setSimulation(Simulation *simulation) { - this->simulation = simulation; + this->simulation_ = simulation; } /** diff --git a/src/wrench/simulation/Simulation.cpp b/src/wrench/simulation/Simulation.cpp index 12e65ce6eb..6c5daa43eb 100644 --- a/src/wrench/simulation/Simulation.cpp +++ b/src/wrench/simulation/Simulation.cpp @@ -8,11 +8,11 @@ * */ +#include #include #include #include -#include #include #include #include @@ -21,7 +21,7 @@ #include #include "simgrid/plugins/energy.h" #include -#include +//#include #include #ifdef MESSAGE_MANAGER @@ -70,7 +70,7 @@ namespace wrench { // Customize the logging format xbt_log_control_set("root.fmt:[%.20d][%h:%t(%i)]%e%m%n"); - // Setup the SIGABRT handler + // Set up the SIGABRT handler auto previous_handler = std::signal(SIGABRT, signal_handler); if (previous_handler == SIG_ERR) { std::cerr << "SIGABRT handler setup failed... uncaught exceptions will lead to unclean terminations\n"; @@ -166,7 +166,7 @@ namespace wrench { } ptr++; } - S4U_CommPort::default_control_message_size = strtod(equal_sign + 1, nullptr); + S4U_CommPort::default_control_message_size = strtoll(equal_sign + 1, nullptr, 10); default_control_message_size_set = true; } else if (not strcmp(argv[i], "--wrench-energy-simulation")) { sg_host_energy_plugin_init(); @@ -565,7 +565,7 @@ namespace wrench { throw std::runtime_error("Simulation is not initialized"); } - // Check that a platform has been setup + // Check that a platform has been set up if (not this->s4u_simulation->isPlatformSetup()) { throw std::runtime_error("Simulation platform has not been setup"); } @@ -585,7 +585,7 @@ namespace wrench { // Start the execution controllers for (const auto &execution_controller: this->execution_controllers) { - execution_controller->start(execution_controller, execution_controller->daemonized, false);// Not daemonized, no auto-restart + execution_controller->start(execution_controller, execution_controller->daemonized_, false);// Not daemonized, no auto-restart } // Start the compute services @@ -634,7 +634,7 @@ namespace wrench { if (service == nullptr) { throw std::invalid_argument("Simulation::addService(): invalid argument (nullptr service)"); } - service->simulation = this; + service->simulation_ = this; this->compute_services.insert(service); } @@ -648,7 +648,7 @@ namespace wrench { if (service == nullptr) { throw std::invalid_argument("Simulation::addService(): invalid argument (nullptr service)"); } - service->simulation = this; + service->simulation_ = this; this->network_proximity_services.insert(service); } @@ -662,7 +662,7 @@ namespace wrench { if (service == nullptr) { throw std::invalid_argument("Simulation::addService(): invalid argument (nullptr service)"); } - service->simulation = this; + service->simulation_ = this; this->storage_services.insert(service); } @@ -676,7 +676,7 @@ namespace wrench { if (service == nullptr) { throw std::invalid_argument("Simulation::addService(): invalid argument (nullptr service)"); } - service->simulation = this; + service->simulation_ = this; this->execution_controllers.insert(service); } @@ -690,7 +690,7 @@ namespace wrench { if (service == nullptr) { throw std::invalid_argument("Simulation::addService(): invalid argument (nullptr service)"); } - service->simulation = this; + service->simulation_ = this; this->file_registry_services.insert(service); } @@ -704,7 +704,7 @@ namespace wrench { if (service == nullptr) { throw std::invalid_argument("Simulation::addService(): invalid argument (nullptr service)"); } - service->simulation = this; + service->simulation_ = this; this->energy_meter_services.insert(service); } @@ -718,7 +718,7 @@ namespace wrench { if (service == nullptr) { throw std::invalid_argument("Simulation::addService(): invalid argument (nullptr service)"); } - service->simulation = this; + service->simulation_ = this; this->bandwidth_meter_services.insert(service); } @@ -799,15 +799,15 @@ namespace wrench { */ void Simulation::readFromDisk(sg_size_t num_bytes, const std::string &hostname, simgrid::s4u::Disk *disk) { std::string mount_point = disk->get_property("mount"); - int unique_disk_sequence_number = this->getOutput().addTimestampDiskReadStart(Simulation::getCurrentSimulatedDate(), hostname, mount_point, num_bytes); + int unique_disk_sequence_number_read = this->getOutput().addTimestampDiskReadStart(Simulation::getCurrentSimulatedDate(), hostname, mount_point, num_bytes); try { S4U_Simulation::readFromDisk(num_bytes, hostname, mount_point, disk); } catch (const std::invalid_argument &ia) { this->getOutput().addTimestampDiskReadFailure(Simulation::getCurrentSimulatedDate(), hostname, mount_point, num_bytes, - unique_disk_sequence_number); + unique_disk_sequence_number_read); throw; } - this->getOutput().addTimestampDiskReadCompletion(Simulation::getCurrentSimulatedDate(), hostname, mount_point, num_bytes, unique_disk_sequence_number); + this->getOutput().addTimestampDiskReadCompletion(Simulation::getCurrentSimulatedDate(), hostname, mount_point, num_bytes, unique_disk_sequence_number_read); } /** @@ -855,16 +855,16 @@ namespace wrench { */ void Simulation::writeToDisk(sg_size_t num_bytes, const std::string &hostname, simgrid::s4u::Disk *disk) { std::string mount_point = disk->get_property("mount"); - int unique_disk_sequence_number = this->getOutput().addTimestampDiskWriteStart(Simulation::getCurrentSimulatedDate(), hostname, mount_point, num_bytes); + int unique_disk_sequence_number_write = this->getOutput().addTimestampDiskWriteStart(Simulation::getCurrentSimulatedDate(), hostname, mount_point, num_bytes); try { S4U_Simulation::writeToDisk(num_bytes, hostname, mount_point, disk); } catch (const std::invalid_argument &ia) { this->getOutput().addTimestampDiskWriteFailure(Simulation::getCurrentSimulatedDate(), hostname, mount_point, num_bytes, - unique_disk_sequence_number); + unique_disk_sequence_number_write); throw; } this->getOutput().addTimestampDiskWriteCompletion(Simulation::getCurrentSimulatedDate(), hostname, mount_point, num_bytes, - unique_disk_sequence_number); + unique_disk_sequence_number_write); } #ifdef PAGE_CACHE_SIMULATION @@ -1130,7 +1130,7 @@ namespace wrench { * @brief Get the memory_manager_service capacity of the host on which the calling process is running * @return a memory_manager_service capacity in bytes */ - double Simulation::getMemoryCapacity() { + sg_size_t Simulation::getMemoryCapacity() { return S4U_Simulation::getMemoryCapacity(); } @@ -1271,7 +1271,7 @@ namespace wrench { * @param hostname: the host name * @return The number of power states available for the host (as specified in the platform xml description file) */ - int Simulation::getNumberofPstates(const std::string &hostname) { + int Simulation::getNumberOfPstates(const std::string &hostname) { return S4U_Simulation::getNumberofPstates(hostname); } @@ -1327,7 +1327,7 @@ namespace wrench { throw std::runtime_error("Simulation::startNewService(): simulation is not running yet"); } - service->simulation = this; + service->simulation_ = this; std::shared_ptr shared_ptr = std::shared_ptr(service); this->compute_services.insert(shared_ptr); shared_ptr->start(shared_ptr, true, false);// Daemonized, no auto-restart @@ -1356,7 +1356,7 @@ namespace wrench { } - service->simulation = this; + service->simulation_ = this; std::shared_ptr shared_ptr = std::shared_ptr(service); this->storage_services.insert(shared_ptr); shared_ptr->start(shared_ptr, true, false);// Daemonized, no auto-restart @@ -1380,7 +1380,7 @@ namespace wrench { throw std::runtime_error("Simulation::startNewService(): simulation is not running yet"); } - service->simulation = this; + service->simulation_ = this; std::shared_ptr shared_ptr = std::shared_ptr(service); this->network_proximity_services.insert(shared_ptr); shared_ptr->start(shared_ptr, true, false);// Daemonized, no auto-restart @@ -1404,7 +1404,7 @@ namespace wrench { throw std::runtime_error("Simulation::startNewService(): simulation is not running yet"); } - service->simulation = this; + service->simulation_ = this; std::shared_ptr shared_ptr = std::shared_ptr(service); this->file_registry_services.insert(shared_ptr); shared_ptr->start(shared_ptr, true, false);// Daemonized, no auto-restart @@ -1429,7 +1429,7 @@ namespace wrench { throw std::runtime_error("Simulation::startNewService(): simulation is not running yet"); } - service->simulation = this; + service->simulation_ = this; std::shared_ptr shared_ptr = std::shared_ptr(service); this->memory_managers.insert(shared_ptr); shared_ptr->start(shared_ptr, true, false);// Daemonized, no auto-restart diff --git a/src/wrench/simulation/SimulationOutput.cpp b/src/wrench/simulation/SimulationOutput.cpp index bf7e2520e0..05f4e4c1b3 100755 --- a/src/wrench/simulation/SimulationOutput.cpp +++ b/src/wrench/simulation/SimulationOutput.cpp @@ -648,7 +648,7 @@ namespace wrench { } } - // Set the "vertical position" of each WorkflowExecutionInstance so we know where to plot each rectangle + // Set the "vertical position" of each WorkflowExecutionInstance, so we know where to plot each rectangle if (generate_host_utilization_layout) { generateHostUtilizationGraphLayout(data); std::ofstream output("host_utilization_layout.json"); @@ -1046,7 +1046,7 @@ namespace wrench { platform_graph_json["routes"].push_back(route_forward_json); // populate "route_backward" with an ordered list of network links along - // the route between target and source; the "route_backward" could be different + // the route between target and source; the "route_backward" could be different, // so we need to add it if it is in fact different nlohmann::json route_backward_json; (*target)->route_to(*source, route_backward, &route_backward_latency); @@ -1355,7 +1355,7 @@ namespace wrench { /** Writes a JSON file containing link usage information as a JSON array. * - * This information will not be generated without using the bandwidth meter service and providing it with linknames + * This information will not be generated without using the bandwidth meter service and providing it with link names * to monitor. * *
@@ -1463,7 +1463,7 @@ namespace wrench {
         this->setEnabled(false);
         this->setEnabled(false);
 
-        // By default disable (for now) all disk write timestamps
+        // By default, disable (for now) all disk write timestamps
         this->setEnabled(false);
         this->setEnabled(false);
         this->setEnabled(false);
@@ -1702,7 +1702,7 @@ namespace wrench {
     int SimulationOutput::addTimestampDiskReadStart(double date,
                                                      std::string hostname,
                                                      std::string path,
-                                                     double bytes) {
+                                                     sg_size_t bytes) {
         if (this->isEnabled()) {
             SimulationOutput::unique_disk_sequence_number++;
             this->addTimestamp(
@@ -1721,7 +1721,7 @@ namespace wrench {
      */
     void SimulationOutput::addTimestampDiskReadFailure(double date, const std::string &hostname,
                                                        const std::string &path,
-                                                       double bytes,
+                                                       sg_size_t bytes,
                                                        int unique_sequence_number) {
         if (this->isEnabled()) {
             this->addTimestamp(
@@ -1739,7 +1739,7 @@ namespace wrench {
      */
     void SimulationOutput::addTimestampDiskReadCompletion(double date, const std::string &hostname,
                                                           const std::string &path,
-                                                          double bytes,
+                                                          sg_size_t bytes,
                                                           int unique_sequence_number) {
         if (this->isEnabled()) {
             this->addTimestamp(
@@ -1757,7 +1757,7 @@ namespace wrench {
      */
     int SimulationOutput::addTimestampDiskWriteStart(double date, std::string hostname,
                                                       std::string path,
-                                                      double bytes) {
+                                                      sg_size_t bytes) {
         if (this->isEnabled()) {
             SimulationOutput::unique_disk_sequence_number++;
             this->addTimestamp(
@@ -1776,7 +1776,7 @@ namespace wrench {
      */
     void SimulationOutput::addTimestampDiskWriteFailure(double date, const std::string &hostname,
                                                         const std::string &path,
-                                                        double bytes,
+                                                        sg_size_t bytes,
                                                         int unique_sequence_number) {
         if (this->isEnabled()) {
             this->addTimestamp(
@@ -1794,7 +1794,7 @@ namespace wrench {
     */
     void SimulationOutput::addTimestampDiskWriteCompletion(double date, const std::string &hostname,
                                                            const std::string &path,
-                                                           double bytes,
+                                                           sg_size_t bytes,
                                                            int unique_sequence_number) {
         if (this->isEnabled()) {
             this->addTimestamp(
@@ -1856,10 +1856,10 @@ namespace wrench {
     /**
      * @brief Add a link usage timestamp
      * @param date: the date
-     * @param linkname: a linkname
+     * @param link_name: a link name
      * @param bytes_per_second: link usage in bytes_per_second
      */
-    void SimulationOutput::addTimestampLinkUsage(double date, const std::string &linkname,
+    void SimulationOutput::addTimestampLinkUsage(double date, const std::string &link_name,
                                                  double bytes_per_second) {
         static std::unordered_map> last_two_timestamps;
 
@@ -1867,25 +1867,25 @@ namespace wrench {
             return;
         }
 
-        auto new_timestamp = new SimulationTimestampLinkUsage(date, linkname, bytes_per_second);
+        auto new_timestamp = new SimulationTimestampLinkUsage(date, link_name, bytes_per_second);
 
         // If less thant 2 time-stamp for that link, just record and add
-        if (last_two_timestamps[linkname].size() < 2) {
-            last_two_timestamps[linkname].push_back(new_timestamp);
+        if (last_two_timestamps[link_name].size() < 2) {
+            last_two_timestamps[link_name].push_back(new_timestamp);
             this->addTimestamp(new_timestamp);
             return;
         }
 
         // Otherwise, check whether we can merge
-        bool can_merge = DBL_EQUAL(last_two_timestamps[linkname].at(0)->getUsage(),
-                                   last_two_timestamps[linkname].at(1)->getUsage()) and
-                         DBL_EQUAL(last_two_timestamps[linkname].at(1)->getUsage(), new_timestamp->getUsage());
+        bool can_merge = DBL_EQUAL(last_two_timestamps[link_name].at(0)->getUsage(),
+                                   last_two_timestamps[link_name].at(1)->getUsage()) and
+                         DBL_EQUAL(last_two_timestamps[link_name].at(1)->getUsage(), new_timestamp->getUsage());
 
         if (can_merge) {
-            last_two_timestamps[linkname].at(1)->setDate(new_timestamp->getDate());
+            last_two_timestamps[link_name].at(1)->setDate(new_timestamp->getDate());
         } else {
-            last_two_timestamps[linkname][0] = last_two_timestamps[linkname][1];
-            last_two_timestamps[linkname][1] = new_timestamp;
+            last_two_timestamps[link_name][0] = last_two_timestamps[link_name][1];
+            last_two_timestamps[link_name][1] = new_timestamp;
             this->addTimestamp(new_timestamp);
         }
     }
diff --git a/src/wrench/util/UnitParser.cpp b/src/wrench/util/UnitParser.cpp
index 620dad834c..02ac802fc5 100755
--- a/src/wrench/util/UnitParser.cpp
+++ b/src/wrench/util/UnitParser.cpp
@@ -13,7 +13,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 
diff --git a/src/wrench/workflow/parallel_model/AmdahlParallelModel.cpp b/src/wrench/workflow/parallel_model/AmdahlParallelModel.cpp
index 2e8d6601c2..0037cf45cd 100644
--- a/src/wrench/workflow/parallel_model/AmdahlParallelModel.cpp
+++ b/src/wrench/workflow/parallel_model/AmdahlParallelModel.cpp
@@ -28,7 +28,7 @@ namespace wrench {
             throw std::invalid_argument("AmdahlParallelModel::AmdahlParallelModel(): "
                                         "Invalid alpha argument (must be between 0.0 and 1.0)");
         }
-        this->alpha = alpha;
+        this->alpha_ = alpha;
     }
 
     /**
@@ -36,7 +36,7 @@ namespace wrench {
      * @return the alpha parameter (a value between 0.9 and 1.0)
      */
     double AmdahlParallelModel::getAlpha() const {
-        return this->alpha;
+        return this->alpha_;
     }
 
     /**
@@ -44,7 +44,7 @@ namespace wrench {
      * @param alpha: the alpha parameter (a value between 0.9 and 1.0)
      */
     void AmdahlParallelModel::setAlpha(double alpha) {
-        this->alpha = alpha;
+        this->alpha_ = alpha;
     }
 
 
@@ -55,7 +55,7 @@ namespace wrench {
      * @return an amount of work in flops
      */
     double AmdahlParallelModel::getPurelySequentialWork(double total_work, unsigned long num_threads) {
-        return (1 - this->alpha) * total_work;
+        return (1 - this->alpha_) * total_work;
     }
 
     /**
@@ -65,6 +65,6 @@ namespace wrench {
      * @return an amount of work in flops
      */
     double AmdahlParallelModel::getParallelPerThreadWork(double total_work, unsigned long num_threads) {
-        return (total_work * this->alpha) / (double) num_threads;
+        return (total_work * this->alpha_) / (double) num_threads;
     }
 }// namespace wrench
diff --git a/src/wrench/workflow/parallel_model/ConstantEfficiencyParallelModel.cpp b/src/wrench/workflow/parallel_model/ConstantEfficiencyParallelModel.cpp
index 1d83742bd9..507edf2670 100644
--- a/src/wrench/workflow/parallel_model/ConstantEfficiencyParallelModel.cpp
+++ b/src/wrench/workflow/parallel_model/ConstantEfficiencyParallelModel.cpp
@@ -25,7 +25,7 @@ namespace wrench {
             throw std::invalid_argument("ConstantEfficiencyParallelModel::ConstantEfficiencyParallelModel(): "
                                         "Invalid efficiency argument (must be between 0.0 and 1.0)");
         }
-        this->efficiency = efficiency;
+        this->efficiency_ = efficiency;
     }
 
     /**
@@ -33,15 +33,15 @@ namespace wrench {
      * @return a parallel efficiency (a number between 0.0 and 1.0)
      */
     double wrench::ConstantEfficiencyParallelModel::getEfficiency() const {
-        return this->efficiency;
+        return this->efficiency_;
     }
 
     /**
      * @brief Set the model's parallel efficiency
-     * @param efficiency: a parallel efficiency (a number between 0.0 and 1.0)
+     * @param eff: a parallel efficiency (a number between 0.0 and 1.0)
      */
     void wrench::ConstantEfficiencyParallelModel::setEfficiency(double efficiency) {
-        this->efficiency = efficiency;
+        this->efficiency_ = efficiency;
     }
 
     //    /**
@@ -78,7 +78,7 @@ namespace wrench {
      * @return an amount of work (in flops)
      */
     double ConstantEfficiencyParallelModel::getParallelPerThreadWork(double total_work, unsigned long num_threads) {
-        return (total_work) / ((double) num_threads * this->efficiency);
+        return (total_work) / ((double) num_threads * this->efficiency_);
     }
 
 }// namespace wrench
diff --git a/test/constructors/simulation_message_constructors/MessageConstructorTest.cpp b/test/constructors/simulation_message_constructors/MessageConstructorTest.cpp
index 5d741e5d94..c84eef1375 100644
--- a/test/constructors/simulation_message_constructors/MessageConstructorTest.cpp
+++ b/test/constructors/simulation_message_constructors/MessageConstructorTest.cpp
@@ -123,7 +123,7 @@ class MessageConstructorTestWMS : public wrench::ExecutionController {
         auto commport = wrench::S4U_CommPort::getTemporaryCommPort();
 
         auto network_proximity_daemon = std::shared_ptr(
-                new wrench::NetworkProximitySenderDaemon(this->simulation, "Host1",
+                new wrench::NetworkProximitySenderDaemon(this->getSimulation(), "Host1",
                                                          commport,
                                                          10.0, 1.0,
                                                          1.0, 0, {}));
diff --git a/test/energy_consumption/EnergyConsumptionTest.cpp b/test/energy_consumption/EnergyConsumptionTest.cpp
index 5aab1f0c38..d9b8e11087 100644
--- a/test/energy_consumption/EnergyConsumptionTest.cpp
+++ b/test/energy_consumption/EnergyConsumptionTest.cpp
@@ -173,27 +173,27 @@ class EnergyApiAccessExceptionsTestWMS : public wrench::ExecutionController {
 
 
             try {
-                this->simulation->getEnergyConsumed("dummy_unavailable_host");
+                this->getSimulation()->getEnergyConsumed("dummy_unavailable_host");
                 throw std::runtime_error("Should not have been able to read the energy for dummy hosts");
             } catch (std::invalid_argument &e) {
             }
 
             try {
-                std::map value = this->simulation->getEnergyConsumed(std::vector({"dummy_unavailable_host"}));
+                std::map value = this->getSimulation()->getEnergyConsumed(std::vector({"dummy_unavailable_host"}));
                 throw std::runtime_error(
                         "Should not have been able to read the energy for dummy hosts");
             } catch (std::invalid_argument &e) {
             }
 
             try {
-                this->simulation->getNumberofPstates("dummy_unavailable_host");
+                this->getSimulation()->getNumberOfPstates("dummy_unavailable_host");
                 throw std::runtime_error(
                         "Should not have been able to read the energy for dummy hosts");
             } catch (std::invalid_argument &e) {
             }
 
             try {
-                double value = this->simulation->getCurrentPstate("dummy_unavailable_host");
+                double value = this->getSimulation()->getCurrentPstate("dummy_unavailable_host");
                 throw std::runtime_error(
                         "Should not have been able to read the energy for dummy hosts");
             } catch (std::invalid_argument &e) {
@@ -201,35 +201,35 @@ class EnergyApiAccessExceptionsTestWMS : public wrench::ExecutionController {
 
 
             try {
-                this->simulation->getMinPowerConsumption("dummy_unavailable_host");
+                this->getSimulation()->getMinPowerConsumption("dummy_unavailable_host");
                 throw std::runtime_error(
                         "Should not have been able to read the energy for dummy hosts");
             } catch (std::invalid_argument &e) {
             }
 
             try {
-                double value = this->simulation->getMaxPowerConsumption("dummy_unavailable_host");
+                double value = this->getSimulation()->getMaxPowerConsumption("dummy_unavailable_host");
                 throw std::runtime_error(
                         "Should not have been able to read the energy for dummy hosts");
             } catch (std::invalid_argument &e) {
             }
 
             try {
-                this->simulation->setPstate("dummy_unavailable_host", 1);
+                this->getSimulation()->setPstate("dummy_unavailable_host", 1);
                 throw std::runtime_error(
                         "Should not have been able to read the energy for dummy hosts");
             } catch (std::invalid_argument &e) {
             }
 
             try {
-                this->simulation->setPstate("dummy_unavailable_host", 2);
+                this->getSimulation()->setPstate("dummy_unavailable_host", 2);
                 throw std::runtime_error(
                         "Should not have been able to read the energy for dummy hosts");
             } catch (std::invalid_argument &e) {
             }
 
             try {
-                this->simulation->setPstate("MyHost1", 1000);
+                this->getSimulation()->setPstate("MyHost1", 1000);
                 throw std::runtime_error(
                         "Should not have been able to set a bogus pstate");
             } catch (std::invalid_argument &e) {
@@ -344,20 +344,20 @@ class EnergyApiAccessExceptionsPluginNotActiveTestWMS : public wrench::Execution
             this->waitForAndProcessNextEvent();
 
             try {
-                this->simulation->getEnergyConsumed("MyHost1");
+                this->getSimulation()->getEnergyConsumed("MyHost1");
                 throw std::runtime_error("Should not have been able to read the energy without activating energy plugin");
             } catch (std::runtime_error &e) {
             }
 
             try {
-                std::map value = this->simulation->getEnergyConsumed(std::vector({"MyHost1"}));
+                std::map value = this->getSimulation()->getEnergyConsumed(std::vector({"MyHost1"}));
                 throw std::runtime_error(
                         "Should not have been able to read the energy without activating energy plugin");
             } catch (std::runtime_error &e) {
             }
 
             try {
-                wrench::Simulation::getNumberofPstates("MyHost1");
+                wrench::Simulation::getNumberOfPstates("MyHost1");
                 throw std::runtime_error(
                         "Should not have been able to read the energy without activating energy plugin");
             } catch (std::runtime_error &e) {
@@ -385,7 +385,7 @@ class EnergyApiAccessExceptionsPluginNotActiveTestWMS : public wrench::Execution
             }
 
             try {
-                this->simulation->setPstate("MyHost1", 1);
+                this->getSimulation()->setPstate("MyHost1", 1);
                 throw std::runtime_error(
                         "Should not have been able to set the pstate without activating energy plugin");
             } catch (std::runtime_error &e) {
@@ -600,9 +600,9 @@ class EnergyAPICheckTestWMS : public wrench::ExecutionController {
         {
             std::vector simulation_hosts = wrench::Simulation::getHostnameList();
 
-            int cur_pstate = this->simulation->getCurrentPstate(simulation_hosts[1]);
-            this->simulation->getMaxPowerConsumption(simulation_hosts[1]);
-            this->simulation->getMinPowerConsumption(simulation_hosts[1]);
+            int cur_pstate = this->getSimulation()->getCurrentPstate(simulation_hosts[1]);
+            this->getSimulation()->getMaxPowerConsumption(simulation_hosts[1]);
+            this->getSimulation()->getMinPowerConsumption(simulation_hosts[1]);
             //switch pstates right off the bat
 
             // coverage
@@ -617,40 +617,40 @@ class EnergyAPICheckTestWMS : public wrench::ExecutionController {
             std::vector list_of_pstates = wrench::Simulation::getListOfPstates(simulation_hosts[1]);
             int max_num_pstate = list_of_pstates.size();
             int pstate = std::max(0, max_num_pstate - 1);
-            this->simulation->setPstate(simulation_hosts[1], pstate);
+            this->getSimulation()->setPstate(simulation_hosts[1], pstate);
 
             //check if the changed pstate is not equal to the current pstate
-            if (cur_pstate == this->simulation->getCurrentPstate(simulation_hosts[1])) {
+            if (cur_pstate == this->getSimulation()->getCurrentPstate(simulation_hosts[1])) {
                 throw std::runtime_error(
                         "The pstate should have changed but it did not change");
             }
 
             //check if the max power possible/min power available in this pstate is different than the maximum power possible/min power available in the previous state
             for (auto host: simulation_hosts) {
-                std::vector states = this->simulation->getListOfPstates(host);
+                std::vector states = this->getSimulation()->getListOfPstates(host);
                 int prev_max_power = -1;
                 int prev_min_power = -1;
                 for (auto state: states) {
                     //check if max power is different in all the states as is in xml
-                    this->simulation->setPstate(host, state);
-                    if (prev_max_power == this->simulation->getMaxPowerConsumption(host)) {
+                    this->getSimulation()->setPstate(host, state);
+                    if (prev_max_power == this->getSimulation()->getMaxPowerConsumption(host)) {
                         throw std::runtime_error(
                                 "The max power from the xml and the APIs do not match");
                     }
-                    prev_max_power = this->simulation->getMaxPowerConsumption(host);
+                    prev_max_power = this->getSimulation()->getMaxPowerConsumption(host);
 
                     //check if the min power is different in all the states as is in xml
-                    this->simulation->setPstate(host, state);
-                    if (prev_min_power == this->simulation->getMinPowerConsumption(host)) {
+                    this->getSimulation()->setPstate(host, state);
+                    if (prev_min_power == this->getSimulation()->getMinPowerConsumption(host)) {
                         throw std::runtime_error(
                                 "The min power from the xml and the APIs do not match");
                     }
-                    prev_min_power = this->simulation->getMinPowerConsumption(host);
+                    prev_min_power = this->getSimulation()->getMinPowerConsumption(host);
                 }
             }
             //lets check if the energy consumed by host1 is less than the energy consumed by host1 + host2
-            double energy_consumed_1 = this->simulation->getEnergyConsumed(simulation_hosts[1]);
-            std::map energy_consumed_2_map = this->simulation->getEnergyConsumed(std::vector({simulation_hosts[1], simulation_hosts[2]}));
+            double energy_consumed_1 = this->getSimulation()->getEnergyConsumed(simulation_hosts[1]);
+            std::map energy_consumed_2_map = this->getSimulation()->getEnergyConsumed(std::vector({simulation_hosts[1], simulation_hosts[2]}));
             double energy_consumed_2 = 0.0;
             for (auto const &h: energy_consumed_2_map) {
                 energy_consumed_2 += h.second;
@@ -770,7 +770,7 @@ class EnergyConsumptionPStateChangeTestWMS : public wrench::ExecutionController
 
 
             //First energy consumption test
-            double before_current_energy_consumed_by_host1 = this->simulation->getEnergyConsumed(simulation_hosts[1]);
+            double before_current_energy_consumed_by_host1 = this->getSimulation()->getEnergyConsumed(simulation_hosts[1]);
             //run a new job
             //let's execute the job, this should take ~100 sec based on the 100MF speed
             std::string my_commport = "test_callback_commport";
@@ -778,7 +778,7 @@ class EnergyConsumptionPStateChangeTestWMS : public wrench::ExecutionController
             job_manager->submitJob(job1, this->test->compute_service);
             this->waitForAndProcessNextEvent();
 
-            double after_current_energy_consumed_by_host1 = this->simulation->getEnergyConsumed(simulation_hosts[1]);
+            double after_current_energy_consumed_by_host1 = this->getSimulation()->getEnergyConsumed(simulation_hosts[1]);
             double energy_consumed_while_running_with_higher_speed = after_current_energy_consumed_by_host1 - before_current_energy_consumed_by_host1;
             double higher_speed_compuation_time = wrench::S4U_Simulation::getClock();
 
@@ -788,13 +788,13 @@ class EnergyConsumptionPStateChangeTestWMS : public wrench::ExecutionController
             }
 
             //switch pstate
-            int max_pstate_possible = this->simulation->getNumberofPstates(simulation_hosts[1]);
+            int max_pstate_possible = this->getSimulation()->getNumberOfPstates(simulation_hosts[1]);
             //let's directly switch to pstate 2
             int pstate = 2;
-            this->simulation->setPstate(simulation_hosts[1], pstate);
+            this->getSimulation()->setPstate(simulation_hosts[1], pstate);
 
             //Second energy consumption test
-            double before_current_energy_consumed_by_host2 = this->simulation->getEnergyConsumed(simulation_hosts[1]);
+            double before_current_energy_consumed_by_host2 = this->getSimulation()->getEnergyConsumed(simulation_hosts[1]);
             //run a new job
             //let's execute the job, this should take ~100 sec based on the 100MF speed
             my_commport = "test_callback_commport";
@@ -802,7 +802,7 @@ class EnergyConsumptionPStateChangeTestWMS : public wrench::ExecutionController
             job_manager->submitJob(job2, this->test->compute_service);
             this->waitForAndProcessNextEvent();
 
-            double after_current_energy_consumed_by_host2 = this->simulation->getEnergyConsumed(simulation_hosts[1]);
+            double after_current_energy_consumed_by_host2 = this->getSimulation()->getEnergyConsumed(simulation_hosts[1]);
             double energy_consumed_while_running_with_lower_speed = after_current_energy_consumed_by_host2 - before_current_energy_consumed_by_host2;
             double lower_speed_computation_time = wrench::S4U_Simulation::getClock() - higher_speed_compuation_time;
 
@@ -924,15 +924,15 @@ class PluginNotActivatedTestWMS : public wrench::ExecutionController {
         {
             std::vector simulation_hosts = wrench::Simulation::getHostnameList();
 
-            double after_current_energy_consumed_by_host1 = this->simulation->getEnergyConsumed(simulation_hosts[1]);
+            double after_current_energy_consumed_by_host1 = this->getSimulation()->getEnergyConsumed(simulation_hosts[1]);
 
             //switch pstate
-            int max_pstate_possible = this->simulation->getNumberofPstates(simulation_hosts[1]);
+            int max_pstate_possible = this->getSimulation()->getNumberOfPstates(simulation_hosts[1]);
             //let's directly switch to pstate 2
 
             //Second energy consumption test
             wrench::Simulation::sleep(10);
-            double before_current_energy_consumed_by_host2 = this->simulation->getEnergyConsumed(simulation_hosts[1]);
+            double before_current_energy_consumed_by_host2 = this->getSimulation()->getEnergyConsumed(simulation_hosts[1]);
         }
 
         return 0;
diff --git a/test/managers/DataMovementManagerTest.cpp b/test/managers/DataMovementManagerTest.cpp
index ff879d5892..0611fc93cf 100755
--- a/test/managers/DataMovementManagerTest.cpp
+++ b/test/managers/DataMovementManagerTest.cpp
@@ -170,7 +170,7 @@ class DataMovementManagerAsyncCopyTestWMS : public wrench::ExecutionController {
         // Create a new file registry service to resume normal testing
         file_registry_service = std::shared_ptr(new wrench::FileRegistryService(
                 this->hostname, {}, {}));
-        file_registry_service->setSimulation(this->simulation);
+        file_registry_service->setSimulation(this->getSimulation());
         file_registry_service->start(file_registry_service, true, false);
 
         // try asynchronous copy and register
diff --git a/test/services/compute_services/batch_standard_and_pilot_jobs/BatchServiceTraceFileTest.cpp b/test/services/compute_services/batch_standard_and_pilot_jobs/BatchServiceTraceFileTest.cpp
index ef510c86aa..7fa3fe3bfe 100644
--- a/test/services/compute_services/batch_standard_and_pilot_jobs/BatchServiceTraceFileTest.cpp
+++ b/test/services/compute_services/batch_standard_and_pilot_jobs/BatchServiceTraceFileTest.cpp
@@ -240,7 +240,7 @@ class BatchTraceFileReplayTestWithFailedJobWMS : public wrench::ExecutionControl
 
     int main() override {
 
-        this->simulation->sleep(10 * 3600);
+        wrench::Simulation::sleep(10 * 3600);
 
         return 0;
     }
diff --git a/test/services/helper_services/AlarmTest.cpp b/test/services/helper_services/AlarmTest.cpp
index d36a8d07f2..7143785918 100755
--- a/test/services/helper_services/AlarmTest.cpp
+++ b/test/services/helper_services/AlarmTest.cpp
@@ -95,7 +95,7 @@ class AlarmDownHostTestWMS : public wrench::ExecutionController {
         // Start an alarm
         auto commport = wrench::S4U_CommPort::getTemporaryCommPort();
         try {
-            wrench::Alarm::createAndStartAlarm(this->simulation, 10.0, "Host2", commport,
+            wrench::Alarm::createAndStartAlarm(this->getSimulation(), 10.0, "Host2", commport,
                                                new wrench::SimulationMessage(1), "bogus");
             throw std::runtime_error("Should not be able to create an alarm on a down host");
         } catch (wrench::ExecutionException &e) {
diff --git a/test/services/helper_services/HostStateChangeTest.cpp b/test/services/helper_services/HostStateChangeTest.cpp
index 8d7d486acc..fac1768960 100755
--- a/test/services/helper_services/HostStateChangeTest.cpp
+++ b/test/services/helper_services/HostStateChangeTest.cpp
@@ -67,7 +67,7 @@ class HostStateChangeDetectorTestWMS : public wrench::ExecutionController {
         auto ssd = std::shared_ptr(
                 new wrench::HostStateChangeDetector(this->hostname, hosts, true, true, this->notify_when_speed_change,
                                                     this->getSharedPtr(), this->commport, {}));
-        ssd->setSimulation(this->simulation);
+        ssd->setSimulation(this->getSimulation());
         ssd->start(ssd, true, false);
 
         wrench::Simulation::sleep(10);
@@ -96,7 +96,7 @@ class HostStateChangeDetectorTestWMS : public wrench::ExecutionController {
         }
 
         wrench::Simulation::sleep(10);
-        this->simulation->setPstate("Host2", 0);
+        this->getSimulation()->setPstate("Host2", 0);
         wrench::Simulation::sleep(10);
 
         if (this->notify_when_speed_change) {
diff --git a/test/services/helper_services/action_execution_service/ActionExecutionServiceTest.cpp b/test/services/helper_services/action_execution_service/ActionExecutionServiceTest.cpp
index 6df4a98919..d5794b0765 100644
--- a/test/services/helper_services/action_execution_service/ActionExecutionServiceTest.cpp
+++ b/test/services/helper_services/action_execution_service/ActionExecutionServiceTest.cpp
@@ -147,7 +147,7 @@ class ActionExecutionServiceOneActionSuccessTestWMS : public wrench::ExecutionCo
         action_execution_service->setParentService(this->getSharedPtr());
 
         // Start it
-        action_execution_service->setSimulation(this->simulation);
+        action_execution_service->setSimulation(this->getSimulation());
         action_execution_service->start(action_execution_service, true, false);
 
         // Create a Compound Job
@@ -266,7 +266,7 @@ class ActionExecutionServiceOneActionBogusSpecTestWMS : public wrench::Execution
         action_execution_service->setParentService(this->getSharedPtr());
 
         // Start it
-        action_execution_service->setSimulation(this->simulation);
+        action_execution_service->setSimulation(this->getSimulation());
         action_execution_service->start(action_execution_service, true, false);
 
         // Create a Compound Job
@@ -361,7 +361,7 @@ class ActionExecutionServiceNonReadyActionTestWMS : public wrench::ExecutionCont
         action_execution_service->setParentService(this->getSharedPtr());
 
         // Start it
-        action_execution_service->setSimulation(this->simulation);
+        action_execution_service->setSimulation(this->getSimulation());
         action_execution_service->start(action_execution_service, true, false);
 
         // Create a Compound Job
@@ -469,7 +469,7 @@ class ActionExecutionServiceOneActionTerminateTestWMS : public wrench::Execution
         action_execution_service->setParentService(this->getSharedPtr());
 
         // Start it
-        action_execution_service->setSimulation(this->simulation);
+        action_execution_service->setSimulation(this->getSimulation());
         action_execution_service->start(action_execution_service, true, false);
 
         // Create a Compound Job
@@ -593,7 +593,7 @@ class ActionExecutionServiceOneActionCrashRestartTestWMS : public wrench::Execut
         action_execution_service->setParentService(this->getSharedPtr());
 
         // Start it
-        action_execution_service->setSimulation(this->simulation);
+        action_execution_service->setSimulation(this->getSimulation());
         action_execution_service->start(action_execution_service, true, false);
 
         // Create a Compound Job
@@ -765,7 +765,7 @@ class ActionExecutionServiceOneActionCrashNoRestartTestWMS : public wrench::Exec
         action_execution_service->setParentService(this->getSharedPtr());
 
         // Start it
-        action_execution_service->setSimulation(this->simulation);
+        action_execution_service->setSimulation(this->getSimulation());
         action_execution_service->start(action_execution_service, true, false);
 
         // Create a Compound Job
@@ -894,7 +894,7 @@ class ActionExecutionServiceOneActionFailureTestWMS : public wrench::ExecutionCo
         action_execution_service->setParentService(this->getSharedPtr());
 
         // Start it
-        action_execution_service->setSimulation(this->simulation);
+        action_execution_service->setSimulation(this->getSimulation());
         action_execution_service->start(action_execution_service, true, false);
 
         // Create a Compound Job
@@ -1027,7 +1027,7 @@ class ActionExecutionServiceOneActionNotEnoughResourcesTestWMS : public wrench::
         action_execution_service->setParentService(this->getSharedPtr());
 
         // Start it
-        action_execution_service->setSimulation(this->simulation);
+        action_execution_service->setSimulation(this->getSimulation());
         action_execution_service->start(action_execution_service, true, false);
 
         // Create a Compound Job
@@ -1132,7 +1132,7 @@ class ActionExecutionServiceThreeActionsInSequenceTestWMS : public wrench::Execu
         action_execution_service->setParentService(this->getSharedPtr());
 
         // Start it
-        action_execution_service->setSimulation(this->simulation);
+        action_execution_service->setSimulation(this->getSimulation());
         action_execution_service->start(action_execution_service, true, false);
 
         // Create a Compound Job
diff --git a/test/services/helper_services/action_executor/ComputeActionExecutorTest.cpp b/test/services/helper_services/action_executor/ComputeActionExecutorTest.cpp
index 83f7657cc8..1c97b6136e 100755
--- a/test/services/helper_services/action_executor/ComputeActionExecutorTest.cpp
+++ b/test/services/helper_services/action_executor/ComputeActionExecutorTest.cpp
@@ -162,7 +162,7 @@ class ComputeActionExecutorTestWMS : public wrench::ExecutionController {
                                            nullptr));
 
         // Start it
-        action_executor->setSimulation(this->simulation);
+        action_executor->setSimulation(this->getSimulation());
         action_executor->start(action_executor, true, false);
 
         // Wait for a message from it
@@ -275,7 +275,7 @@ class ComputeActionExecutorFailureTestWMS : public wrench::ExecutionController {
 
         // Coverage
         try {
-            job->addComputeAction("", -1.0, -1.0, 0, 1, wrench::ParallelModel::AMDAHL(1.0));
+            job->addComputeAction("", -1.0, 0, 0, 1, wrench::ParallelModel::AMDAHL(1.0));
             throw std::runtime_error("Shouldn't be able to create a compute action with bogus arguments");
         } catch (std::invalid_argument &ignore) {}
 
@@ -294,7 +294,7 @@ class ComputeActionExecutorFailureTestWMS : public wrench::ExecutionController {
                                            nullptr));
 
         // Start it
-        action_executor->setSimulation(this->simulation);
+        action_executor->setSimulation(this->getSimulation());
         action_executor->start(action_executor, true, false);
 
         // Wait for a message from it
diff --git a/test/services/helper_services/action_executor/CustomActionExecutorTest.cpp b/test/services/helper_services/action_executor/CustomActionExecutorTest.cpp
index edabf75a4b..49342ef5dc 100644
--- a/test/services/helper_services/action_executor/CustomActionExecutorTest.cpp
+++ b/test/services/helper_services/action_executor/CustomActionExecutorTest.cpp
@@ -165,7 +165,7 @@ class CustomActionExecutorTestWMS : public wrench::ExecutionController {
                 action, nullptr);
 
         // Start it
-        action_executor->setSimulation(this->simulation);
+        action_executor->setSimulation(this->getSimulation());
         action_executor->start(action_executor, true, false);
 
         // Wait for a message from it
diff --git a/test/services/helper_services/action_executor/FileCopyActionExecutorTest.cpp b/test/services/helper_services/action_executor/FileCopyActionExecutorTest.cpp
index 771b53e4c4..7d01dc47c8 100644
--- a/test/services/helper_services/action_executor/FileCopyActionExecutorTest.cpp
+++ b/test/services/helper_services/action_executor/FileCopyActionExecutorTest.cpp
@@ -152,7 +152,7 @@ class FileCopyActionExecutorSuccessTestWMS : public wrench::ExecutionController
                 "Host2", 0, 0.0, 0, false,
                 this->commport, file_copy_action, nullptr);
         // Start it
-        file_copy_action_executor->setSimulation(this->simulation);
+        file_copy_action_executor->setSimulation(this->getSimulation());
         file_copy_action_executor->start(file_copy_action_executor, true, false);
 
         // Wait for a message from it
@@ -278,7 +278,7 @@ class FileCopyActionExecutorSuccessSameHostTestWMS : public wrench::ExecutionCon
         auto file_copy_action_executor = std::shared_ptr(
                 new wrench::ActionExecutor("Host2", 0, 0.0, 0, false, this->commport, file_copy_action, nullptr));
         // Start it
-        file_copy_action_executor->setSimulation(this->simulation);
+        file_copy_action_executor->setSimulation(this->getSimulation());
         file_copy_action_executor->start(file_copy_action_executor, true, false);
 
         // Wait for a message from it
diff --git a/test/services/helper_services/action_executor/FileDeleteActionExecutorTest.cpp b/test/services/helper_services/action_executor/FileDeleteActionExecutorTest.cpp
index 81023ef767..7b7c0caa98 100644
--- a/test/services/helper_services/action_executor/FileDeleteActionExecutorTest.cpp
+++ b/test/services/helper_services/action_executor/FileDeleteActionExecutorTest.cpp
@@ -144,7 +144,7 @@ class FileDeleteActionExecutorSuccessTestWMS : public wrench::ExecutionControlle
         auto file_delete_action_executor = std::make_shared(
                 "Host2", 0, 0.0, 0, false, this->commport, file_delete_action, nullptr);
         // Start it
-        file_delete_action_executor->setSimulation(this->simulation);
+        file_delete_action_executor->setSimulation(this->getSimulation());
         file_delete_action_executor->start(file_delete_action_executor, true, false);
 
         // Wait for a message from it
diff --git a/test/services/helper_services/action_executor/FileReadActionExecutorTest.cpp b/test/services/helper_services/action_executor/FileReadActionExecutorTest.cpp
index c7eb51a588..4c583e5d75 100644
--- a/test/services/helper_services/action_executor/FileReadActionExecutorTest.cpp
+++ b/test/services/helper_services/action_executor/FileReadActionExecutorTest.cpp
@@ -158,7 +158,7 @@ class FileReadActionExecutorSuccessTestWMS : public wrench::ExecutionController
                 new wrench::ActionExecutor("Host2", 0, 0.0, 0, false, this->commport, file_read_action, nullptr));
 
         // Start it
-        file_read_action_executor->setSimulation(this->simulation);
+        file_read_action_executor->setSimulation(this->getSimulation());
         file_read_action_executor->start(file_read_action_executor, true, false);
 
         // Wait for a message from it
@@ -262,7 +262,7 @@ class FileReadActionExecutorMultipleAttemptsSuccessTestWMS : public wrench::Exec
 
         // Add a file read action with bogus locations
         try {
-            auto other_file = this->simulation->addFile("other_file", 1.0);
+            auto other_file = this->getSimulation()->addFile("other_file", 1.0);
             job->addFileReadAction("",
                                    {wrench::FileLocation::LOCATION(this->test->ss, "/bogus/", this->test->file),
                                     wrench::FileLocation::LOCATION(this->test->ss, other_file)});
@@ -277,7 +277,7 @@ class FileReadActionExecutorMultipleAttemptsSuccessTestWMS : public wrench::Exec
         auto file_read_action_executor = std::shared_ptr(
                 new wrench::ActionExecutor("Host2", 0, 0.0, 0, false, this->commport, file_read_action, nullptr));
         // Start it
-        file_read_action_executor->setSimulation(this->simulation);
+        file_read_action_executor->setSimulation(this->getSimulation());
         file_read_action_executor->start(file_read_action_executor, true, false);
 
         // Wait for a message from it
@@ -381,7 +381,7 @@ class FileReadActionExecutorMissingFileTestWMS : public wrench::ExecutionControl
         auto file_read_action_executor = std::shared_ptr(
                 new wrench::ActionExecutor("Host2", 0, 0.0, 0, false, this->commport, file_read_action, nullptr));
         // Start it
-        file_read_action_executor->setSimulation(this->simulation);
+        file_read_action_executor->setSimulation(this->getSimulation());
         file_read_action_executor->start(file_read_action_executor, true, false);
 
         // Wait for a message from it
@@ -494,7 +494,7 @@ class FileReadActionExecutorKillingStorageServiceTestWMS : public wrench::Execut
         auto file_read_action_executor = std::shared_ptr(
                 new wrench::ActionExecutor("Host2", 0, 0.0, 0, false, this->commport, file_read_action, nullptr));
         // Start it
-        file_read_action_executor->setSimulation(this->simulation);
+        file_read_action_executor->setSimulation(this->getSimulation());
         file_read_action_executor->start(file_read_action_executor, true, false);
 
         // Sleep 1 sec
diff --git a/test/services/helper_services/action_executor/FileRegistryActionExecutorTest.cpp b/test/services/helper_services/action_executor/FileRegistryActionExecutorTest.cpp
index 4c55e854dc..96366d50e9 100755
--- a/test/services/helper_services/action_executor/FileRegistryActionExecutorTest.cpp
+++ b/test/services/helper_services/action_executor/FileRegistryActionExecutorTest.cpp
@@ -144,7 +144,7 @@ class FileRegistryActionExecutorSuccessTestWMS : public wrench::ExecutionControl
                     nullptr);
 
             // Start it
-            file_read_action_executor->setSimulation(this->simulation);
+            file_read_action_executor->setSimulation(this->getSimulation());
             file_read_action_executor->start(file_read_action_executor, true, false);
 
             // Wait for a message from it
@@ -187,7 +187,7 @@ class FileRegistryActionExecutorSuccessTestWMS : public wrench::ExecutionControl
                                                nullptr));
 
             // Start it
-            file_read_action_executor->setSimulation(this->simulation);
+            file_read_action_executor->setSimulation(this->getSimulation());
             file_read_action_executor->start(file_read_action_executor, true, false);
 
             // Wait for a message from it
diff --git a/test/services/helper_services/action_executor/FileWriteActionExecutorTest.cpp b/test/services/helper_services/action_executor/FileWriteActionExecutorTest.cpp
index 55d9ffde7e..bcae136888 100755
--- a/test/services/helper_services/action_executor/FileWriteActionExecutorTest.cpp
+++ b/test/services/helper_services/action_executor/FileWriteActionExecutorTest.cpp
@@ -147,7 +147,7 @@ class FileWriteActionExecutorSuccessTestWMS : public wrench::ExecutionController
         auto file_write_action_executor = std::shared_ptr(
                 new wrench::ActionExecutor("Host2", 0, 0.0, 0, false, this->commport, file_write_action, nullptr));
         // Start it
-        file_write_action_executor->setSimulation(this->simulation);
+        file_write_action_executor->setSimulation(this->getSimulation());
         file_write_action_executor->start(file_write_action_executor, true, false);
 
         // Wait for a message from it
diff --git a/test/services/helper_services/action_executor/KillFailureActionExecutorTest.cpp b/test/services/helper_services/action_executor/KillFailureActionExecutorTest.cpp
index 0722e29dd4..4a3b3d22df 100644
--- a/test/services/helper_services/action_executor/KillFailureActionExecutorTest.cpp
+++ b/test/services/helper_services/action_executor/KillFailureActionExecutorTest.cpp
@@ -236,7 +236,7 @@ class KillFailActionExecutorTestWMS : public wrench::ExecutionController {
                                            action, nullptr));
 
         // Start it
-        action_executor->setSimulation(this->simulation);
+        action_executor->setSimulation(this->getSimulation());
         action_executor->start(action_executor, true, false);
 
         //        WRENCH_INFO("SLEEPING %lf", this->sleep_time);
diff --git a/test/services/helper_services/action_executor/SleepActionExecutorTest.cpp b/test/services/helper_services/action_executor/SleepActionExecutorTest.cpp
index 2aa97753fb..09c6fe6f16 100755
--- a/test/services/helper_services/action_executor/SleepActionExecutorTest.cpp
+++ b/test/services/helper_services/action_executor/SleepActionExecutorTest.cpp
@@ -146,7 +146,7 @@ class SleepActionExecutorSuccessTestWMS : public wrench::ExecutionController {
         auto sleep_action_executor = std::shared_ptr(
                 new wrench::ActionExecutor("Host2", 0, 0.0, 0, false, this->commport, sleep_action, nullptr));
         // Start it
-        sleep_action_executor->setSimulation(this->simulation);
+        sleep_action_executor->setSimulation(this->getSimulation());
         sleep_action_executor->start(sleep_action_executor, true, false);
         // Wait for a message from it
         std::shared_ptr message;
diff --git a/test/services/memory_manager_service/MemoryManagerTest.cpp b/test/services/memory_manager_service/MemoryManagerTest.cpp
index 9118523335..0baf439cb5 100755
--- a/test/services/memory_manager_service/MemoryManagerTest.cpp
+++ b/test/services/memory_manager_service/MemoryManagerTest.cpp
@@ -182,7 +182,7 @@ class MemoryManagerChainOfTasksTestWMS : public wrench::ExecutionController {
         }
 
         // Coverage
-        auto memory_manager = this->simulation->getMemoryManagerByHost(this->getHostname());
+        auto memory_manager = this->getSimulation()->getMemoryManagerByHost(this->getHostname());
         auto disk = memory_manager->getMemory();
         memory_manager->setMemory(disk);
         memory_manager->setDirtyRatio(memory_manager->getDirtyRatio());
diff --git a/test/services/storage_services/StorageServiceProxy/StorageServiceProxyBasicTest.cpp b/test/services/storage_services/StorageServiceProxy/StorageServiceProxyBasicTest.cpp
index 19a051ac14..e3f8d7cd7f 100755
--- a/test/services/storage_services/StorageServiceProxy/StorageServiceProxyBasicTest.cpp
+++ b/test/services/storage_services/StorageServiceProxy/StorageServiceProxyBasicTest.cpp
@@ -161,24 +161,24 @@ class StorageServiceProxyBasicTestExecutionController : public wrench::Execution
             }
         }
         // read file2 via proxy and target
-        start = simulation->getCurrentSimulatedDate();
+        start = wrench::Simulation::getCurrentSimulatedDate();
         proxy->readFile(this->test->target, file2);
-        auto firstFile = simulation->getCurrentSimulatedDate();
+        auto firstFile = wrench::Simulation::getCurrentSimulatedDate();
         // read file2 via proxy and target
         proxy->readFile(this->test->target, file2);
-        auto secondFile = simulation->getCurrentSimulatedDate();
+        auto secondFile = wrench::Simulation::getCurrentSimulatedDate();
 
         if (firstFile - start < (secondFile - firstFile) * 1.2) {
             throw std::runtime_error("caching was not significantly faster than not caching for file read");
         }
 
         //check the file again, it should now be cached
-        start = simulation->getCurrentSimulatedDate();
+        start = wrench::Simulation::getCurrentSimulatedDate();
 
         if (!proxy->lookupFile(test->remote, file2)) {
             throw std::runtime_error("Could not find previously found file after read");
         }
-        auto secondCache = simulation->getCurrentSimulatedDate() - start;
+        auto secondCache = wrench::Simulation::getCurrentSimulatedDate() - start;
 
         if (firstCache < secondCache * 1.2) {
             throw std::runtime_error("caching was not significantly faster than not caching for file lookup");
@@ -191,7 +191,7 @@ class StorageServiceProxyBasicTestExecutionController : public wrench::Execution
         if (testWithDefault) {
             proxy->writeFile(file3);
         }
-        simulation->sleep(1000);
+        wrench::Simulation::sleep(1000);
         WRENCH_INFO("Activating backdoor");
         ///activating backdoor
         S4U_Simulation::setLinkBandwidth("backdoor", 1000000000);
diff --git a/test/services/storage_services/StorageServiceProxy/StorageServiceProxySequentialTest.cpp b/test/services/storage_services/StorageServiceProxy/StorageServiceProxySequentialTest.cpp
index 1e2a46e8aa..91764fd7f2 100755
--- a/test/services/storage_services/StorageServiceProxy/StorageServiceProxySequentialTest.cpp
+++ b/test/services/storage_services/StorageServiceProxy/StorageServiceProxySequentialTest.cpp
@@ -90,7 +90,7 @@ class StorageServiceProxySimultaneousTestExecutionController : public wrench::Ex
 
 
         if (order) {
-            simulation->sleep(1);
+            wrench::Simulation::sleep(1);
         }
         WRENCH_INFO("Initiating Read %d", order);
         //read file again to check cache
diff --git a/test/services/storage_services/XRootDStorageService/XRootDStorageServiceFullFunctionalTest.cpp b/test/services/storage_services/XRootDStorageService/XRootDStorageServiceFullFunctionalTest.cpp
index 9274730ad1..e2d4d83c55 100755
--- a/test/services/storage_services/XRootDStorageService/XRootDStorageServiceFullFunctionalTest.cpp
+++ b/test/services/storage_services/XRootDStorageService/XRootDStorageServiceFullFunctionalTest.cpp
@@ -228,7 +228,7 @@ class XRootDServiceFullFunctionalityTestExecutionController : public wrench::Exe
      *
      * @param event: the event
      */
-    void processEventCompoundJobCompletion(std::shared_ptr event) override {
+    void processEventCompoundJobCompletion(const std::shared_ptr &event) override {
         /* Retrieve the job that this event is for */
         auto job = event->job;
         /* Print info about all actions in the job */
diff --git a/test/simulated_failures/host_failures/BareMetalComputeServiceHostFailuresTest.cpp b/test/simulated_failures/host_failures/BareMetalComputeServiceHostFailuresTest.cpp
index a9bbc5d5ea..da34a6d4b7 100755
--- a/test/simulated_failures/host_failures/BareMetalComputeServiceHostFailuresTest.cpp
+++ b/test/simulated_failures/host_failures/BareMetalComputeServiceHostFailuresTest.cpp
@@ -132,13 +132,13 @@ class BareMetalComputeServiceOneFailureCausingWorkUnitRestartOnAnotherHostTestWM
         // Starting a FailedHost1 murderer!!
         auto murderer = std::make_shared("StableHost", 100, "FailedHost1",
                                                                    wrench::ResourceSwitcher::Action::TURN_OFF, wrench::ResourceSwitcher::ResourceType::HOST);
-        murderer->setSimulation(this->simulation);
+        murderer->setSimulation(this->getSimulation());
         murderer->start(murderer, true, false);// Daemonized, no auto-restart
 
         // Starting a FailedHost1 resurector!!
         auto resurector = std::make_shared("StableHost", 1000, "FailedHost1",
                                                                      wrench::ResourceSwitcher::Action::TURN_ON, wrench::ResourceSwitcher::ResourceType::HOST);
-        resurector->setSimulation(this->simulation);
+        resurector->setSimulation(this->getSimulation());
         resurector->start(resurector, true, false);// Daemonized, no auto-restart
 
 
@@ -246,13 +246,13 @@ class BareMetalComputeServiceOneFailureCausingWorkUnitRestartOnSameHostTestWMS :
         // Starting a FailedHost1 murderer!!
         auto murderer = std::make_shared("StableHost", 100, "FailedHost1",
                                                                    wrench::ResourceSwitcher::Action::TURN_OFF, wrench::ResourceSwitcher::ResourceType::HOST);
-        murderer->setSimulation(this->simulation);
+        murderer->setSimulation(this->getSimulation());
         murderer->start(murderer, true, false);// Daemonized, no auto-restart
 
         // Starting a FailedHost1 resurector!!
         auto resurector = std::make_shared("StableHost", 1000, "FailedHost1",
                                                                      wrench::ResourceSwitcher::Action::TURN_ON, wrench::ResourceSwitcher::ResourceType::HOST);
-        resurector->setSimulation(this->simulation);
+        resurector->setSimulation(this->getSimulation());
         resurector->start(resurector, true, false);// Daemonized, no auto-restart
 
 
@@ -370,7 +370,7 @@ class BareMetalComputeServiceRandomFailuresTestWMS : public wrench::ExecutionCon
             auto switch1 = std::make_shared(
                     "StableHost", seed1, 10, 100, 10, 100,
                     "FailedHost1", wrench::ResourceRandomRepeatSwitcher::ResourceType::HOST);
-            switch1->setSimulation(this->simulation);
+            switch1->setSimulation(this->getSimulation());
             switch1->start(switch1, true, false);// Daemonized, no auto-restart
 
             // Starting a FailedHost2 random repeat switch!!
@@ -378,7 +378,7 @@ class BareMetalComputeServiceRandomFailuresTestWMS : public wrench::ExecutionCon
             auto switch2 = std::make_shared(
                     "StableHost", seed2, 10, 100, 10, 100,
                     "FailedHost2", wrench::ResourceRandomRepeatSwitcher::ResourceType::HOST);
-            switch2->setSimulation(this->simulation);
+            switch2->setSimulation(this->getSimulation());
             switch2->start(switch2, true, false);// Daemonized, no auto-restart
 
             // Add a task1 to the workflow
@@ -491,7 +491,7 @@ class BareMetalComputeServiceFailureOnServiceThatTerminatesWhenAllItsResourcesAr
         // Starting a FailedHost1 murderer!!
         auto murderer = std::shared_ptr(new wrench::ResourceSwitcher("StableHost", 100, "FailedHost1",
                                                                                                wrench::ResourceSwitcher::Action::TURN_OFF, wrench::ResourceSwitcher::ResourceType::HOST));
-        murderer->setSimulation(this->simulation);
+        murderer->setSimulation(this->getSimulation());
         murderer->start(murderer, true, false);// Daemonized, no auto-restart
 
 
diff --git a/test/simulated_failures/host_failures/CloudComputeServiceHostFailuresTest.cpp b/test/simulated_failures/host_failures/CloudComputeServiceHostFailuresTest.cpp
index 1de3b71349..9f26dd5688 100644
--- a/test/simulated_failures/host_failures/CloudComputeServiceHostFailuresTest.cpp
+++ b/test/simulated_failures/host_failures/CloudComputeServiceHostFailuresTest.cpp
@@ -131,7 +131,7 @@ class CloudServiceFailureOfAVMTestWMS : public wrench::ExecutionController {
         auto murderer = std::make_shared("StableHost", 100, "FailedHost1",
                                                                    wrench::ResourceSwitcher::Action::TURN_OFF,
                                                                    wrench::ResourceSwitcher::ResourceType::HOST);
-        murderer->setSimulation(this->simulation);
+        murderer->setSimulation(this->getSimulation());
         murderer->start(murderer, true, false);// Daemonized, no auto-restart
 
         wrench::Simulation::sleep(10);
@@ -261,13 +261,13 @@ class CloudServiceFailureOfAVMAndRestartTestWMS : public wrench::ExecutionContro
         // Starting a FailedHost1 murderer!!
         auto murderer = std::make_shared("StableHost", 100, "FailedHost1",
                                                                    wrench::ResourceSwitcher::Action::TURN_OFF, wrench::ResourceSwitcher::ResourceType::HOST);
-        murderer->setSimulation(this->simulation);
+        murderer->setSimulation(this->getSimulation());
         murderer->start(murderer, true, false);// Daemonized, no auto-restart
 
         // Starting a FailedHost1 resurector!!
         auto resurector = std::make_shared("StableHost", 1000, "FailedHost1",
                                                                      wrench::ResourceSwitcher::Action::TURN_ON, wrench::ResourceSwitcher::ResourceType::HOST);
-        resurector->setSimulation(this->simulation);
+        resurector->setSimulation(this->getSimulation());
         resurector->start(resurector, true, false);// Daemonized, no auto-restart
 
         wrench::Simulation::sleep(10);
@@ -424,7 +424,7 @@ class CloudServiceRandomFailuresTestWMS : public wrench::ExecutionController {
             auto switch1 = std::make_shared(
                     "StableHost", seed1, 10, 100, 10, 100,
                     "FailedHost1", wrench::ResourceRandomRepeatSwitcher::ResourceType::HOST);
-            switch1->setSimulation(this->simulation);
+            switch1->setSimulation(this->getSimulation());
             switch1->start(switch1, true, false);// Daemonized, no auto-restart
 
             // Starting a FailedHost2 random repeat switch!!
@@ -432,7 +432,7 @@ class CloudServiceRandomFailuresTestWMS : public wrench::ExecutionController {
             auto switch2 = std::make_shared(
                     "StableHost", seed1, 10, 100, 10, 100,
                     "FailedHost2", wrench::ResourceRandomRepeatSwitcher::ResourceType::HOST);
-            switch2->setSimulation(this->simulation);
+            switch2->setSimulation(this->getSimulation());
             switch2->start(switch1, true, false);// Daemonized, no auto-restart
 
             // Add a task1 to the workflow
diff --git a/test/simulated_failures/host_failures/ComprehensiveIntegrationTest.cpp b/test/simulated_failures/host_failures/ComprehensiveIntegrationTest.cpp
index 266dbfd14d..f9ba7fc929 100644
--- a/test/simulated_failures/host_failures/ComprehensiveIntegrationTest.cpp
+++ b/test/simulated_failures/host_failures/ComprehensiveIntegrationTest.cpp
@@ -9,14 +9,10 @@
 
 #include 
 #include 
-#include 
 
 #include "../../include/TestWithFork.h"
 #include "../../include/UniqueTmpPathPrefix.h"
 #include "../failure_test_util/ResourceSwitcher.h"
-#include 
-#include "../failure_test_util/SleeperVictim.h"
-#include "../failure_test_util/ComputerVictim.h"
 #include "../failure_test_util/ResourceRandomRepeatSwitcher.h"
 
 
@@ -181,7 +177,7 @@ class IntegrationFailureTestTestWMS : public wrench::ExecutionController {
                 CHAOS_MONKEY_MIN_SLEEP_BEFORE_OFF, CHAOS_MONKEY_MAX_SLEEP_BEFORE_OFF,
                 CHAOS_MONKEY_MIN_SLEEP_BEFORE_ON, CHAOS_MONKEY_MAX_SLEEP_BEFORE_ON,
                 victimhost, wrench::ResourceRandomRepeatSwitcher::ResourceType::HOST);
-        switcher->setSimulation(this->simulation);
+        switcher->setSimulation(this->getSimulation());
         switcher->start(switcher, true, false);// Daemonized, no auto-restart
     }
 
@@ -319,7 +315,7 @@ class IntegrationFailureTestTestWMS : public wrench::ExecutionController {
         return true;
     }
 
-    void processEventStandardJobCompletion(std::shared_ptr event) override {
+    void processEventStandardJobCompletion(const std::shared_ptr &event) override {
         static int count = 0;
         auto task = *(event->standard_job->getTasks().begin());
         count++;
@@ -335,7 +331,7 @@ class IntegrationFailureTestTestWMS : public wrench::ExecutionController {
         }
     }
 
-    void processEventStandardJobFailure(std::shared_ptr event) override {
+    void processEventStandardJobFailure(const std::shared_ptr &event) override {
         auto task = *(event->standard_job->getTasks().begin());
 
         WRENCH_INFO("Task '%s' has failed: %s", task->getID().c_str(), event->failure_cause->toString().c_str());
diff --git a/test/simulated_failures/host_failures/FailureDetectorHostFailuresTest.cpp b/test/simulated_failures/host_failures/FailureDetectorHostFailuresTest.cpp
index 4719539276..ce797aa34d 100755
--- a/test/simulated_failures/host_failures/FailureDetectorHostFailuresTest.cpp
+++ b/test/simulated_failures/host_failures/FailureDetectorHostFailuresTest.cpp
@@ -99,28 +99,28 @@ class FailureDetectorForSleeperTestWMS : public wrench::ExecutionController {
 
         // Starting a victim on the FailedHost, which should fail at time 50
         auto victim1 = std::shared_ptr(new wrench::SleeperVictim("FailedHost", 200, new wrench::ServiceDaemonStoppedMessage(1), this->commport));
-        victim1->setSimulation(this->simulation);
+        victim1->setSimulation(this->getSimulation());
         victim1->start(victim1, true, false);// Daemonized, no auto-restart
 
         // Starting its nemesis!
         auto murderer = std::shared_ptr(new wrench::ResourceSwitcher("StableHost", 50, "FailedHost",
                                                                                                wrench::ResourceSwitcher::Action::TURN_OFF, wrench::ResourceSwitcher::ResourceType::HOST));
-        murderer->setSimulation(this->simulation);
+        murderer->setSimulation(this->getSimulation());
         murderer->start(murderer, true, false);// Daemonized, no auto-restart
 
         // Starting the failure detector!
         auto failure_detector1 = std::shared_ptr(new wrench::ServiceTerminationDetector("StableHost", victim1, this->commport, true, false));
-        failure_detector1->setSimulation(this->simulation);
+        failure_detector1->setSimulation(this->getSimulation());
         failure_detector1->start(failure_detector1, true, false);// Daemonized, no auto-restart
 
         // Starting a victim on the FailedHostTrace, which should fail at time 100
         auto victim2 = std::shared_ptr(new wrench::SleeperVictim("FailedHostTrace", 200, new wrench::ServiceDaemonStoppedMessage(1), this->commport));
-        victim2->setSimulation(this->simulation);
+        victim2->setSimulation(this->getSimulation());
         victim2->start(victim2, true, false);// Daemonized, no auto-restart
 
         // Starting the failure detector!
         auto failure_detector2 = std::shared_ptr(new wrench::ServiceTerminationDetector("StableHost", victim2, this->commport, true, false));
-        failure_detector2->setSimulation(this->simulation);
+        failure_detector2->setSimulation(this->getSimulation());
         failure_detector2->start(failure_detector2, true, false);// Daemonized, no auto-restart
 
 
@@ -223,28 +223,28 @@ class FailureDetectorForComputerTestWMS : public wrench::ExecutionController {
 
         // Starting a victim on the FailedHost, which should fail at time 50
         auto victim1 = std::shared_ptr(new wrench::ComputerVictim("FailedHost", 200, new wrench::ServiceDaemonStoppedMessage(1), this->commport));
-        victim1->setSimulation(this->simulation);
+        victim1->setSimulation(this->getSimulation());
         victim1->start(victim1, true, false);// Daemonized, no auto-restart
 
         // Starting its nemesis!
         auto murderer = std::shared_ptr(new wrench::ResourceSwitcher("StableHost", 50, "FailedHost",
                                                                                                wrench::ResourceSwitcher::Action::TURN_OFF, wrench::ResourceSwitcher::ResourceType::HOST));
-        murderer->setSimulation(this->simulation);
+        murderer->setSimulation(this->getSimulation());
         murderer->start(murderer, true, false);// Daemonized, no auto-restart
 
         // Starting the failure detector!
         auto failure_detector1 = std::shared_ptr(new wrench::ServiceTerminationDetector("StableHost", victim1, this->commport, true, false));
-        failure_detector1->setSimulation(this->simulation);
+        failure_detector1->setSimulation(this->getSimulation());
         failure_detector1->start(failure_detector1, true, false);// Daemonized, no auto-restart
 
         // Starting a victim on the FailedHostTrace, which should fail at time 100
         auto victim2 = std::shared_ptr(new wrench::ComputerVictim("FailedHostTrace", 200, new wrench::ServiceDaemonStoppedMessage(1), this->commport));
-        victim2->setSimulation(this->simulation);
+        victim2->setSimulation(this->getSimulation());
         victim2->start(victim2, true, false);// Daemonized, no auto-restart
 
         // Starting the failure detector!
         auto failure_detector2 = std::shared_ptr(new wrench::ServiceTerminationDetector("StableHost", victim2, this->commport, true, false));
-        failure_detector2->setSimulation(this->simulation);
+        failure_detector2->setSimulation(this->getSimulation());
         failure_detector2->start(failure_detector2, true, false);// Daemonized, no auto-restart
 
         // Waiting for a message
diff --git a/test/simulated_failures/host_failures/NetworkProximityHostFailuresTest.cpp b/test/simulated_failures/host_failures/NetworkProximityHostFailuresTest.cpp
index 44d50f6b75..be69750dc9 100755
--- a/test/simulated_failures/host_failures/NetworkProximityHostFailuresTest.cpp
+++ b/test/simulated_failures/host_failures/NetworkProximityHostFailuresTest.cpp
@@ -99,13 +99,13 @@ class NetworkProxFailuresTestWMS : public wrench::ExecutionController {
         // Starting a FailedHost1 murderer!!
         auto murderer = std::shared_ptr(new wrench::ResourceSwitcher("StableHost", 100, "FailedHost1",
                                                                                                wrench::ResourceSwitcher::Action::TURN_OFF, wrench::ResourceSwitcher::ResourceType::HOST));
-        murderer->setSimulation(this->simulation);
+        murderer->setSimulation(this->getSimulation());
         murderer->start(murderer, true, false);// Daemonized, no auto-restart
 
         // Starting a FailedHost1 resurector!!
         auto resurector = std::shared_ptr(new wrench::ResourceSwitcher("StableHost", 300, "FailedHost1",
                                                                                                  wrench::ResourceSwitcher::Action::TURN_ON, wrench::ResourceSwitcher::ResourceType::HOST));
-        resurector->setSimulation(this->simulation);
+        resurector->setSimulation(this->getSimulation());
         resurector->start(resurector, true, false);// Daemonized, no auto-restart
 
         std::pair first_pair_to_compute_proximity;
diff --git a/test/simulated_failures/host_failures/ServiceStartReStartTest.cpp b/test/simulated_failures/host_failures/ServiceStartReStartTest.cpp
index 5165c80355..24ebac0313 100755
--- a/test/simulated_failures/host_failures/ServiceStartReStartTest.cpp
+++ b/test/simulated_failures/host_failures/ServiceStartReStartTest.cpp
@@ -100,7 +100,7 @@ class StartServiceOnDownHostTestWMS : public wrench::ExecutionController {
 
         // Starting a sleeper (that will reply with a bogus TTL Expiration message)
         auto sleeper = std::shared_ptr(new wrench::SleeperVictim("FailedHost", 100, new wrench::ServiceDaemonStoppedMessage(1), this->commport));
-        sleeper->setSimulation(this->simulation);
+        sleeper->setSimulation(this->getSimulation());
         try {
             sleeper->start(sleeper, true, true);// Daemonized, auto-restart!!
         } catch (wrench::ExecutionException &e) {
@@ -170,19 +170,19 @@ class ServiceRestartTestWMS : public wrench::ExecutionController {
 
         // Starting a sleeper (that will reply with some message)
         auto sleeper = std::shared_ptr(new wrench::SleeperVictim("FailedHost", 100, new wrench::ServiceDaemonStoppedMessage(1), this->commport));
-        sleeper->setSimulation(this->simulation);
+        sleeper->setSimulation(this->getSimulation());
         sleeper->start(sleeper, true, true);// Daemonized, auto-restart!!
 
         // Starting a host-switcher-offer
         auto death = std::shared_ptr(new wrench::ResourceSwitcher("StableHost", 10, "FailedHost",
                                                                                             wrench::ResourceSwitcher::Action::TURN_OFF, wrench::ResourceSwitcher::ResourceType::HOST));
-        death->setSimulation(this->simulation);
+        death->setSimulation(this->getSimulation());
         death->start(death, true, false);// Daemonized, no auto-restart
 
         // Starting a host-switcher-oner
         auto life = std::shared_ptr(new wrench::ResourceSwitcher("StableHost", 30, "FailedHost",
                                                                                            wrench::ResourceSwitcher::Action::TURN_ON, wrench::ResourceSwitcher::ResourceType::HOST));
-        life->setSimulation(this->simulation);
+        life->setSimulation(this->getSimulation());
         life->start(life, true, false);// Daemonized, no auto-restart
 
         // Waiting for a message
diff --git a/test/simulated_failures/host_failures/StorageServiceReStartHostFailuresTest.cpp b/test/simulated_failures/host_failures/StorageServiceReStartHostFailuresTest.cpp
index 042bb2f8d9..7660bc6ffa 100755
--- a/test/simulated_failures/host_failures/StorageServiceReStartHostFailuresTest.cpp
+++ b/test/simulated_failures/host_failures/StorageServiceReStartHostFailuresTest.cpp
@@ -115,13 +115,13 @@ class StorageServiceRestartTestWMS : public wrench::ExecutionController {
         // Starting a FailedHost murderer!!
         auto murderer = std::make_shared("StableHost", 100, "FailedHost",
                                                                    wrench::ResourceSwitcher::Action::TURN_OFF, wrench::ResourceSwitcher::ResourceType::HOST);
-        murderer->setSimulation(this->simulation);
+        murderer->setSimulation(this->getSimulation());
         murderer->start(murderer, true, false);// Daemonized, no auto-restart
 
         // Starting a FailedHost resurector!!
         auto resurector = std::make_shared("StableHost", 500, "FailedHost",
                                                                      wrench::ResourceSwitcher::Action::TURN_ON, wrench::ResourceSwitcher::ResourceType::HOST);
-        resurector->setSimulation(this->simulation);
+        resurector->setSimulation(this->getSimulation());
         resurector->start(murderer, true, false);// Daemonized, no auto-restart
 
         auto file = wrench::Simulation::getFileByID("file");
@@ -142,13 +142,13 @@ class StorageServiceRestartTestWMS : public wrench::ExecutionController {
         // Starting a FailedHost murderer!!
         murderer = std::make_shared("StableHost", 100, "FailedHost",
                                                               wrench::ResourceSwitcher::Action::TURN_OFF, wrench::ResourceSwitcher::ResourceType::HOST);
-        murderer->setSimulation(this->simulation);
+        murderer->setSimulation(this->getSimulation());
         murderer->start(murderer, true, false);// Daemonized, no auto-restart
 
         // Starting a FailedHost resurector!!
         resurector = std::make_shared("StableHost", 500, "FailedHost",
                                                                 wrench::ResourceSwitcher::Action::TURN_ON, wrench::ResourceSwitcher::ResourceType::HOST);
-        resurector->setSimulation(this->simulation);
+        resurector->setSimulation(this->getSimulation());
         resurector->start(murderer, true, false);// Daemonized, no auto-restart
 
         try {
diff --git a/test/simulated_failures/link_failures/AlarmLinkFailuresTest.cpp b/test/simulated_failures/link_failures/AlarmLinkFailuresTest.cpp
index 93b1195062..bdc866a01b 100755
--- a/test/simulated_failures/link_failures/AlarmLinkFailuresTest.cpp
+++ b/test/simulated_failures/link_failures/AlarmLinkFailuresTest.cpp
@@ -78,14 +78,14 @@ class AlarmLinkFailuresTestWMS : public wrench::ExecutionController {
 
         // Create an Alarm service that will go of in 10 seconds
         auto commport = this->commport;
-        wrench::Alarm::createAndStartAlarm(this->simulation, 10, "Host2", commport,
+        wrench::Alarm::createAndStartAlarm(this->getSimulation(), 10, "Host2", commport,
                                            new wrench::ExecutionControllerAlarmTimerMessage("hello", 10000), "wms_timer");
 
         // Start the link killer that will turn off link1 in 20 seconds
         auto switcher = std::shared_ptr(
                 new wrench::ResourceSwitcher("Host1", 20, "link1",
                                              wrench::ResourceSwitcher::Action::TURN_OFF, wrench::ResourceSwitcher::ResourceType::LINK));
-        switcher->setSimulation(this->simulation);
+        switcher->setSimulation(this->getSimulation());
         switcher->start(switcher, true, false);// Daemonized, no auto-restart
 
         // Wait for the message
diff --git a/test/simulated_failures/link_failures/BareMetalComputeServiceLinkFailuresTest.cpp b/test/simulated_failures/link_failures/BareMetalComputeServiceLinkFailuresTest.cpp
index 02b04d2bb6..2ae5d0eb88 100644
--- a/test/simulated_failures/link_failures/BareMetalComputeServiceLinkFailuresTest.cpp
+++ b/test/simulated_failures/link_failures/BareMetalComputeServiceLinkFailuresTest.cpp
@@ -118,7 +118,7 @@ class BareMetalComputeServiceResourceInformationTestWMS : public wrench::Executi
         auto switcher = std::make_shared(
                 "Host1", 123, 1, 50, 1, 10,
                 "link1", wrench::ResourceRandomRepeatSwitcher::ResourceType::LINK);
-        switcher->setSimulation(this->simulation);
+        switcher->setSimulation(this->getSimulation());
         switcher->start(switcher, true, false);// Daemonized, no auto-restart
 
         // Do a bunch of resource requests
diff --git a/test/simulated_failures/link_failures/FileRegistryLinkFailuresTest.cpp b/test/simulated_failures/link_failures/FileRegistryLinkFailuresTest.cpp
index 58d0f8272a..7eef1d6dda 100755
--- a/test/simulated_failures/link_failures/FileRegistryLinkFailuresTest.cpp
+++ b/test/simulated_failures/link_failures/FileRegistryLinkFailuresTest.cpp
@@ -114,7 +114,7 @@ class FileRegistryLinkFailuresTestWMS : public wrench::ExecutionController {
         auto switcher = std::shared_ptr(
                 new wrench::ResourceRandomRepeatSwitcher("Host1", 123, 1, 15, 1, 5,
                                                          "link1", wrench::ResourceRandomRepeatSwitcher::ResourceType::LINK));
-        switcher->setSimulation(this->simulation);
+        switcher->setSimulation(this->getSimulation());
         switcher->start(switcher, true, false);// Daemonized, no auto-restart
 
         std::mt19937 rng(666);
diff --git a/test/simulated_failures/link_failures/NetworkProximityLinkFailuresTest.cpp b/test/simulated_failures/link_failures/NetworkProximityLinkFailuresTest.cpp
index 89d9d137fd..9dec563298 100755
--- a/test/simulated_failures/link_failures/NetworkProximityLinkFailuresTest.cpp
+++ b/test/simulated_failures/link_failures/NetworkProximityLinkFailuresTest.cpp
@@ -113,7 +113,7 @@ class NetworkProxLinkFailuresTestWMS : public wrench::ExecutionController {
                                                              wrench::ResourceRandomRepeatSwitcher::LINK));
 
 
-            switcher->setSimulation(this->simulation);
+            switcher->setSimulation(this->getSimulation());
             switcher->start(switcher, true, false);// Daemonized, no auto-restart
         }
 
diff --git a/test/simulated_failures/link_failures/StorageServiceLinkFailuresTest.cpp b/test/simulated_failures/link_failures/StorageServiceLinkFailuresTest.cpp
index 1ecd7c589f..88954823b2 100644
--- a/test/simulated_failures/link_failures/StorageServiceLinkFailuresTest.cpp
+++ b/test/simulated_failures/link_failures/StorageServiceLinkFailuresTest.cpp
@@ -234,14 +234,14 @@ class StorageServiceLinkFailuresTestWMS : public wrench::ExecutionController {
         auto switcher1 = std::make_shared(
                 "Host1", 123, 1, 1045, 1, 5,
                 "link1", wrench::ResourceRandomRepeatSwitcher::ResourceType::LINK);
-        switcher1->setSimulation(this->simulation);
+        switcher1->setSimulation(this->getSimulation());
         switcher1->start(switcher1, true, false);// Daemonized, no auto-restart
 
         // Create a link switcher on/off er for link2
         auto switcher2 = std::make_shared(
                 "Host1", 234, 1, 15, 1, 5,
                 "link2", wrench::ResourceRandomRepeatSwitcher::ResourceType::LINK);
-        switcher2->setSimulation(this->simulation);
+        switcher2->setSimulation(this->getSimulation());
         switcher2->start(switcher2, true, false);// Daemonized, no auto-restart
 
         this->data_movement_manager = this->createDataMovementManager();
diff --git a/test/simulation/DynamicServiceCreationTest.cpp b/test/simulation/DynamicServiceCreationTest.cpp
index 5c8d1f76f7..6e89101ba3 100644
--- a/test/simulation/DynamicServiceCreationTest.cpp
+++ b/test/simulation/DynamicServiceCreationTest.cpp
@@ -174,15 +174,15 @@ class DynamicServiceCreationReadyTasksTestWMS : public wrench::ExecutionControll
         auto job_manager = this->createJobManager();
 
         // Dynamically create a File Registry Service on this host
-        auto dynamically_created_file_registry_service = simulation->startNewService(
+        auto dynamically_created_file_registry_service = this->getSimulation()->startNewService(
                 new wrench::FileRegistryService(hostname));
 
         // Dynamically create a Network Proximity Service on this host
-        auto dynamically_created_network_proximity_service = simulation->startNewService(
+        auto dynamically_created_network_proximity_service = this->getSimulation()->startNewService(
                 new wrench::NetworkProximityService(hostname, {"DualCoreHost", "QuadCoreHost"}));
 
         // Dynamically create a Storage Service on this host
-        auto dynamically_created_storage_service = simulation->startNewService(
+        auto dynamically_created_storage_service = this->getSimulation()->startNewService(
                 wrench::SimpleStorageService::createSimpleStorageService(hostname, {"/disk2"},
                                                                          {},
                                                                          {{wrench::SimpleStorageServiceMessagePayload::FILE_COPY_ANSWER_MESSAGE_PAYLOAD, 123}}));
@@ -190,7 +190,7 @@ class DynamicServiceCreationReadyTasksTestWMS : public wrench::ExecutionControll
 
         // Dynamically create a Cloud Service
         std::vector execution_hosts = {"QuadCoreHost"};
-        auto dynamically_created_compute_service = std::dynamic_pointer_cast(simulation->startNewService(
+        auto dynamically_created_compute_service = std::dynamic_pointer_cast(this->getSimulation()->startNewService(
                 new wrench::CloudComputeService(hostname, execution_hosts, "/scratch",
                                                 {})));
 
@@ -327,12 +327,12 @@ class WeirdVectorBugTestWMS : public wrench::ExecutionController {
 
         // Dynamically create a BM Service
         std::vector execution_hosts = {"QuadCoreHost"};
-        auto dynamically_created_compute_service = std::dynamic_pointer_cast(simulation->startNewService(
+        auto dynamically_created_compute_service = std::dynamic_pointer_cast(this->getSimulation()->startNewService(
                 new wrench::BareMetalComputeService(hostname, execution_hosts, "/scratch",
                                                     {})));
 
         // Dynamically create a Storage Service on this host
-        auto dynamically_created_storage_service = simulation->startNewService(
+        auto dynamically_created_storage_service = this->getSimulation()->startNewService(
                 wrench::SimpleStorageService::createSimpleStorageService(hostname, {"/disk2"},
                                                                          {},
                                                                          {{wrench::SimpleStorageServiceMessagePayload::FILE_COPY_ANSWER_MESSAGE_PAYLOAD, 123}}));
diff --git a/test/simulation/S4U_DaemonTest.cpp b/test/simulation/S4U_DaemonTest.cpp
index f0d921f922..9414778ce3 100755
--- a/test/simulation/S4U_DaemonTest.cpp
+++ b/test/simulation/S4U_DaemonTest.cpp
@@ -130,7 +130,7 @@ class S4U_DaemonTestWMS : public wrench::ExecutionController {
 
 
         // Start the daemon for real
-        daemon->setSimulation(this->simulation);
+        daemon->setSimulation(this->simulation_);
         daemon->startDaemon(false, false);
 
         daemon->isDaemonized();// coverage
@@ -216,7 +216,7 @@ class S4U_DaemonNoCleanupTestWMS : public wrench::ExecutionController {
                 std::make_shared("Host2");
 
         daemon->createLifeSaver(std::shared_ptr(daemon));
-        daemon->setSimulation(this->simulation);
+        daemon->setSimulation(this->simulation_);
         daemon->startDaemon(false, false);
 
         // sleep 10 seconds
diff --git a/test/simulation/SimulationPlatformTest.cpp b/test/simulation/SimulationPlatformTest.cpp
index f8ed765225..3465b7a47d 100755
--- a/test/simulation/SimulationPlatformTest.cpp
+++ b/test/simulation/SimulationPlatformTest.cpp
@@ -212,7 +212,7 @@ class CreateNewDiskTestWMS : public wrench::ExecutionController {
         wrench::S4U_Simulation::createNewDisk("subzonehost", "new_disk", 10.0, 10.0, 100.0, "/foo");
 
         // Start a storage service that uses this disk
-        auto ss = this->simulation->startNewService(wrench::SimpleStorageService::createSimpleStorageService("subzonehost", {"/foo"}, {}, {}));
+        auto ss = this->getSimulation()->startNewService(wrench::SimpleStorageService::createSimpleStorageService("subzonehost", {"/foo"}, {}, {}));
 
         // Create a file on it
         auto too_big = wrench::Simulation::addFile("too_big", 200.0);
diff --git a/test/simulation/simulation_output/SimulationDumpJSONTest.cpp b/test/simulation/simulation_output/SimulationDumpJSONTest.cpp
index 6093022032..43b94e2f7b 100644
--- a/test/simulation/simulation_output/SimulationDumpJSONTest.cpp
+++ b/test/simulation/simulation_output/SimulationDumpJSONTest.cpp
@@ -806,7 +806,7 @@ class SimulationOutputDumpEnergyConsumptionTestWMS : public wrench::ExecutionCon
         // at time 0.0, the pstate is set to 1 as specified in the platform file,
         // then again at time 0.0, it is set to pstate 0 and only one timestamp should
         // be generated for this host at time 0.0
-        this->simulation->setPstate(this->getHostname(), 0);
+        this->getSimulation()->setPstate(this->getHostname(), 0);
 
         const std::vector hostnames = wrench::Simulation::getHostnameList();
         const double TWO_SECOND_PERIOD = 2.0;
diff --git a/test/simulation/simulation_output/SimulationOutputTest.cpp b/test/simulation/simulation_output/SimulationOutputTest.cpp
index 77ab6d986c..b4020036a3 100755
--- a/test/simulation/simulation_output/SimulationOutputTest.cpp
+++ b/test/simulation/simulation_output/SimulationOutputTest.cpp
@@ -117,10 +117,10 @@ class EmptySimulationOutputWMS : public wrench::ExecutionController {
 
 #ifdef WRENCH_INTERNAL_EXCEPTIONS
         try {
-            this->simulation->getOutput().addTimestampTaskStart(0.0, nullptr);
-            this->simulation->getOutput().addTimestampTaskCompletion(0.0, nullptr);
-            this->simulation->getOutput().addTimestampTaskTermination(0.0, nullptr);
-            this->simulation->getOutput().addTimestampTaskFailure(0.0, nullptr);
+            this->getSimulation()->getOutput().addTimestampTaskStart(0.0, nullptr);
+            this->getSimulation()->getOutput().addTimestampTaskCompletion(0.0, nullptr);
+            this->getSimulation()->getOutput().addTimestampTaskTermination(0.0, nullptr);
+            this->getSimulation()->getOutput().addTimestampTaskFailure(0.0, nullptr);
             throw std::runtime_error("Should have caught exception!");
         } catch (std::exception &ignore) {
         }
diff --git a/test/simulation/simulation_output/SimulationTimestampEnergyTest.cpp b/test/simulation/simulation_output/SimulationTimestampEnergyTest.cpp
index 9f9feab818..8728dbba59 100644
--- a/test/simulation/simulation_output/SimulationTimestampEnergyTest.cpp
+++ b/test/simulation/simulation_output/SimulationTimestampEnergyTest.cpp
@@ -82,11 +82,11 @@ class SimulationTimestampPstateSetTestWMS : public wrench::ExecutionController {
         // the first call to setPstate(hostname, 2) should record a timestamp
         // then the second call to setPstate(hostname, 1) should record a timestamp that replaces the one previously added
         // so that we don't end up with timestamps that show two different pstates at the same point in time
-        this->simulation->setPstate(this->getHostname(), 2);
-        this->simulation->setPstate(this->getHostname(), 1);
+        this->getSimulation()->setPstate(this->getHostname(), 2);
+        this->getSimulation()->setPstate(this->getHostname(), 1);
 
         wrench::S4U_Simulation::sleep(10.0);
-        this->simulation->setPstate(this->getHostname(), 2);
+        this->getSimulation()->setPstate(this->getHostname(), 2);
 
         return 0;
     }
@@ -173,13 +173,13 @@ class SimulationTimestampEnergyConsumptionTestWMS : public wrench::ExecutionCont
     int main() override {
         const double MEGAFLOP = 1000.0 * 1000.0;
         wrench::S4U_Simulation::compute(100.0 * MEGAFLOP);             // compute for 1 second
-        this->simulation->getEnergyConsumed(this->getHostname(), true);// 200 joules
+        this->getSimulation()->getEnergyConsumed(this->getHostname(), true);// 200 joules
         wrench::S4U_Simulation::compute(100.0 * MEGAFLOP);             // compute for 1 second
-        this->simulation->getEnergyConsumed(this->getHostname(), true);// now 400 joules
+        this->getSimulation()->getEnergyConsumed(this->getHostname(), true);// now 400 joules
 
         // following two calls should not add any timestamps
-        this->simulation->getEnergyConsumed(this->getHostname());
-        this->simulation->getEnergyConsumed(this->getHostname(), false);
+        this->getSimulation()->getEnergyConsumed(this->getHostname());
+        this->getSimulation()->getEnergyConsumed(this->getHostname(), false);
 
         return 0;
     }
diff --git a/test/wms/JobManagerTest.cpp b/test/wms/JobManagerTest.cpp
index 4d11a9b858..4148b4a192 100755
--- a/test/wms/JobManagerTest.cpp
+++ b/test/wms/JobManagerTest.cpp
@@ -358,7 +358,7 @@ class JobManagerSubmitJobTestWMS : public wrench::ExecutionController {
         auto job_manager = this->createJobManager();
 
         std::shared_ptr cs =
-                simulation->add(new wrench::BareMetalComputeService("Host1", {"Host1"}, "", {}, {}));
+                this->getSimulation()->add(new wrench::BareMetalComputeService("Host1", {"Host1"}, "", {}, {}));
 
         try {
             std::shared_ptr compound_job = nullptr;
@@ -604,7 +604,7 @@ class JobManagerTerminateJobTestWMS : public wrench::ExecutionController {
         }
 
         // Sleep for 90 seconds
-        this->simulation->sleep(90);
+        wrench::Simulation::sleep(90);
 
         // Terminate the job
         try {
diff --git a/test/wms/WMSTest.cpp b/test/wms/WMSTest.cpp
index 5f380d1afc..efdca42738 100755
--- a/test/wms/WMSTest.cpp
+++ b/test/wms/WMSTest.cpp
@@ -364,39 +364,39 @@ class TestCustomHandlerWMS : public wrench::ExecutionController {
         return 0;
     }
 
-    void processEventStandardJobCompletion(std::shared_ptr event) override {
+    void processEventStandardJobCompletion(const std::shared_ptr &event) override {
         this->counter = 1;
     }
 
-    void processEventPilotJobStart(std::shared_ptr event) override {
+    void processEventPilotJobStart(const std::shared_ptr &event) override {
         this->counter = 2;
     }
 
-    void processEventStandardJobFailure(std::shared_ptr event) override {
+    void processEventStandardJobFailure(const std::shared_ptr &event) override {
         this->counter = 3;
     }
 
-    void processEventPilotJobExpiration(std::shared_ptr event) override {
+    void processEventPilotJobExpiration(const std::shared_ptr &event) override {
         this->counter = 4;
     }
 
-    void processEventFileCopyCompletion(std::shared_ptr event) override {
+    void processEventFileCopyCompletion(const std::shared_ptr &event) override {
         this->counter = 5;
     }
 
-    void processEventFileCopyFailure(std::shared_ptr event) override {
+    void processEventFileCopyFailure(const std::shared_ptr &event) override {
         this->counter = 6;
     }
 
-    void processEventTimer(std::shared_ptr event) override {
+    void processEventTimer(const std::shared_ptr &event) override {
         this->counter = 7;
     }
 
-    void processEventCompoundJobCompletion(std::shared_ptr event) override {
+    void processEventCompoundJobCompletion(const std::shared_ptr &event) override {
         this->counter = 8;
     }
 
-    void processEventCompoundJobFailure(std::shared_ptr event) override {
+    void processEventCompoundJobFailure(const std::shared_ptr &event) override {
         this->counter = 9;
     }
 };
diff --git a/test/workflow/WorkflowTest.cpp b/test/workflow/WorkflowTest.cpp
index f398ca1715..6f89395b22 100755
--- a/test/workflow/WorkflowTest.cpp
+++ b/test/workflow/WorkflowTest.cpp
@@ -336,7 +336,7 @@ TEST_F(WorkflowTest, DataFile) {
 TEST_F(WorkflowTest, IsDone) {
     ASSERT_FALSE(workflow->isDone());
 
-    for (auto task: workflow->getTasks()) {
+    for (const auto &task: workflow->getTasks()) {
         task->setInternalState(wrench::WorkflowTask::InternalState::TASK_COMPLETED);
         task->setState(wrench::WorkflowTask::State::COMPLETED);
     }
@@ -355,7 +355,7 @@ TEST_F(WorkflowTest, SumFlops) {
 
 class AllDependenciesWorkflowTest : public ::testing::Test {
 protected:
-    ~AllDependenciesWorkflowTest() {
+    ~AllDependenciesWorkflowTest() override {
         workflow->clear();
         wrench::Simulation::removeAllFiles();
     }