Linux - Server This forum is for the discussion of Linux Software used in a server related context. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
12-20-2010, 07:20 AM
|
#1
|
LQ Newbie
Registered: Jul 2010
Posts: 22
Rep:
|
Need help in identifying the number of cores in each processor running
Hi All,
I need your help in identifying the number of cores each processor is running.
I have checked /proc/cpuinfo but i dont find any core details inside it and I can find only no of processor and its speed, please help me on this.
Thanks
|
|
|
12-20-2010, 08:40 AM
|
#2
|
Senior Member
Registered: Oct 2003
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,541
|
There is a really handy utility, GKrellM (see http://members.dslextreme.com/users/...m/gkrellm.html) that you might find useful -- it shows every core with an indication of how busy it is along with a graph of activity along with other system activity displays. I just start it up and let it run in a corner of the screen and keep an eye on it.
Hope this helps some.
|
|
|
12-20-2010, 09:24 AM
|
#3
|
LQ Guru
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 27,412
|
Quote:
Originally Posted by srajeshkumar
Hi All,
I need your help in identifying the number of cores each processor is running.
I have checked /proc/cpuinfo but i dont find any core details inside it and I can find only no of processor and its speed, please help me on this.
Thanks
|
Each 'core' will show up as a separate processor. For example, on my Core i7, I ran "cat /proc/cpuinfo | grep processor" and it shows items 0-7 (8 total devices, one for the actual 'chip', and one for each core). You can also use "dmesg | grep CPU".
Pay attention to what info is in the cpuinfo file...all you're asking for is there.
|
|
|
12-20-2010, 10:09 AM
|
#4
|
Member
Registered: Nov 2009
Posts: 46
Rep:
|
Chiming in, if you cat /proc/cpuinfo, the specific lines I think you want to look for are physical id (helps you differentiate between the actual physical processors in your system; same physical processor shares same physical id); cpu cores tells you how many cores are on that physical cpu, and core id even tells which core the output is talking about. But specifically for your question the "cpu cores" line in that output oughta tell you what you need to know.
|
|
|
12-20-2010, 10:29 AM
|
#5
|
Member
Registered: May 2010
Location: Eindhoven
Distribution: ubuntu/debian
Posts: 152
Rep:
|
this script I found checks how many cores a cpu has and then starts as many tests as there are cores.
Quote:
N=`cat /proc/cpuinfo | grep processor | wc -l`
cat /proc/cpuinfo | grep "model name"
echo
echo "Calculating the first 5000 decimals of pi using $N parallel processes"
TimeBegin=`date +%s.%N`
for ((i=1; i<=$N; i++))
do
echo "scale=5000; 4*a(1)" | bc -l -q > /dev/null &
done
wait
TimeEnd=`date +%s.%N`
DT=`echo "scale=2; ($TimeEnd - $TimeBegin) / 1" | bc`
echo "Total time: $DT seconds"
DTc=`echo "scale=2; ($TimeEnd - $TimeBegin) / $N" | bc`
echo "Average time per calculation: $DTc seconds"
|
I think what you're looking for is N
I don't really know what TB0ne here means with one for each core and one for each processor. but it just shows the cpu cores that are presented to the kernel to do their work on. if you have 1 cpu with 2 cores it says 2 if you have 2 cpu's with 1 core it says 2 and if you have 1 cpu and one core with hyperthreading it says 2 as well. if you have 2 cpu's with 6 cores and hyperthreading on all of them it says 24. so all you need to do to know the actual number of cores is this and divide it by two if you have hyperthreading.
You can check this by seeing if the cpu has the ht flag.
|
|
1 members found this post helpful.
|
12-20-2010, 11:13 AM
|
#6
|
LQ Guru
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 27,412
|
Quote:
Originally Posted by Steviepower
this script I found checks how many cores a cpu has and then starts as many tests as there are cores.
I think what you're looking for is N
I don't really know what TB0ne here means with one for each core and one for each processor. but it just shows the cpu cores that are presented to the kernel to do their work on. if you have 1 cpu with 2 cores it says 2 if you have 2 cpu's with 1 core it says 2 and if you have 1 cpu and one core with hyperthreading it says 2 as well. if you have 2 cpu's with 6 cores and hyperthreading on all of them it says 24. so all you need to do to know the actual number of cores is this and divide it by two if you have hyperthreading.
You can check this by seeing if the cpu has the ht flag.
|
+1. Good post, Steviepower.
|
|
|
12-21-2010, 06:17 AM
|
#7
|
Senior Member
Registered: Dec 2004
Location: Marburg, Germany
Distribution: openSUSE 15.2
Posts: 1,339
|
Quote:
Originally Posted by Steviepower
This script I found checks how many cores a cpu has and then starts as many tests as there are cores. You can check this by seeing if the cpu has the ht flag.
|
For Intel CPUs, otherwise it can mean HyperTransport: http://blog.incase.de/index.php/cpu-...heir-meanings/ And HyperThreading may also be switched off in the BIOS, but the flag will still be output.
If the original poster is looking for something like the topology, I would just like to note, that in the GridEngine package the tool loadcheck will output something like:
Code:
$ /usr/sge/utilbin/lx24-amd64/loadcheck
arch lx24-amd64
num_proc 8
m_socket 2
m_core 8
m_topology SCCCCSCCCC
...
|
|
1 members found this post helpful.
|
12-23-2010, 09:52 AM
|
#8
|
Member
Registered: May 2010
Location: Eindhoven
Distribution: ubuntu/debian
Posts: 152
Rep:
|
ok I didn't know that, good you do.
|
|
|
All times are GMT -5. The time now is 12:58 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|