17 int ncores_per_socket,
18 int nthreads_per_core) {
19 int i,
j, expected_total, expected_per_place;
21 expected_total = nsockets * ncores_per_socket * nthreads_per_core;
22 expected_per_place = 1;
24 expected_total = nsockets * ncores_per_socket;
25 expected_per_place = nthreads_per_core;
27 expected_total = nsockets;
28 expected_per_place = ncores_per_socket * nthreads_per_core;
30 if (openmp_places->
num_places != expected_total) {
31 fprintf(stderr,
"error: KMP_HW_SUBSET did not half each resource layer!\n");
32 printf(
"openmp_places places:\n");
39 if (
count != expected_per_place) {
40 fprintf(stderr,
"error: place %d has %d OS procs instead of %d\n",
i,
41 count, expected_per_place);
59 printf(
"Only one hardware thread to execute on. Skipping test.\n");
63 value = getenv(
"OMP_PLACES");
66 "error: OMP_PLACES must be set to one of threads,cores,sockets!\n");
69 if (strcmp(
value,
"threads") == 0)
71 else if (strcmp(
value,
"cores") == 0)
73 else if (strcmp(
value,
"sockets") == 0)
77 "error: OMP_PLACES must be one of threads,cores,sockets!\n");
83 printf(
"Invalid number of cores (%d). Skipping test.\n", cores->
num_places);
86 printf(
"Invalid number of sockets (%d). Skipping test.\n",
94 if (nsockets * ncores_per_socket * nthreads_per_core != threads->
num_places) {
95 printf(
"Only uniform topologies can be tested. Skipping test.\n");
100 if (nthreads_per_core > 1)
101 nthreads_per_core /= 2;
102 if (ncores_per_socket > 1)
103 ncores_per_socket /= 2;
107 if (getenv(
"RUN_OUT_OF_ORDER")) {
108 snprintf(
buf,
sizeof(
buf),
"%dt,%ds,%dc", nthreads_per_core, nsockets,
111 snprintf(
buf,
sizeof(
buf),
"%ds,%dc,%dt", nsockets, ncores_per_socket,
114 setenv(
"KMP_HW_SUBSET",
buf, 1);
118 ncores_per_socket, nthreads_per_core);
128 printf(
"Thread does not have access to all logical processors. Skipping "
void const char const char int ITT_FORMAT __itt_group_sync x void const char ITT_FORMAT __itt_group_sync s void ITT_FORMAT __itt_group_sync p void ITT_FORMAT p void ITT_FORMAT p no args __itt_suppress_mode_t unsigned int void size_t ITT_FORMAT d void ITT_FORMAT p void ITT_FORMAT p __itt_model_site __itt_model_site_instance ITT_FORMAT p __itt_model_task __itt_model_task_instance ITT_FORMAT p void ITT_FORMAT p void ITT_FORMAT p void size_t ITT_FORMAT d void ITT_FORMAT p const wchar_t ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s no args void ITT_FORMAT p size_t count
void const char const char int ITT_FORMAT __itt_group_sync x void const char ITT_FORMAT __itt_group_sync s void ITT_FORMAT __itt_group_sync p void ITT_FORMAT p void ITT_FORMAT p no args __itt_suppress_mode_t unsigned int void size_t ITT_FORMAT d void ITT_FORMAT p void ITT_FORMAT p __itt_model_site __itt_model_site_instance ITT_FORMAT p __itt_model_task __itt_model_task_instance ITT_FORMAT p void ITT_FORMAT p void ITT_FORMAT p void size_t ITT_FORMAT d void ITT_FORMAT p const wchar_t ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s no args void ITT_FORMAT p size_t ITT_FORMAT d no args const wchar_t const wchar_t ITT_FORMAT s __itt_heap_function void size_t int ITT_FORMAT d __itt_heap_function void ITT_FORMAT p __itt_heap_function void void size_t int ITT_FORMAT d no args no args unsigned int ITT_FORMAT u const __itt_domain __itt_id ITT_FORMAT lu const __itt_domain __itt_id __itt_id __itt_string_handle ITT_FORMAT p const __itt_domain __itt_id ITT_FORMAT p const __itt_domain __itt_id __itt_timestamp __itt_timestamp ITT_FORMAT lu const __itt_domain __itt_id __itt_id __itt_string_handle ITT_FORMAT p const __itt_domain ITT_FORMAT p const __itt_domain __itt_string_handle unsigned long long value
void const char const char int ITT_FORMAT __itt_group_sync x void const char ITT_FORMAT __itt_group_sync s void ITT_FORMAT __itt_group_sync p void ITT_FORMAT p void ITT_FORMAT p no args __itt_suppress_mode_t unsigned int void size_t ITT_FORMAT d void ITT_FORMAT p void ITT_FORMAT p __itt_model_site __itt_model_site_instance ITT_FORMAT p __itt_model_task __itt_model_task_instance ITT_FORMAT p void ITT_FORMAT p void ITT_FORMAT p void size_t ITT_FORMAT d void ITT_FORMAT p const wchar_t ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s no args void ITT_FORMAT p size_t ITT_FORMAT d no args const wchar_t const wchar_t ITT_FORMAT s __itt_heap_function void size_t int ITT_FORMAT d __itt_heap_function void ITT_FORMAT p __itt_heap_function void void size_t int ITT_FORMAT d no args no args unsigned int ITT_FORMAT u const __itt_domain __itt_id ITT_FORMAT lu const __itt_domain __itt_id __itt_id __itt_string_handle ITT_FORMAT p const __itt_domain __itt_id ITT_FORMAT p const __itt_domain __itt_id __itt_timestamp __itt_timestamp ITT_FORMAT lu const __itt_domain __itt_id __itt_id __itt_string_handle ITT_FORMAT p const __itt_domain ITT_FORMAT p const __itt_domain __itt_string_handle unsigned long long ITT_FORMAT lu const __itt_domain __itt_string_handle unsigned long long ITT_FORMAT lu const __itt_domain __itt_id __itt_string_handle __itt_metadata_type type
static int compare_hw_subset_places(const place_list_t *openmp_places, topology_obj_type_t type, int nsockets, int ncores_per_socket, int nthreads_per_core)
static int check_places()
static volatile kmp_i18n_cat_status_t status
static int affinity_mask_count(const affinity_mask_t *mask)
static void topology_print_places(const place_list_t *p)
static place_list_t * topology_alloc_openmp_places()
static place_list_t * topology_alloc_type_places(topology_obj_type_t type)
static int topology_using_full_mask()
static void topology_free_places(place_list_t *places)