[Scons-users] Add `--parallel` option to automatically use all CPU threads

Bill Deegan bill at baddogconsulting.com
Wed Apr 6 23:21:59 EDT 2022


Fred,

We like to allow our users flexibility.
Some will use that to shoot themselves in the foot, but some will do
something interesting with it.
Thus SetOption() can override command line arguments.

Re first paragraph, sure, we can of course change the default to 0 in which
case it's possible to tell if the user specified such.

We do have outstanding enhancement request to tell if a flag was set on
command line or via SetOption() still outstanding.
Unfortunately scons command line processing is more complicated than the
norm due to  allowing users SConstruct logic to add additiona command line
flags (in addition to targets and variables).

-Bill

On Wed, Apr 6, 2022 at 6:58 PM Fred Wright <fw at fwright.net> wrote:

>
> On Wed, 6 Apr 2022, Bill Deegan wrote:
>
> > There's no need to add an additional option for this.
> > If you can programmatically detect the # of cores (in python), you can do
> > this in your own code via SetOption('num_jobs', NUMBER  HERE) and even
> > check if num_jobs is set to 1 which is the current default value and if
> so
> > then set it to the actual number of cores.
> >
> > What might work as a SCons default behavior change though, is to have
> -j's
> > default value be 0 and if 0, use some logic to set based on # of
> available
> > cores.
>
> MacPorts does something like this, though it also looks at the amount of
> RAM.  I think it assumes that you should have at least N+1 GiB of RAM for
> N parallel processes.
>
> The parallel default seems reasonable, and it can be overridden when
> needed by explicitly giving -j1.  But that wouldn't work if your
> suggestion in the first paragraph were used.  So perhaps SetOption()
> shouldn't be able to override an explicit setting on the command line.
>
> Fred Wright
> _______________________________________________
> Scons-users mailing list
> Scons-users at scons.org
> https://pairlist4.pair.net/mailman/listinfo/scons-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20220406/521614ad/attachment-0001.htm>


More information about the Scons-users mailing list