Hi,

d.getVar("BB_NUMBER_THREADS") returns a string and it needs to be
converted to int.

-nproc = min(d.getVar("BB_NUMBER_THREADS"), len(tasklist))
+nproc = min(int(d.getVar("BB_NUMBER_THREADS")), len(tasklist))

fixed in V4

Richard Purdie <[email protected]> escreveu no dia
quarta, 18/08/2021 à(s) 20:34:
>
> On Wed, 2021-08-18 at 17:24 +0100, Jose Quaresma wrote:
> > - bitbake BB_NUMBER_THREADS uses cpu_count from oe utils that uses
> > the python os.sched_getaffinity and it is more acurrate.
> >
> >  grep -nH ^BB_NUMBER_THREADS meta/conf/bitbake.conf
> >  meta/conf/bitbake.conf:806:BB_NUMBER_THREADS ?= "${@oe.utils.cpu_count()}"
> >
> > - multiprocessing.cpu_count() returns the number of CPUs on the host,
> > not the number of usable CPUs on the host. If the user is using
> > scheduler affinity then the number of usable CPUs may be less,
> > so when determining how many cores we can use check the affinity instead.
> >
> > Signed-off-by: Jose Quaresma <[email protected]>
> > ---
> >  meta/classes/sstate.bbclass | 5 ++---
> >  1 file changed, 2 insertions(+), 3 deletions(-)
> >
> > diff --git a/meta/classes/sstate.bbclass b/meta/classes/sstate.bbclass
> > index c3c145e7f3..bc14b5e264 100644
> > --- a/meta/classes/sstate.bbclass
> > +++ b/meta/classes/sstate.bbclass
> > @@ -964,13 +964,12 @@ def sstate_checkhashes(sq_data, d, siginfo=False, 
> > currentcount=0, summary=True,
> >              tasklist.append((tid, sstatefile))
> >
> >
> >
> >
> >          if tasklist:
> > +            nproc = min(d.getVar("BB_NUMBER_THREADS"), len(tasklist))
> > +
> >              if len(tasklist) >= min_tasks:
> >                  msg = "Checking sstate mirror object availability"
> >                  bb.event.fire(bb.event.ProcessStarted(msg, len(tasklist)), 
> > d)
> >
> >
> >
> >
> > -            import multiprocessing
> > -            nproc = min(multiprocessing.cpu_count(), len(tasklist))
> > -
> >              bb.event.enable_threadlock()
> >              pool = oe.utils.ThreadedPool(nproc, len(tasklist),
> >                      worker_init=checkstatus_init, 
> > worker_end=checkstatus_end)
>
>
> https://autobuilder.yoctoproject.org/typhoon/#/builders/69/builds/3825/steps/17/logs/stdio
>
> Cheers,
>
> Richard
>
>


-- 
Best regards,

José Quaresma
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#154944): 
https://lists.openembedded.org/g/openembedded-core/message/154944
Mute This Topic: https://lists.openembedded.org/mt/84976055/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to