Per, this was a good find.

This is what I ended up adding to the 2.3 code base.  The same patch should 
work for 2.2 as well.  This has been tested and appears to fix the cosmetic 
bug.

Thanks,
Danny

diff --git a/src/plugins/priority/multifactor/priority_multifactor.c 
b/src/plugins/priority/multifactor/priority_multifactor.c
index 10de9bd..bcfed05 100644
--- a/src/plugins/priority/multifactor/priority_multifactor.c
+++ b/src/plugins/priority/multifactor/priority_multifactor.c
@@ -550,7 +550,7 @@ static uint32_t _get_priority_internal(time_t start_time,
        /* figure out the priority */
        _get_priority_factors(start_time, job_ptr);
        memcpy(&pre_factors, job_ptr->prio_factors,
-              sizeof(job_ptr->prio_factors));
+              sizeof(priority_factors_object_t));
 
        job_ptr->prio_factors->priority_age *= (double)weight_age;
        job_ptr->prio_factors->priority_fs *= (double)weight_fs;


Also on github at...
https://github.com/SchedMD/slurm/commit/7423c5d47afa425072d6e41a9e77578de610003c

On Tuesday September 06 2011 11:18:37 AM you wrote:
> Hi,
> 
> I've noticed some strange debug print statements that I don't
> understand, for example:
> 
>    [2011-08-19T11:24:46] Fairshare priority of job 218244 for user perl in 
> acct nsc is 2**(-0.001227/0.000541) = 0.207854
>    ...
>    [2011-08-19T11:24:46] Weighted Fairshare priority is 0.000000 * 1000000 = 
> 207853.56
> 
> Where I'd expect the last line to print
> 
>    [2011-08-19T11:24:46] Weighted Fairshare priority is 0.207854 * 1000000 = 
> 207853.56
> 
> This might be caused by an insufficient copy (note: untested):
> 
> --- slurm-2.2.7/src/plugins/priority/multifactor/priority_multifactor.c~      
> 2011-06-10 18:57:28.000000000 +0200
> +++ slurm-2.2.7/src/plugins/priority/multifactor/priority_multifactor.c       
> 2011-09-06 11:04:56.042934202 +0200
> @@ -549,7 +549,7 @@
>       /* figure out the priority */
>       _get_priority_factors(start_time, job_ptr);
>       memcpy(&pre_factors, job_ptr->prio_factors,
> -            sizeof(job_ptr->prio_factors));
> +            sizeof(*(job_ptr->prio_factors)));
>  
>       job_ptr->prio_factors->priority_age *= (double)weight_age;
>       job_ptr->prio_factors->priority_fs *= (double)weight_fs;
> 
> 
> 
> 

Reply via email to