Hi experts,
Here I encountered a strange problem which is mentioned as the Title.
First, I run ‘lscpu’ command, and It shows as follows:
https://pan.baidu.com/s/1nuDHWAt
It shows that there are 4 CPU cores on-line.
But when I launched 32 threads in a test program, the system seems to put all threads on only one CPU core. That is very strange. The test program and what the ‘top’ command and system Monitor shows are as follows:
int main(int argc, char *argv){
long result = 0;
#pragma omp parallel for num_threads(32)
for(long i=0; i<100000000; ++i){
printf(“This is thread %d\n”, omp_get_thread_num());
}
cout<<“result:”<<result<<endl;
return 0;
}
</li>
<li>2. top command and system monitor shows<a target='_blank' rel='noopener noreferrer' href='https://pan.baidu.com/s/1qYRzpX6'>https://pan.baidu.com/s/1qYRzpX6</a>
</li>
Please help me with this problem.
Thanks!