Linux provides a mechanism to hotplug a CPU (core) online or offline during the runtime, which is very convenient for me to dynamically adjust the CPU topology. As usual, I have written a python script (Link: gist:1331343) to make this manually task easy. This script accepts similar parameters as taskset(8):
# Set core 1,2,3,5,6,7,9,12 online, and other cores offline.
$ set_cpus.py 1-3,5-7,9,12
# Reset all cores to be online
$ set_cpus.py -r
$ set_cpus.py 1-3,5-7,9,12
# Reset all cores to be online
$ set_cpus.py -r