diff --git a/src/users/broker.cpp b/src/users/broker.cpp index 4091a5d674b3f1fb8fb1c698050a50f9c28807fb..e36b7f2f7cb07312710a3fb767f37315f3902797 100644 --- a/src/users/broker.cpp +++ b/src/users/broker.cpp @@ -127,9 +127,6 @@ Broker::Broker(rapidjson::Document *user_description_file) else if (category == "replay_user_rigid") user = new ReplayUserRigid(name, param, dm_window); - else if (category == "replay_user_reconfig") - user = new ReplayUserReconfig(name, param, seed_generator()); - /* DM user */ else if (category == "dm_user_reconfig" || category == "dm_user_degrad" || category == "dm_user_renonce" diff --git a/src/users/user_description_file_template.json b/src/users/user_description_file_template.json index 36bbe20b8058b10ce06817e7329f8b945ceb7d15..3b4c18563fee352eb66d96698fbb5475fa376f0f 100644 --- a/src/users/user_description_file_template.json +++ b/src/users/user_description_file_template.json @@ -36,14 +36,6 @@ "input_json": "charly.json" } }, - { - "name": "donella", - "category": "replay_user_reconfig", - "param": { - "input_json": "donella.json", - "big_medium_little": [0.4, 0.4, 0.2] - } - }, { "name": "elias", "category": "dm_user_reconfig", diff --git a/src/users/user_replay.cpp b/src/users/user_replay.cpp index 3377ee6c75ba06e791a72d679a898be08c7b360b..409dca46f9f774ae8ade90483d4f52ef9370ffa3 100644 --- a/src/users/user_replay.cpp +++ b/src/users/user_replay.cpp @@ -81,11 +81,6 @@ void ReplayUser::jobs_to_submit(double date, std::list<shared_ptr<Job>> &jobs, = lround(original_trace->top()->submission_time); } -int *ReplayUser::get_dm_stat() -{ - return dm_stat; -} - /* ReplayUserRigid */ ReplayUserRigid::ReplayUserRigid( std::string name, const rapidjson::Value ¶m, DMWindow *window) @@ -120,96 +115,6 @@ bool ReplayUserRigid::handle_job( return true; } -/* ReplayUserReconfig */ -bool ReplayUserReconfig::handle_job( - double date, shared_ptr<Job> job, Profile *profile) -{ - int orig_nb_core = job->nb_requested_resources; - - double drawing = distribution(random_gen); - std::string flavor; - if (drawing < big) - // no reconfig - flavor = "b"; - else if (drawing < big + medium) - { - // divide by 2 rounded up - job->nb_requested_resources = (orig_nb_core + 1) / 2; - flavor = "m"; - } - else - { - // divide by 4 rounded up - job->nb_requested_resources = (orig_nb_core + 3) / 4; - flavor = "l"; - } - - build_profile(profile, job->profile, orig_nb_core, flavor); - job->profile = profile->name; - return true; -} - -Profile *ReplayUserReconfig::build_profile( - Profile *profile, std::string duration, int nb_core, std::string flavor) -{ - profile->workload_name = user_name; - - if (nb_core == 1) - profile->name = "1_" + duration; - else - profile->name = flavor + "_" + duration; - - double compute_load - = std::stod(duration) * nb_core * PLATFORM_COMPUTING_SPEED; - profile->description - = "{\"com\": 0.0, \"cpu\": " + std::to_string(compute_load) - + ", \"type\": \"parallel_homogeneous_total\"}"; - - return profile; -} - -ReplayUserReconfig::ReplayUserReconfig( - std::string name, const rapidjson::Value ¶m, uint_fast32_t random_seed) -{ - PPK_ASSERT_ERROR(param.HasMember("big_medium_little"), - "Invalid user_description file: wrong 'param' for user %s, there " - "should be an 'big_medium_little' field", - name.c_str()); - PPK_ASSERT_ERROR(param["big_medium_little"].IsArray() - && param["big_medium_little"].GetArray().Size() == 3, - "Invalid user_description file for user %s: 'big_medium_little' " - "should " - "be an array of size 3", - name.c_str()); - - auto bml = param["big_medium_little"].GetArray().begin(); - big = (bml++)->GetDouble(); - medium = (bml++)->GetDouble(); - little = bml->GetDouble(); - PPK_ASSERT_ERROR(big + medium + little == 1.0, - "Invalid user_description file for user %s: the sum of " - "'big_medium_little' should be 1.0.", - name.c_str()); - - /* Initialize name and input json */ - init_ReplayUser(name, param); - - /* Initialize random generator with seed for reproductible experiments - */ - random_gen = std::mt19937(random_seed); -} - -ReplayUserReconfig::~ReplayUserReconfig() -{ - delete original_trace; -} - -void ReplayUserReconfig::jobs_to_submit(double date, - std::list<shared_ptr<Job>> &jobs, std::list<const Profile *> &profiles) -{ - ReplayUser::jobs_to_submit(date, jobs, profiles); -} - /****************************************************************************** *********************** Users "demand response" ****************************** *****************************************************************************/ diff --git a/src/users/user_replay.hpp b/src/users/user_replay.hpp index aff97b5316f0867bc170104ea08a0851474f767e..338422fba7f88346aca09dac1578486f0db7c5c0 100644 --- a/src/users/user_replay.hpp +++ b/src/users/user_replay.hpp @@ -42,7 +42,6 @@ protected: * behavior and returns if it should still be executed now. */ virtual bool handle_job(double date, shared_ptr<Job>job, Profile *profile) = 0; - virtual int *get_dm_stat(); protected: std::string input_json; @@ -73,39 +72,6 @@ protected: bool handle_job(double date, shared_ptr<Job>job, Profile *profile); }; -/** - * @brief The user follows the same submission times as in the input trace but - * sometimes resizing the jobs (ie changing the number of cores allocated). - * @details The user is given as input a tuple big_medium_little representing - * the proportion of jobs to run with original size (big), with half (medium) - * and a quarter (little) of the original size. Achieved by random drawing. - */ -class ReplayUserReconfig : public ReplayUser -{ -public: - ReplayUserReconfig(std::string name, const rapidjson::Value ¶m, - uint_fast32_t random_seed); - ~ReplayUserReconfig(); - long next_submission(); - void jobs_to_submit( - double date, std::list<shared_ptr<Job>> &jobs, std::list<const Profile *> &profiles); - -protected: - /** Draw a random variable according to the proportions given by - * big_medium_little and reconfigure the number of cores requested - * accordingly. */ - bool handle_job(double date, shared_ptr<Job>job, Profile *profile); - -private: - double big, medium, little; - std::mt19937 random_gen; - std::uniform_real_distribution<double> distribution - = std::uniform_real_distribution<double>(0.0, 1.0); - - Profile *build_profile(Profile *profile, std::string duration, int nb_core, - std::string flavor); -}; - /****************************************************************************** *********************** Users "demand response" ****************************** diff --git a/test/schedconf/replay_user_reconfig.json b/test/schedconf/replay_user_reconfig.json deleted file mode 100644 index 8f9cc279bbaf08a16bf0c7f75a2f31ec8e8f18c5..0000000000000000000000000000000000000000 --- a/test/schedconf/replay_user_reconfig.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "users": [ - { - "name": "user14", - "category": "replay_user_reconfig", - "param": { - "input_json": "test/workloads/dyn/user14.json", - "big_medium_little": [0.4, 0.4, 0.2] - } - }, - { - "name": "user15", - "category": "replay_user_reconfig", - "param": { - "input_json": "test/workloads/dyn/user15.json", - "big_medium_little": [0.4, 0.4, 0.2] - } - }, - { - "name": "user16", - "category": "replay_user_reconfig", - "param": { - "input_json": "test/workloads/dyn/user16.json", - "big_medium_little": [0.4, 0.4, 0.2] - } - }, - { - "name": "user18", - "category": "replay_user_reconfig", - "param": { - "input_json": "test/workloads/dyn/user18.json", - "big_medium_little": [0.4, 0.4, 0.2] - } - } - ] -} \ No newline at end of file diff --git a/test/test_users.py b/test/test_users.py index d7943138b915287726eb664b13798a3aab106f98..f4598fc9dcb680d079b972bf9056cfa4ca04bcc0 100644 --- a/test/test_users.py +++ b/test/test_users.py @@ -6,7 +6,6 @@ users = [ "dicho_intersubmission_time", "routine_greedy", "replay_user_rigid", - "replay_user_reconfig" ] #### User models #### @@ -35,10 +34,6 @@ def test_replay_user_rigid(platform_multiC): assert_exec_time_equals_profile(out_dir) -def test_replay_user_reconfig(platform_multiC): - run_user('replay_user_reconfig', platform_multiC) - - def run_user(user_name, platform_multiC, test_name=None, schedconf=None): if test_name == None: test_name = f'{user_name}-{platform_multiC.name}'