Skip to content
Snippets Groups Projects
Commit 87692c18 authored by jgatt's avatar jgatt Committed by Maël Madon
Browse files

reduce use of rounding in reconfig_job + explicit double conversion

parent e8fe3e63
Branches
Tags
1 merge request!21issue17,18,21_new
......@@ -56,7 +56,15 @@ bool reconfig_job(shared_ptr<Job> job, Profile *profile, double alpha,
* => T_n = (orig_nb_core / n)^alpha * T_orig
*/
long T_orig = std::stol(job->profile);
long T_n = pow((double)orig_nb_core / n, alpha) * T_orig;
long T_n;
if (orig_nb_core%n != 0 || alpha != 1.0)
{
T_n =(long) (( pow((double)orig_nb_core / n, alpha) )* (double) T_orig);
}
else
{
T_n = orig_nb_core/n *T_orig;
}
Parser::profile_from_duration(
profile, std::to_string(T_n), user->user_name); // parallel_homogeneous
job->nb_requested_resources = n;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment