 |
 |
Multi-core / multi-processor detection
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Dec 2006
Status:
Offline
|
|
Hello!
I want to make a script or c++ program that detects next information regarding processors on MacOxS platforms:
- processor name
- processor frequency
- number of physical processors
- number of online /active physical processors
- number of cores per processor
- number of threads per processor
Thanks a lot
|
|
|
| |
|
|
|
 |
|
 |
|
Moderator 
Join Date: May 2001
Location: Hilbert space
Status:
Offline
|
|
Just let Apple System Profiler do the work for you.
|
|
I don't suffer from insanity, I enjoy every minute of it.
|
| |
|
|
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Dec 2006
Status:
Offline
|
|
I'm interesting, in some commands to get those infos.
|
|
|
| |
|
|
|
 |
|
 |
|
Moderator 
Join Date: May 2001
Location: Hilbert space
Status:
Offline
|
|
Just create an Apple Script using Script Editor (located in Applications/Apple Script). You can find the documentation to all Apple Script commands in the menu (Window > Library). Double click the app in question and all commands will be listed with syntax and a short explanation. If you cannot find System Profiler in the list of applications, add it by clicking in `+'.
The output will be a text document. With a little experience in shell scripts, it should be very easy to extract the information you need automatically.
|
|
I don't suffer from insanity, I enjoy every minute of it.
|
| |
|
|
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Dec 2006
Status:
Offline
|
|
I need only shell commands, to be run in terminal. I don't have 'graphical' access to machine.
Thanks
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Aug 2001
Status:
Offline
|
|
Originally Posted by manty
I need only shell commands, to be run in terminal. I don't have 'graphical' access to machine.
Thanks
sysctl hw
|
|
|
| |
|
|
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Dec 2006
Status:
Offline
|
|
Thanks a lot! sysctl hw. works good.
Does any of you have processors with multi-cores or more then one physical processor processor and can give me some example of this command out put?
Thanks!
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Mar 2001
Location: Madison, WI
Status:
Offline
|
|
Knock yourself out
Code:
hw.ncpu: 2
hw.byteorder: 1234
hw.memsize: 2147483648
hw.activecpu: 2
hw.physicalcpu: 2
hw.physicalcpu_max: 2
hw.logicalcpu: 2
hw.logicalcpu_max: 2
hw.cputype: 7
hw.cpusubtype: 4
hw.cpufamily: 1943433984
hw.cacheconfig: 2 1 2 0 0 0 0 0 0 0
hw.pagesize: 4096
hw.busfrequency: 664000000
hw.busfrequency_min: 664000000
hw.busfrequency_max: 664000000
hw.cpufrequency: 2000000000
hw.cpufrequency_min: 2000000000
hw.cpufrequency_max: 2000000000
hw.cachelinesize: 64
hw.l1icachesize: 32768
hw.l1dcachesize: 32768
hw.l2cachesize: 2097152
hw.tbfrequency: 1000000000
hw.optional.floatingpoint: 1
hw.optional.mmx: 1
hw.optional.sse: 1
hw.optional.sse2: 1
hw.optional.sse3: 1
hw.machine = i386
hw.model = MacBook1,1
hw.ncpu = 2
hw.byteorder = 1234
hw.physmem = 2147483648
hw.usermem = 1829044224
hw.pagesize = 4096
hw.epoch = 0
hw.vectorunit = 1
hw.busfrequency = 664000000
hw.cpufrequency = 2000000000
hw.cachelinesize = 64
hw.l1icachesize = 32768
hw.l1dcachesize = 32768
hw.l2settings = 1
hw.l2cachesize = 2097152
hw.tbfrequency = 1000000000
hw.memsize = 2147483648
hw.availcpu = 2
|
|
|
| |
|
|
|
 |
|
 |
|
Professional Poster
Join Date: Jun 2006
Location: "Working"
Status:
Offline
|
|
iMac CD 2.0/2GB
Code:
hw.ncpu: 2
hw.byteorder: 1234
hw.memsize: 2147483648
hw.activecpu: 2
hw.physicalcpu: 2
hw.physicalcpu_max: 2
hw.logicalcpu: 2
hw.logicalcpu_max: 2
hw.cputype: 7
hw.cpusubtype: 4
hw.cpufamily: 1943433984
hw.cacheconfig: 2 1 2 0 0 0 0 0 0 0
hw.pagesize: 4096
hw.busfrequency: 664000000
hw.busfrequency_min: 664000000
hw.busfrequency_max: 664000000
hw.cpufrequency: 2000000000
hw.cpufrequency_min: 2000000000
hw.cpufrequency_max: 2000000000
hw.cachelinesize: 64
hw.l1icachesize: 32768
hw.l1dcachesize: 32768
hw.l2cachesize: 2097152
hw.tbfrequency: 1000000000
hw.optional.floatingpoint: 1
hw.optional.mmx: 1
hw.optional.sse: 1
hw.optional.sse2: 1
hw.optional.sse3: 1
hw.machine = i386
hw.model = iMac4,1
hw.ncpu = 2
hw.byteorder = 1234
hw.physmem = 2147483648
hw.usermem = 1969065984
hw.pagesize = 4096
hw.epoch = 0
hw.vectorunit = 1
hw.busfrequency = 664000000
hw.cpufrequency = 2000000000
hw.cachelinesize = 64
hw.l1icachesize = 32768
hw.l1dcachesize = 32768
hw.l2settings = 1
hw.l2cachesize = 2097152
hw.tbfrequency = 1000000000
hw.memsize = 2147483648
hw.availcpu = 2
|
|
|
| |
|
|
|
 |
|
 |
|
Moderator 
Join Date: May 2001
Location: Hilbert space
Status:
Offline
|
|
Originally Posted by manty
I need only shell commands, to be run in terminal. I don't have 'graphical' access to machine.
You can run Apple Scripts from the command line just fine.
|
|
I don't suffer from insanity, I enjoy every minute of it.
|
| |
|
|
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Dec 2006
Status:
Offline
|
|
Hi,
I come back with a question regarding same subject.
Between hw.machine and hw.model which one is the name of processor. I think none of those it is, or i'm wrong.
I also did next to get processor name:
ioreg -l | grep -B20 -A20 -i 'device_type.*cpu' | grep -i \\\"name\\\" | sed 's/!.*//g' | sed 's/.*=//g' | sed 's/[<>\"]//g'
Anyone else have another ideas?
Thanks a lot
|
|
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |
|