Commit 0c319b04 authored by MOMMESSIN Clement's avatar MOMMESSIN Clement Committed by Millian Poquet

[code/test] Rename time-sharing

parent 0436bb8c
......@@ -260,10 +260,10 @@ Workflow options:
Other options:
--dump-execution-context Does not run the actual simulation but dumps the execution
context on stdout (formatted as a JSON object).
--enable-time-sharing-on-compute Enables time sharing on compute machines:
One resource may compute several jobs at the same time.
--disable-time-sharing-on-storage Disables time sharing on storage machines:
IO jobs will be performed one at a time on storage machines.
--enable-compute-sharing Enables compute resource sharing:
One compute resource may be used by several jobs at the same time.
--disable-storage-sharing Disables storage resource sharing:
One storage resource may be used by several jobs at the same time.
--no-sched If set, the jobs in the workloads are
computed one by one, one after the other,
without scheduler nor Redis.
......@@ -525,8 +525,8 @@ Other options:
// Other options
// *************
main_args.dump_execution_context = args["--dump-execution-context"].asBool();
main_args.allow_time_sharing_on_compute = args["--enable-time-sharing-on-compute"].asBool();
main_args.allow_time_sharing_on_storage = !(args["--disable-time-sharing-on-storage"].asBool());
main_args.allow_compute_sharing = args["--enable-compute-sharing"].asBool();
main_args.allow_storage_sharing = !(args["--disable-storage-sharing"].asBool());
if (args["--no-sched"].asBool())
{
main_args.program_type = ProgramType::BATEXEC;
......@@ -870,8 +870,8 @@ void set_configuration(BatsimContext *context,
context->export_prefix = main_args.export_prefix;
context->workflow_nb_concurrent_jobs_limit = main_args.workflow_nb_concurrent_jobs_limit;
context->energy_used = main_args.energy_used;
context->allow_time_sharing_on_compute = main_args.allow_time_sharing_on_compute;
context->allow_time_sharing_on_storage = main_args.allow_time_sharing_on_storage;
context->allow_compute_sharing = main_args.allow_compute_sharing;
context->allow_storage_sharing = main_args.allow_storage_sharing;
context->trace_schedule = main_args.enable_schedule_tracing;
context->trace_machine_states = main_args.enable_machine_state_tracing;
context->simulation_start_time = chrono::high_resolution_clock::now();
......
......@@ -103,8 +103,8 @@ struct MainArguments
std::vector<std::string> simgrid_config; //!< The list of configuration options to pass to SimGrid.
std::vector<std::string> simgrid_logging; //!< The list of simulation logging options to pass to SimGrid.
bool dump_execution_context = false; //!< Instead of running the simulation, print the execution context as JSON on the standard output.
bool allow_time_sharing_on_compute = false; //!< Allows/forbids time sharing on compute machines. Two jobs can run on the same machine if and only if time sharing is allowed.
bool allow_time_sharing_on_storage = false; //!< Allows/forbids time sharing on storage machines. Two jobs can run on the same machine if and only if time sharing is allowed.
bool allow_compute_sharing = false; //!< Allows/forbids sharing on compute machines. Two jobs can run on the same machine if and only if sharing is allowed.
bool allow_storage_sharing = false; //!< Allows/forbids sharing on storage machines. Two jobs can run on the same machine if and only if sharing is allowed.
ProgramType program_type = ProgramType::BATSIM; //!< The program type (Batsim or Batexec at the moment)
std::string pfs_host_name; //!< The name of the SimGrid host which serves as parallel file system (a.k.a. large-capacity storage tier)
std::string hpst_host_name; //!< The name of the SimGrid host which serves as the high-performance storage tier
......
......@@ -71,8 +71,8 @@ struct BatsimContext
bool energy_used; //!< Stores whether the energy part of Batsim should be used
bool smpi_used; //!< Stores whether SMPI should be used
bool allow_time_sharing_on_compute; //!< Stores whether time sharing (using the same machines to compute different jobs) should be allowed on compute machines
bool allow_time_sharing_on_storage; //!< Stores whether time sharing (using the same machines to compute different jobs) should be allowed on storage machines
bool allow_compute_sharing; //!< Stores whether sharing (using the same machines to compute different jobs) should be allowed on compute machines
bool allow_storage_sharing; //!< Stores whether sharing (using the same machines to compute different jobs) should be allowed on storage machines
bool trace_schedule; //!< Stores whether the resulting schedule should be outputted
bool trace_machine_states; //!< Stores whether the machines states should be outputted
std::string platform_filename; //!< The name of the platform file
......
......@@ -50,16 +50,16 @@ void JsonProtocolWriter::append_requested_call(double date)
void JsonProtocolWriter::append_simulation_begins(Machines & machines,
Workloads & workloads,
const Document & configuration,
bool allow_time_sharing_on_compute,
bool allow_time_sharing_on_storage,
bool allow_compute_sharing,
bool allow_storage_sharing,
double date)
{
/*{
"timestamp": 0.0,
"type": "SIMULATION_BEGINS",
"data": {
"allow_time_sharing_on_compute": false,
"allow_time_sharing_on_storage": true,
"allow_compute_sharing": false,
"allow_storage_sharing": true,
"nb_compute_resources": 1,
"nb_storage_resources": 1,
"config": {},
......@@ -118,8 +118,8 @@ void JsonProtocolWriter::append_simulation_begins(Machines & machines,
data.AddMember("nb_compute_resources", Value().SetInt(machines.nb_compute_machines()), _alloc);
data.AddMember("nb_storage_resources", Value().SetInt(machines.nb_storage_machines()), _alloc);
// FIXME this should be in the configuration and not there
data.AddMember("allow_time_sharing_on_compute", Value().SetBool(allow_time_sharing_on_compute), _alloc);
data.AddMember("allow_time_sharing_on_storage", Value().SetBool(allow_time_sharing_on_storage), _alloc);
data.AddMember("allow_compute_sharing", Value().SetBool(allow_compute_sharing), _alloc);
data.AddMember("allow_storage_sharing", Value().SetBool(allow_storage_sharing), _alloc);
data.AddMember("config", config, _alloc);
Value compute_resources(rapidjson::kArrayType);
......
......@@ -77,15 +77,15 @@ public:
* @param[in] machines The machines usable to compute jobs
* @param[in] workloads The workloads given to batsim
* @param[in] configuration The simulation configuration
* @param[in] allow_time_sharing_on_compute Whether time sharing is enabled on compute machines
* @param[in] allow_time_sharing_on_storage Whether time sharing is enabled on storage machines
* @param[in] allow_compute_sharing Whether sharing is enabled on compute machines
* @param[in] allow_storage_sharing Whether sharing is enabled on storage machines
* @param[in] date The event date. Must be greater than or equal to the previous event.
*/
virtual void append_simulation_begins(Machines & machines,
Workloads & workloads,
const rapidjson::Document & configuration,
bool allow_time_sharing_on_compute,
bool allow_time_sharing_on_storage,
bool allow_compute_sharing,
bool allow_storage_sharing,
double date) = 0;
/**
......@@ -232,15 +232,15 @@ public:
* @param[in] machines The machines usable to compute jobs
* @param[in] workloads The workloads given to batsim
* @param[in] configuration The simulation configuration
* @param[in] allow_time_sharing_on_compute Whether time sharing is enabled on compute machines
* @param[in] allow_time_sharing_on_storage Whether time sharing is enabled on storage machines
* @param[in] allow_compute_sharing Whether sharing is enabled on compute machines
* @param[in] allow_storage_sharing Whether sharing is enabled on storage machines
* @param[in] date The event date. Must be greater than or equal to the previous event.
*/
void append_simulation_begins(Machines & machines,
Workloads & workloads,
const rapidjson::Document & configuration,
bool allow_time_sharing_on_compute,
bool allow_time_sharing_on_storage,
bool allow_compute_sharing,
bool allow_storage_sharing,
double date);
/**
......
......@@ -31,8 +31,8 @@ void server_process(BatsimContext * context)
context->proto_writer->append_simulation_begins(context->machines,
context->workloads,
context->config_json,
context->allow_time_sharing_on_compute,
context->allow_time_sharing_on_storage,
context->allow_compute_sharing,
context->allow_storage_sharing,
MSG_get_clock());
string send_buffer = context->proto_writer->generate_current_message(MSG_get_clock());
......@@ -883,13 +883,13 @@ void server_on_execute_job(ServerData * data,
data->nb_running_jobs++;
xbt_assert(data->nb_running_jobs <= data->nb_submitted_jobs);
if (!data->context->allow_time_sharing_on_compute || !data->context->allow_time_sharing_on_storage)
if (!data->context->allow_compute_sharing || !data->context->allow_storage_sharing)
{
for (auto machine_id_it = allocation->machine_ids.elements_begin(); machine_id_it != allocation->machine_ids.elements_end(); ++machine_id_it)
{
int machine_id = *machine_id_it;
const Machine * machine = data->context->machines[machine_id];
if (machine->has_role(roles::Permissions::COMPUTE_NODE) && !data->context->allow_time_sharing_on_compute)
if (machine->has_role(roles::Permissions::COMPUTE_NODE) && !data->context->allow_compute_sharing)
{
(void) machine; // Avoids a warning if assertions are ignored
xbt_assert(machine->jobs_being_computed.empty(),
......@@ -898,7 +898,7 @@ void server_on_execute_job(ServerData * data,
job->id.to_string().c_str(), machine->id, machine->name.c_str(),
machine->jobs_being_computed_as_string().c_str());
}
if (machine->has_role(roles::Permissions::STORAGE) && !data->context->allow_time_sharing_on_storage)
if (machine->has_role(roles::Permissions::STORAGE) && !data->context->allow_storage_sharing)
{
(void) machine; // Avoids a warning if assertions are ignored
xbt_assert(machine->jobs_being_computed.empty(),
......
......@@ -229,7 +229,7 @@ add_subdirectory(energy)
add_subdirectory(energy-efail)
add_subdirectory(energy-minimal)
add_subdirectory(walltime)
add_subdirectory(timesharing)
add_subdirectory(resourcesharing)
add_subdirectory(submitorder)
add_subdirectory(redis)
add_subdirectory(dynsubmit)
......
......@@ -25,15 +25,15 @@ foreach(simu_instance IN LISTS simu_instances)
list(GET list_algo 0 algo_name)
list(GET list_algo 1 algo_realname)
add_test_robintest_batsched(NAME "timesharing-${workload_name}-${platform_name}-${algo_name}"
add_test_robintest_batsched(NAME "resourcesharing-${workload_name}-${platform_name}-${algo_name}"
PLATFORM ${platform_filename}
WORKLOAD ${workload_filename}
ALGORITHM ${algo_realname}
OTH_BATSIM_ARGS "--enable-time-sharing-on-compute"
OTH_BATSIM_ARGS "--enable-compute-sharing"
ROBINTEST_EXPECTATION "--expect-ctx-clean --expect-robin-success --expect-sched-success --expect-batsim-success"
)
add_test_robintest_batsched(NAME "timesharing-efail-${workload_name}-${platform_name}-${algo_name}"
add_test_robintest_batsched(NAME "resourcesharing-efail-${workload_name}-${platform_name}-${algo_name}"
PLATFORM ${platform_filename}
WORKLOAD ${workload_filename}
ALGORITHM ${algo_realname}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment