eFMer - BoincTasks and TThrottle forum

BoincTasks For Window, Mac & Linux => Beta Testing => Topic started by: hucker on August 08, 2023, 06:28:11 AM

Title: CPU% wrong for fractional CPU cores
Post by: hucker on August 08, 2023, 06:28:11 AM
If I set a task to take 1.5 cores, the CPU% column gives erroneous figures.  It works ok for whole numbers of  cores.

There's a good reason to set 1.5 cores, some tasks are more taxing and make the computer sluggish, so I make the scheduler do less of those by giving them 1.5 cores each, using <avg_ncpus>1.5</avg_ncpus> in app config.
Title: Re: CPU% wrong for fractional CPU cores
Post by: fred on September 13, 2023, 07:33:54 AM
The % is a BOINC thing, BoincTasks uses time and cpu time.
It might go beyond 100%, you might want to try setting config.xml and restart BoincTasks.
C:\Program Files\eFMer\BoincTasks\

<config>
   <options>
      <no_cleanup>   1   </no_cleanup>
   </options>
</config>
Title: Re: CPU% wrong for fractional CPU cores
Post by: hucker on September 13, 2023, 08:00:26 AM
Not sure what you mean.  Boinctasks displays in the elapsed time column, a time, followed by another time in brackets.  The CPU% column appears to try to show the percentage of one versus the other, but including how many CPU cores are set to run for that task.  Which of these is Boinc controlled and which are calculated by Boinctasks?
Title: Re: CPU% wrong for fractional CPU cores
Post by: fred on September 13, 2023, 09:48:52 AM
03:15:45 (02:46:40) 85.14
The fist number is the clock time, the second () the CPU run time.
Non of this is BoincTasks controlled.
           
Title: Re: CPU% wrong for fractional CPU cores
Post by: hucker on September 13, 2023, 08:00:14 PM
But which program calculates the % from those numbers?  I can have 03:15:45 (02:46:40) 85.14% 0.7C, where the 0.7 is not taken into account.  Things like 6C are ok though.
Title: Re: CPU% wrong for fractional CPU cores
Post by: fred on September 14, 2023, 06:14:04 AM
The CPU calculates these numbers. 0.7C is just an estimate and the real fraction may be something else.
Title: Re: CPU% wrong for fractional CPU cores
Post by: hucker on September 14, 2023, 07:34:16 AM
The 0.7C was me using an app_config:

    <app_version>
        <app_name>Theory</app_name>
        <plan_class>vbox64_theory</plan_class>
        <avg_ncpus>0.7</avg_ncpus>
    </app_version>

This may seem an odd thing to do, but Theory on LHC downloads massive amounts of data, an d often the CPU is held up waiting, so I run more tasks than I have CPU threads.

If I have set 0.7C, and the times are showing say 70min out of 100min, that ought to show as 100%.
Title: Re: CPU% wrong for fractional CPU cores
Post by: fred on September 14, 2023, 12:55:52 PM
I wonder if <avg_ncpus>0.7</avg_ncpus> does anything besides showing on the screen.
BoincTasks shows the actual run % reported by the OS to the Boinc Client -> BoincTasks.
70 min out of 100 min = 70% 100 min out of 100 min = 100%.
0.7 = expected run time 70%.
Title: Re: CPU% wrong for fractional CPU cores
Post by: hucker on September 14, 2023, 11:00:48 PM
I've just experimented by changing <avg_ncpus> on the fly.  It's rounding it up to the next whole number.  1, 2, 3, 4, 5, 6 all work fine.  0.8 gives the same percentage as 1.  1.1 gives the same percentage as 2.

However it does work for scheduling.  If I change 1 to 0.9 on a 24 core machine, it runs 27 tasks instead of 24.

I'd assumed the task itself reported a time, and Boinc or Boinctasks divided the processing time by the wall time.  So you're saying Boinc or Boinctasks receives a % from the OS (like you see in task manager), and uses that along with the time the task has run for, to calculate the processing time?  Something somewhere (not in the OS) must be then dividing by the number of cores in avg_ncpus, but it's using an integer and assumed nobody would ever set fractional cores.  Under 1 core is odd I admit, but it's feasible to set say 6.5 cores in an 8 core task which uses an average below what it's capable of.
Title: Re: CPU% wrong for fractional CPU cores
Post by: fred on September 18, 2023, 12:27:57 PM
Quote from: hucker on September 14, 2023, 11:00:48 PMI'd assumed the task itself reported a time, and Boinc or Boinctasks divided the processing time by the wall time.  So you're saying Boinc or Boinctasks receives a % from the OS (like you see in task manager), and uses that along with the time the task has run for, to calculate the processing time?  Something somewhere (not in the OS) must be then dividing by the number of cores in avg_ncpus, but it's using an integer and assumed nobody would ever set fractional cores.  Under 1 core is odd I admit, but it's feasible to set say 6.5 cores in an 8 core task which uses an average below what it's capable of.
I think tasks are assigned to any CPU not a fixed one and may even transfer to another CPU.
A 24 core machine can and will run way more than 27 tasks.....
But the more tasks you run the more the CPU has to switch between tasks making things less efficient.
Title: Re: CPU% wrong for fractional CPU cores
Post by: hucker on September 18, 2023, 01:19:39 PM
Yes I try to make it exactly 100% busy.  But when LHC tasks are idling waiting for downloads, I might aswell have it switching in other ones.

On this main machine I use for the web etc, I tell it 1.6 CPUs each, as running VB tasks slows the interface.
Title: Re: CPU% wrong for fractional CPU cores
Post by: fred on September 20, 2023, 02:57:14 PM
What I personally like to do is start another BOINC instance and assign work to 1 or 2 CPU.
Or what I do in Windows use WSL to start another BOINC instance.
Title: Re: CPU% wrong for fractional CPU cores
Post by: hucker on September 20, 2023, 07:20:54 PM
Tried that before (to get round the lack in Boinc of pausing only the CPU when an exclusive app is running), but it's very difficult to get it to work.  Setting less than 1 core per task is easier, and you can do it only for those apps which aren't fully using it.