get_one_cpu_topology: Renumber core_id (physical core id)
Change-Id: I4e4857e9a063d16d19d73adfabfc18a4b461bbfb Refs: #1439
This commit is contained in:
committed by
Masamichi Takagi
parent
bb7e140655
commit
0a4e6b49b4
19
test/issues/1439/show-omp-cpu-affinity.c
Normal file
19
test/issues/1439/show-omp-cpu-affinity.c
Normal file
@@ -0,0 +1,19 @@
|
||||
#define _GNU_SOURCE
|
||||
|
||||
#include <stdio.h>
|
||||
#include <sched.h>
|
||||
#include <omp.h>
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
#pragma omp parallel
|
||||
{
|
||||
int thread_num = omp_get_thread_num();
|
||||
int cpu_num = sched_getcpu();
|
||||
|
||||
printf("Thread %d CPU %d\n", thread_num, cpu_num);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user