Bare-Metal {#guide-baremetal}


User Documentation
@endWRENCHDoc @WRENCHDeveloperDoc
Developer Documentation
@endWRENCHDoc @WRENCHInternalDoc
Internal Documentation

Overview # {#guide-baremetal-overview}

A bare-metal is a service that makes it possible to run directly jobs on hardware resources. Think of it as a set of multi-core hosts on which multi-threaded processes can be started using something like Ssh. The service does not perform any space-sharing among the jobs. In other words, jobs submitted to the service execute concurrently in a time-shared manner. It is the responsibility of the job submitter to pick hosts and/or numbers of cores for each task, e.g., to enforce space-sharing of cores. The only resource allocation performed by the service is that it ensures that the RAM capacity of a host is not exceeded. Tasks that have non-zero RAM requirements are queued in FCFS fashion at each host until there is enough RAM to execute them (think of this as each host running an OS that disallows swapping and implements a FCFS access policy for RAM allocation).

Creating a bare-metal compute service # {#guide-baremetal-creating}

In WRENCH, a bare-metal service represents a compute service (wrench::ComputeService), which is defined by the wrench::BareMetalComputeService class. An instantiation of a bare-metal service requires the following parameters:

The example below shows how to create an instance of a bare-metal service that runs on host "Gateway", provides access to 4 cores and 1GiB of RAM on host "Node1" and to 8 cores and 4GiB of RAM on host "Node2", and has a scratch space of 1TiB. Furthermore, the thread startup overhead is configured to be one hundredth of a second:

auto baremetal_cs = simulation->add(
          new wrench::BareMetalComputeService("Gateway", 
                                       {{"Node1", std::make_tuple(4, pow(2,30))}, {"Node2", std::make_tuple(8, pow(2,32)}},
                                       {{wrench::BareMetalComputeServiceProperty::THREAD_STARTUP_OVERHEAD, "0.01"}}, 

Bare-metal service properties {#guide-baremetal-creating-properties}

In addition to properties inherited from wrench::ComputeServiceProperty, a bare-metal service supports the following properties:


Submitting jobs to a bare-metal compute service # {#guide-baremetal-using}

As expected, a bare-metal service provides implementations of the methods in the wrench::ComputeService base class. The wrench::ComputeService::submitJob() method takes as argument service-specific arguments as a std::map<std::string, std::string> of key-value pairs. The key is a task ID, and the value is the service-specific argument for that task. When submitting a job to a bare-metal service, arguments can be specified a follows.

For each task, an optional argument can be provided as a string formatted as "hostname:num_cores", "hostname", or "num_cores", where "hostname" is the name of one of the service's compute hosts and "num_cores" is an integer (e.g., "host1:10", "host1", "10"):

Here is an example submission to the bare-metal service created in the above example, for a 4-task job for tasks with IDs "task1", "task2", "task3", and "task4":

// Create a job manager
auto job_manager = this->createJobManager();

// Create a job
auto job = job_manager->createStandardJob(
                  this->getWorklow()->getTaskByID("task4")}, {});

// Create service-specific arguments so that:
//   task1 will run on host Node1 with as many cores as possible
//   task2 will run on host Node2 with 16 cores
//   task3 will run on some host with as many cores as possible
//   task4 will run on some host with 4 cores
std::map<std::string, std::string> service_specific_args;
service_specific_args["task1"] = "Node1";
service_specific_args["task2"] = "Node2:16";
service_specific_args["task4"] = "4";

// Submit the job
job_manager->submitJob(job, baremetal_cs, service_specific_args);