~File();
/** Retrieves the path to the file */
- const char* get_path() { return fullpath_.c_str(); }
+ const char* get_path() const { return fullpath_.c_str(); }
/** Simulates a local read action. Returns the size of data actually read */
sg_size_t read(sg_size_t size);
/** Retrieves the previously stored data */
XBT_ATTRIB_DEPRECATED_v329("Please use get_data()") void* get_userdata() { return get_data(); }
- sg_size_t size();
+ sg_size_t size() const;
void seek(sg_offset_t pos); /** Sets the file head to the given position. */
void seek(sg_offset_t pos, int origin); /** Sets the file head to the given position from a given origin. */
- sg_size_t tell(); /** Retrieves the current file position */
+ sg_size_t tell() const; /** Retrieves the current file position */
/** Rename a file. WARNING: It is forbidden to move the file to another mount point */
- void move(const std::string& fullpath);
+ void move(const std::string& fullpath) const;
int remote_copy(sg_host_t host, const char* fullpath);
int remote_move(sg_host_t host, const char* fullpath);
- int unlink(); /** Remove a file from the contents of a disk */
+ int unlink() const; /** Remove a file from the contents of a disk */
void dump();
};
FileSystemDiskExt& operator=(const FileSystemDiskExt&) = delete;
std::map<std::string, sg_size_t>* parse_content(const std::string& filename);
std::map<std::string, sg_size_t>* get_content() const { return content_.get(); }
- const char* get_mount_point() { return mount_point_.c_str(); }
+ const char* get_mount_point() const { return mount_point_.c_str(); }
const char* get_mount_point(s4u::Host* remote_host) { return remote_mount_points_[remote_host].c_str(); }
void add_remote_mount(Host* host, const std::string& mount_point)
{
FileSystemStorageExt& operator=(const FileSystemStorageExt&) = delete;
std::map<std::string, sg_size_t>* parse_content(const std::string& filename);
std::map<std::string, sg_size_t>* get_content() { return content_.get(); }
- sg_size_t get_size() { return size_; }
- sg_size_t get_used_size() { return used_size_; }
+ sg_size_t get_size() const { return size_; }
+ sg_size_t get_used_size() const { return used_size_; }
void decr_used_size(sg_size_t size);
void incr_used_size(sg_size_t size);
};
public:
void start_tracking();
void stop_tracking() { dp_tracking_ = false; }
- bool is_tracking() { return dp_tracking_; }
+ bool is_tracking() const { return dp_tracking_; }
void track(kernel::activity::ExecImpl const* exec, double amount) { dp_objs_.insert({exec, amount}); }
void untrack(kernel::activity::ExecImpl const* exec) { dp_objs_.erase(exec); }
double get_stored_remains(kernel::activity::ExecImpl const* exec) { return dp_objs_.at(exec); }
void update_dirty_page_count(double delta) { dp_updated_by_deleted_tasks_ += delta; }
double computed_flops_lookup();
- double get_intensity() { return dp_intensity_; }
+ double get_intensity() const { return dp_intensity_; }
void set_intensity(double intensity) { dp_intensity_ = intensity; }
- double get_working_set_memory() { return working_set_memory_; }
+ double get_working_set_memory() const { return working_set_memory_; }
void set_working_set_memory(sg_size_t size) { working_set_memory_ = size; }
void set_migration_speed(double speed) { mig_speed_ = speed; }
- double get_migration_speed() { return mig_speed_; }
- double get_max_downtime() { return max_downtime_; }
+ double get_migration_speed() const { return mig_speed_; }
+ double get_max_downtime() const { return max_downtime_; }
static simgrid::xbt::Extension<VirtualMachineImpl, DirtyPageTrackingExt> EXTENSION_ID;
virtual ~DirtyPageTrackingExt() = default;
return 0;
}
-sg_size_t File::size()
+sg_size_t File::size() const
{
return size_;
}
}
}
-sg_size_t File::tell()
+sg_size_t File::tell() const
{
return current_position_;
}
-void File::move(const std::string& fullpath)
+void File::move(const std::string& fullpath) const
{
/* Check if the new full path is on the same mount point */
if (fullpath.compare(0, mount_point_.length(), mount_point_) == 0) {
}
}
-int File::unlink()
+int File::unlink() const
{
/* Check if the file is on local storage */
std::map<std::string, sg_size_t>* content = nullptr;
~HostEnergy();
double get_current_watts_value();
- double get_current_watts_value(double cpu_load);
+ double get_current_watts_value(double cpu_load) const;
double get_consumed_energy();
- double get_watt_idle_at(int pstate);
- double get_watt_min_at(int pstate);
- double get_watt_max_at(int pstate);
- double get_power_range_slope_at(int pstate);
- double get_last_update_time() { return last_updated_; }
+ double get_watt_idle_at(int pstate) const;
+ double get_watt_min_at(int pstate) const;
+ double get_watt_max_at(int pstate) const;
+ double get_power_range_slope_at(int pstate) const;
+ double get_last_update_time() const { return last_updated_; }
void update();
};
HostEnergy::~HostEnergy() = default;
-double HostEnergy::get_watt_idle_at(int pstate)
+double HostEnergy::get_watt_idle_at(int pstate) const
{
xbt_assert(not power_range_watts_list_.empty(), "No power range properties specified for host %s",
host_->get_cname());
return power_range_watts_list_[pstate].idle_;
}
-double HostEnergy::get_watt_min_at(int pstate)
+double HostEnergy::get_watt_min_at(int pstate) const
{
xbt_assert(not power_range_watts_list_.empty(), "No power range properties specified for host %s",
host_->get_cname());
return power_range_watts_list_[pstate].epsilon_;
}
-double HostEnergy::get_watt_max_at(int pstate)
+double HostEnergy::get_watt_max_at(int pstate) const
{
xbt_assert(not power_range_watts_list_.empty(), "No power range properties specified for host %s",
host_->get_cname());
return power_range_watts_list_[pstate].max_;
}
-double HostEnergy::get_power_range_slope_at(int pstate)
+double HostEnergy::get_power_range_slope_at(int pstate) const
{
xbt_assert(not power_range_watts_list_.empty(), "No power range properties specified for host %s",
host_->get_cname());
*
* Whether the host is ON or OFF is not taken into account.
*/
-double HostEnergy::get_current_watts_value(double cpu_load)
+double HostEnergy::get_current_watts_value(double cpu_load) const
{
xbt_assert(not power_range_watts_list_.empty(), "No power range properties specified for host %s",
host_->get_cname());
explicit HostLoad(simgrid::s4u::Host& ptr) = delete;
explicit HostLoad(simgrid::s4u::Host&& ptr) = delete;
- double get_current_load();
+ double get_current_load() const;
/** Get the the average load since last reset(), as a ratio
*
* That's the ratio (amount of flops that were actually computed) / (amount of flops that could have been computed at full speed)
* But still, if you call this function between the two events (in the simulator course), it
* returns 0 although there is no time (in the simulated time) where this value is valid.
*/
-double HostLoad::get_current_load()
+double HostLoad::get_current_load() const
{
// We don't need to call update() here because it is called every time an action terminates or starts
return current_flops_ / (host_->get_speed() * host_->get_core_count());
void update();
private:
- double get_power();
+ double get_power() const;
s4u::Link* link_{};
}
}
-double LinkEnergy::get_power()
+double LinkEnergy::get_power() const
{
if (!inited_)
return 0.0;
/** @brief Change the physical host on which the given VM is running */
virtual void set_physical_host(s4u::Host* dest);
/** @brief Get the physical host on which the given VM is running */
- s4u::Host* get_physical_host() { return physical_host_; }
+ s4u::Host* get_physical_host() const { return physical_host_; }
sg_size_t get_ramsize() const { return ramsize_; }
void set_ramsize(sg_size_t ramsize) { ramsize_ = ramsize; }
s4u::VirtualMachine::state get_state() const { return vm_state_; }
void set_state(s4u::VirtualMachine::state state) { vm_state_ = state; }
- unsigned int get_core_amount() { return core_amount_; }
- kernel::resource::Action* get_action() { return action_; }
+ unsigned int get_core_amount() const { return core_amount_; }
+ kernel::resource::Action* get_action() const { return action_; }
virtual void set_bound(double bound);