use of cpus in building

Justin C. Walker justin at mac.com
Wed May 25 15:07:55 PDT 2016


On May 25, 2016, at 14:42 , Adam Dershowitz wrote:

> 
> 
> 
>> On May 25, 2016, at 5:25 PM, Brandon Allbery <allbery.b at gmail.com> wrote:
>> 
>> On Wed, May 25, 2016 at 5:22 PM, Christopher Jones <jonesc at hep.phy.cam.ac.uk <mailto:jonesc at hep.phy.cam.ac.uk>> wrote:
>> you don’t. Its automatic for the ports that allow it.
>> 
>> And this is also true, if that was not clear. Using multiple cores is *on by default*. You are already getting it, unless you at some point in the past overrode buildmakejobs in macports.conf.
>> 
>> -- 
> 
> 
> You can also manually change it for a single install, for example by using build.jobs.  Such as:
> sudo port install port_whatever_name build.jobs=4 
> and then, for that specific install it will attempt to use 4 cores.  This can be handy to reduce the number of cores used, from the default, so that you can do other things on the machine while building. 

FWIW, you can also increase the "thread count" because each core in modern Macs provide two "hyperthreads" per core.  It's almost like getting two cores per core, but there are various architectural limitations in getting "full throttle" performance (memory bandwidth, ...).

Also, to see this in action, you can use the Activity Monitor, and invoke "Window -> Floating CPU Window -> {Horizontal, Vertical, None}".  This gives you a sort of histogram view of per-hyperthread activity.

I regularly build SageMath on Macs, and usually max out the thread count.  There can be issues with this.  I've had my systems tie themselves up in what appear to be resource knots, but I've never tracked down the real cause (the apps I use to see what goes on get stalled when this happens).  Sometimes the system doesn't recover, but mostly, it does.

HTH

Justin

--
Justin C. Walker, Curmudgeon-At-Large
Institute for the Enhancement of the Director's Income
--------
Experience is what you get
  when you don't get what you want.
--------





More information about the macports-users mailing list