[Openmp-commits] [PATCH] D42162: [OMPT] Only use ompt_ functions when testing OMPT in api_calls testcase

Simon Convent via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Wed Jan 17 00:31:21 PST 2018


sconvent created this revision.
sconvent added reviewers: Hahnfeld, protze.joachim, jlpeyton.

Only use ompt_ functions when testing OMPT in api_calls testcase


https://reviews.llvm.org/D42162

Files:
  runtime/test/ompt/misc/api_calls.c


Index: runtime/test/ompt/misc/api_calls.c
===================================================================
--- runtime/test/ompt/misc/api_calls.c
+++ runtime/test/ompt/misc/api_calls.c
@@ -27,18 +27,20 @@
     int omp_ids[omp_get_place_num_procs(0)];
     omp_get_place_proc_ids(0, omp_ids);
     print_list("omp_get_place_proc_ids" ,omp_ids);
-    int ompt_ids[omp_get_place_num_procs(0)];
-    ompt_get_place_proc_ids(0, omp_get_place_num_procs(0), ompt_ids);
+    int ompt_ids_size = ompt_get_place_proc_ids(0, 0, NULL);
+    int ompt_ids[ompt_ids_size];
+    ompt_get_place_proc_ids(0, ompt_ids_size, ompt_ids);
     print_list("ompt_get_place_proc_ids", ompt_ids);
 
   	printf("%" PRIu64 ": omp_get_place_num()=%d\n", ompt_get_thread_data()->value, omp_get_place_num());
   	printf("%" PRIu64 ": ompt_get_place_num()=%d\n", ompt_get_thread_data()->value, ompt_get_place_num());
 
     int omp_nums[omp_get_partition_num_places()];
     omp_get_partition_place_nums(omp_nums);
     print_list("omp_get_partition_place_nums" ,omp_nums);
-    int ompt_nums[omp_get_partition_num_places()];
-    ompt_get_partition_place_nums(omp_get_partition_num_places(), ompt_nums);
+    int ompt_nums_size = ompt_get_partition_place_nums(0, NULL);
+    int ompt_nums[ompt_nums_size];
+    ompt_get_partition_place_nums(ompt_nums_size, ompt_nums);
     print_list("ompt_get_partition_place_nums", ompt_nums);
 
     printf("%" PRIu64 ": sched_getcpu()=%d\n", ompt_get_thread_data()->value, sched_getcpu());


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D42162.130100.patch
Type: text/x-patch
Size: 1499 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20180117/34378c94/attachment.bin>


More information about the Openmp-commits mailing list