31 int cpuid = sched_getcpu();
41 int get_hwthread() {
return -1; }
47 int rank = 0, world_size = 1;
50 MPI_Init_thread(NULL, NULL, MPI_THREAD_FUNNELED, &provided);
51 MPI_Comm_rank(MPI_COMM_WORLD, &rank);
52 MPI_Comm_size(MPI_COMM_WORLD, &world_size);
55 bool hwthread_id_supported = (get_hwthread() != -1);
60 for (
int l_rank = 0; l_rank < world_size; l_rank++)
71 if (L1_thread_id == 0 and l_rank == 0)
72 std::cout <<
"OpenMP enables " << L1_num_thread <<
" 1st level threads, " 78 for (
int i = 0; i < L1_num_thread; i++)
80 if (L1_thread_id == i)
86 for (
int j = 0; j < L2_num_thread; j++)
88 if (L2_thread_id == j)
91 o <<
"MPI rank " << rank <<
" L1 tid " << L1_thread_id <<
" L2 tid " << L2_thread_id
92 <<
" is placed on Core ID " << get_core();
93 if (hwthread_id_supported)
94 o <<
" HW thread ID " << get_hwthread();
107 MPI_Barrier(MPI_COMM_WORLD);
omp_int_t omp_get_thread_num()
omp_int_t omp_get_max_active_levels()
omp_int_t omp_get_num_threads()