A VM represents a virtual machine (or a container) that hosts actors.
The total computing power that the contained actors can get is constrained to the virtual machine size.
|
| VirtualMachine (std::string name, s4u::Host *physical_host, int core_amount) |
|
| VirtualMachine (std::string name, s4u::Host *physical_host, int core_amount, size_t ramsize) |
|
| VirtualMachine (VirtualMachine const &)=delete |
|
VirtualMachine & | operator= (VirtualMachine const &)=delete |
|
simgrid::vm::VirtualMachineImpl * | get_impl () |
|
void | start () |
|
void | suspend () |
|
void | resume () |
|
void | shutdown () |
|
void | destroy () |
|
simgrid::s4u::Host * | get_pm () |
|
void | set_pm (simgrid::s4u::Host *pm) |
|
size_t | get_ramsize () |
|
void | set_ramsize (size_t ramsize) |
|
void | set_bound (double bound) |
| Set a CPU bound for a given VM. More...
|
|
VirtualMachine::state | get_state () |
|
VirtualMachine::state | getState () |
|
simgrid::vm::VirtualMachineImpl * | getImpl () |
|
simgrid::s4u::Host * | getPm () |
|
void | setPm (simgrid::s4u::Host *pm) |
|
size_t | getRamsize () |
|
void | setRamsize (size_t ramsize) |
|
void | setBound (double bound) |
|
| Host (std::string name) |
|
| Host (Host const &)=delete |
|
Host & | operator= (Host const &)=delete |
|
simgrid::xbt::string const & | get_name () const |
| Retrieves the name of that host as a C++ string. More...
|
|
const char * | get_cname () const |
| Retrieves the name of that host as a C string. More...
|
|
int | get_actor_count () |
|
std::vector< ActorPtr > | get_all_actors () |
|
void | turn_on () |
| Turns that host on if it was previously off. More...
|
|
void | turn_off () |
| Turns that host off. More...
|
|
bool | is_on () const |
| Returns if that host is currently up and running. More...
|
|
bool | is_off () const |
| Returns if that host is currently down and offline. More...
|
|
const char * | get_property (std::string key) const |
|
void | set_property (std::string key, std::string value) |
|
std::unordered_map< std::string, std::string > * | get_properties () |
|
double | get_speed () const |
|
double | get_available_speed () const |
|
int | get_core_count () const |
|
double | get_load () const |
|
double | get_pstate_speed (int pstate_index) const |
|
int | get_pstate_count () const |
|
void | set_pstate (int pstate_index) |
|
int | get_pstate () const |
|
std::vector< const char * > | get_attached_storages () const |
|
void | getAttachedStorages (std::vector< const char *> *storages) |
|
std::unordered_map< std::string, Storage * > const & | get_mounted_storages () |
| Get an associative list [mount point]->[Storage] of all local mount points. More...
|
|
std::unordered_map< std::string, Storage * > const & | getMountedStorages () |
|
void | route_to (Host *dest, std::vector< Link *> &links, double *latency) |
|
void | route_to (Host *dest, std::vector< kernel::resource::LinkImpl *> &links, double *latency) |
|
void | execute (double flops) |
| Block the calling actor on an execution located on the called host. More...
|
|
ExecPtr | exec_async (double flops_amounts) |
| Start an asynchronous computation on that host (possibly remote) More...
|
|
void | execute (double flops, double priority) |
| Block the calling actor on an execution located on the called host (with explicit priority) More...
|
|
| Extendable () |
|
| ~Extendable () |
|
void * | extension (std::size_t rank) |
|
U * | extension (Extension< Host, U > rank) |
|
U * | extension () |
|
void | extension_set (std::size_t rank, void *value, bool use_dtor=true) |
|
void | extension_set (Extension< Host, U > rank, U *value, bool use_dtor=true) |
|
void | extension_set (U *p) |
|
void simgrid::s4u::VirtualMachine::set_bound |
( |
double |
bound | ) |
|
Set a CPU bound for a given VM.
- Note that in some cases MSG_task_set_bound() may not intuitively work for VMs.
For example, On PM0, there are Task1 and VM0. On VM0, there is Task2. Now we bound 75% to Task1@PM0 and bound 25% to Task2@VM0. Then, Task1@PM0 gets 50%. Task2@VM0 gets 25%. This is NOT 75% for Task1@PM0 and 25% for Task2@VM0, respectively.
This is because a VM has the dummy CPU action in the PM layer. Putting a task on the VM does not affect the bound of the dummy CPU action. The bound of the dummy CPU action is unlimited.
There are some solutions for this problem. One option is to update the bound of the dummy CPU action automatically. It should be the sum of all tasks on the VM. But, this solution might be costly, because we have to scan all tasks on the VM in share_resource() or we have to trap both the start and end of task execution.
The current solution is to use setBound(), which allows us to directly set the bound of the dummy CPU action.
- Note that bound == 0 means no bound (i.e., unlimited). But, if a host has multiple CPU cores, the CPU share of a computation task (or a VM) never exceeds the capacity of a CPU core.