CPU% wrong for fractional CPU cores

Started by hucker, August 08, 2023, 06:28:11 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

hucker

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.

fred

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>

hucker

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?

fred

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.
           

hucker

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.

fred

The CPU calculates these numbers. 0.7C is just an estimate and the real fraction may be something else.

hucker

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%.

fred

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%.

hucker

#8
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.

fred

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.

hucker

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.

fred

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.

hucker

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.