Community
cancel
Showing results for 
Search instead for 
Did you mean: 
sabbinenisunil
Beginner
61 Views

sir is there any command to check weather the system dualcore or quadcore or 8core

if there is any comman like that in c language please inform me.this is because iam doing automatic parallelisation project using openmp libraries.to do that one first of all i have to check weather it is quad core or dual core . based on that one i have to assign the threads.
please reply me sir
0 Kudos
3 Replies
TimP
Black Belt
61 Views

Not in C language, but you may be interested in sample OpenMP code, e.g.
#ifdef _OPENMP
#include
#endif
..........

#ifdef _OPENMP
int maxt=omp_get_max_threads();
....

If you are trying to distinguish a single CPU 8 core from dual 4 core, you will require vendor-dependent code.
Tamer_Assad
Innovator
61 Views

Hi sabbinenisunil,

You may start this by recognizing the processor type using IPP functions, each type has its pre-known features and number of cores.

Please check the following thread:
http://origin-software.intel.com/en-us/forums/showthread.php?t=71133

also, please check the following articles:

1) Is there an IPP function to detect the processor type?

http://software.intel.com/en-us/articles/intel-integrated-performance-primitives-intel-ipp-is-there-...

2) IPP Dispatcher Control Functions - ipp*Init*() functions

http://software.intel.com/en-us/articles/ipp-dispatcher-control-functions-ippinit-functions/

3) Understanding CPU Dispatching in the Intel IPP

http://software.intel.com/en-us/articles/intel-integrated-performance-primitives-intel-ipp-understan...

Regards,

Tamer Assad

61 Views

Hi,

In Java, this is very easy to know.
Below is a snippet for your reference.

public class PerfTest {
public static void main(String[] args) {
int processors = Runtime.getRuntime().availableProcessors();
System.out.println("Available processors : " + processors);
}
}

Regards,
Md. Irfanulla S.
Reply