Intel® Moderncode for Parallel Architectures
Support for developing parallel programming applications on Intel® Architecture.

disable a core

karimfath
Beginner
715 Views

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

0 Kudos
Dmitry_Vyukov
Valued Contributor I
715 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).
0 Kudos
jimdempseyatthecove
Honored Contributor III
715 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

0 Kudos
TimP
Honored Contributor III
715 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.

0 Kudos
Dmitry_Vyukov
Valued Contributor I
715 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.

0 Kudos
Reply