wrench::BareMetalComputeService
-
class BareMetalComputeService : public wrench::ComputeService
A compute service that manages a set of multi-core compute hosts and provides access to their resources.
One can think of this as a simple service that allows the user to run jobs and to specify for each job on which host it should run and with how many cores. If no host is specified, the service will pick the least loaded host. If no number of cores is specified, the service will use as many cores as possible. The service will make sure that the RAM capacity of a host is not exceeded by possibly delaying job executions until enough RAM is available. Note that if the submitted jobs require a total number of cores larger than available, say, on a particular host, then these jobs will simply time-share the cores. In other words, this service does not provide space-sharing of hosts/cores (unlike, for instance, a wrench::BatchComputeService).
Subclassed by wrench::BareMetalComputeServiceOneShot
Public Functions
-
BareMetalComputeService(const std::string &hostname, const std::map<std::string, std::tuple<unsigned long, double>> &compute_resources, const std::string &scratch_space_mount_point, WRENCH_PROPERTY_COLLECTION_TYPE property_list = {}, WRENCH_MESSAGE_PAYLOADCOLLECTION_TYPE messagepayload_list = {})
Constructor.
- Parameters:
hostname – the name of the host on which the service should be started
compute_resources – a map of <num_cores, memory_manager_service> tuples, indexed by hostname, which represents the compute resources available to this service.
use num_cores = ComputeService::ALL_CORES to use all cores available on the host
use memory_manager_service = ComputeService::ALL_RAM to use all RAM available on the host
scratch_space_mount_point – the compute service’s scratch space’s mount point (”” means none)
property_list – a property list ({} means “use all defaults”)
messagepayload_list – a message payload list ({} means “use all defaults”)
-
BareMetalComputeService(const std::string &hostname, const std::vector<std::string> &compute_hosts, const std::string &scratch_space_mount_point, WRENCH_PROPERTY_COLLECTION_TYPE property_list = {}, WRENCH_MESSAGE_PAYLOADCOLLECTION_TYPE messagepayload_list = {})
Constructor.
- Parameters:
hostname – the name of the host on which the service should be started
compute_hosts – the names of the hosts available as compute resources (the service will use all the cores and all the RAM of each host)
scratch_space_mount_point – the compute service’s scratch space’s mount point (”” means none)
property_list – a property list ({} means “use all defaults”)
messagepayload_list – a message payload list ({} means “use all defaults”)
-
~BareMetalComputeService() override
Destructor.
-
bool isThereAtLeastOneHostWithIdleResourcesInstant(unsigned long num_cores, double ram)
An “out of simulation time” (instant) method to check on resource availability.
- Parameters:
num_cores – desired number of cores
ram – desire RAM footprint
- Returns:
true if there is at least one host with the available free resources, false otherwise
Submit a compound job to the compute service.
These arguments are provided as a map of strings, indexed by action names. These strings are formatted as “[hostname:][num_cores]” (e.g., “somehost:12”, “somehost”,”6”, “”).
If a value is not provided for an action, then the service will choose a host and use as many cores as possible on that host.
If a “” value is provided for an action, then the service will choose a host and use as many cores as possible on that host.
If a “hostname” value is provided for an action, then the service will run the action on that host, using as many of its cores as possible
If a “num_cores” value is provided for an action, then the service will run that action with this many cores, but will choose the host on which to run it.
If a “hostname:num_cores” value is provided for an action, then the service will run that action with this many cores on that host.
- Parameters:
job – a compound job
service_specific_args – optional service specific arguments
- Throws:
std::invalid_argument –
std::runtime_error –
-
virtual bool supportsCompoundJobs() override
Returns true if the service supports compound jobs.
- Returns:
true or false
-
virtual bool supportsPilotJobs() override
Returns true if the service supports pilot jobs.
- Returns:
true or false
-
virtual bool supportsStandardJobs() override
Returns true if the service supports standard jobs.
- Returns:
true or false
Synchronously terminate a compound job previously submitted to the compute service.
- Parameters:
job – a compound job
- Throws:
std::runtime_error –
-
BareMetalComputeService(const std::string &hostname, const std::map<std::string, std::tuple<unsigned long, double>> &compute_resources, const std::string &scratch_space_mount_point, WRENCH_PROPERTY_COLLECTION_TYPE property_list = {}, WRENCH_MESSAGE_PAYLOADCOLLECTION_TYPE messagepayload_list = {})