Community
cancel
Showing results for 
Search instead for 
Did you mean: 
karimfath
Beginner
79 Views

disable a core

hello

how can we disable one or many cores in multicore architectures in the goal to save energy.and where can we found routine to do this

thanks

0 Kudos
5 Replies
robert-reed
Valued Contributor II
79 Views

Your desire to save energy, while laudable, is probably misplaced. A lot of the effort that goes into modern microprocessor design is trying to get more done with less energy, like shutting off parts of the front end when there's no work to do, and future designs will only get more creative in finding ways to save power.

In light of these efforts, there's probably not a lot more you can do under program control. In fact, programmatically selecting cores to be on or off seems an unnecessarily brute force approach, and is not likely to improve over the dynamic hardware measures built in.

Dmitry_Vyukov
Valued Contributor I
79 Views

Hardware and OS will do that automatically for you. Just do not load those cores (affinitize your threads to a subset of available cores, in Windows you can do that from Task Manager for any application).
jimdempseyatthecove
Black Belt
79 Views

Any approach you choose now will apply to current platform archetecture. With the newer processors having variable speed stepping the best technique may have to wait for an OS update (or driver for OS).

Another indirect way is to write a small console app that accepts as a command line argument the processor number to inerfere with. This program sets its affinity to that processor and then sits in a loop executing _mm_pause(); Although this app will be constantly running (until you terminate it) it will be running in a low power state (except for some processors). You may want to increase the priority of this app. The idea is to shove the real apps to a different core. This is similar to what Dmitriy suggested in that you are attempting to avoid use of certain cores.

Jim Dempsey

TimP
Black Belt
79 Views

If you are running with a library such as OpenMP or TBB, you have available environment variables to request execution on specific cores. This unloads the other cores, permitting the hardware power saving features to kick in. Current operating systems are better than older ones at maintaining execution locality without programmer hints; for example, Windows 7 ought to show improvement over older versions.

If you are trying to save power, you will be using your BIOS options to disable HyperThreading and Turbo mode.

Dmitry_Vyukov
Valued Contributor I
79 Views

If you goal is to completely disable a subset of cores, then you can disable them at OS boost.

On Windows you can set 'numproc' option in boost configuration. To get maximum power savings you can set 'onecpu' option (I suspect OS uses special optimized single-threaded kernel in such case).

Google by "bcdedit numproc".

I am sure Linux has similar boot options.

Reply