summaryrefslogtreecommitdiffstats
path: root/openmp/runtime/test/ompt
Commit message (Collapse)AuthorAgeFilesLines
...
* [OMPT] Fix test parallel/not_enough_threads.cJonas Hahnfeld2018-05-271-46/+60
| | | | | | | | | | | | | | | Upcoming changes to FileCheck will modify CHECK-DAG to not match overlapping regions of the input. This test was found to be affected because it expects to find four threads to invoke events of type ompt_event_implicit_task_begin. It turns out this is wrong because OMP_THREAD_LIMIT is set to 2, so there are only two threads. The rest of the test got it right so it went unnoticed until now. (Rewrite test and apply clang-format to it as discussed in the past.) Differential Revision: https://reviews.llvm.org/D47119 llvm-svn: 333361
* [OMPT] Add api_calls_misc.c testcase and rename api_calls.c testcaseJoachim Protze2018-05-073-0/+76
| | | | | | | | | | | | | | | | The api_calls_misc.c testcase tests the following api calls: ompt_get_callback() ompt_get_state() ompt_enumerate_states() ompt_enumerate_mutex_impls() These have not been tested previously. The api_calls.c testcase has been renamed to api_calls_places.c because it only tests api calls that are related to places. Differential Revision: https://reviews.llvm.org/D42523 llvm-svn: 331631
* [OpenMP][OMPT] Fix api_calls_from_other_thread.cppJonathan Peyton2018-04-301-3/+3
| | | | | | | Removed environment setting in RUN: line that was being ignored anyways. Changed a few specific checks to "any number" llvm-svn: 331212
* [OMPT] Fix interoperability test with GCCJonas Hahnfeld2018-03-011-2/+14
| | | | | | | | | | | | | | | | We have to ensure that the runtime is initialized _before_ waiting for the two started threads to guarantee that the master threads post their ompt_event_thread_begin before the worker threads. This is not guaranteed in the parallel region where one worker thread could start before the other master thread has invoked the callback. The problem did not happen with Clang becauses the generated code calls __kmpc_global_thread_num() and cashes its result for functions that contain OpenMP pragmas. Differential Revision: https://reviews.llvm.org/D43882 llvm-svn: 326435
* [OMPT] Fix task-type test with GCCJoachim Protze2018-03-011-0/+3
| | | | | | | | | | This is similar to D43882. The runtime needs to be initialized before calling print_ids(0) http://lab.llvm.org:8011/builders/openmp-gcc-x86_64-linux-debian/builds/60 Differential Revision: https://reviews.llvm.org/D43897 llvm-svn: 326428
* [OMPT] Fix ompt_get_task_info() and add tests for itJoachim Protze2018-02-282-88/+179
| | | | | | | | | | | | | The thread_num parameter of ompt_get_task_info() was not being used previously, but need to be set. The print_task_type() function (form the task-types.c testcase) was merged into the print_ids() function (in callback.h). Testing of ompt_get_task_info() was added to the task-types.c testcase. It was not tested extensively previously. Differential Revision: https://reviews.llvm.org/D42472 llvm-svn: 326338
* [OMPT] Fix inconsistent testcasesJoachim Protze2018-02-282-31/+31
| | | | | | | | | | | The main change of this patch is to insert {{.*}} in current_address=[[RETURN_ADDRESS_END]]. This is needed to match any of the alternatively printed addresses. Additionally, clang-format is applied to the two tests. Differential Revision: https://reviews.llvm.org/D43115 llvm-svn: 326312
* [OMPT] Fix parallel_data in implicit barrier-endJonas Hahnfeld2018-02-232-63/+105
| | | | | | | | | This is required to be NULL for implicit barriers at the end of a parallel region. Noticed in review of D43191. Differential Revision: https://reviews.llvm.org/D43308 llvm-svn: 325922
* [OMPT] Fix test tasks/serialized.c with optimizationJonas Hahnfeld2018-02-232-54/+114
| | | | | | | | | | | | | | The compiler inlines the user code in the task. Check for that case at runtime by comparing the frame addresses and print the expected exit address. Also showcase how I think the OMPT tests could be reformatted to match LLVM's code style. In my opinion it would be great to that kind of change to all tests that need to be touched for whatever reason... Differential Revision: https://reviews.llvm.org/D43191 llvm-svn: 325921
* [OMPT] Add interoperability testcaseJoachim Protze2018-02-171-0/+99
| | | | | | | | Test whether OMPT-callbacks for two threads that initiate a parallel region are correct. Differential Revision: https://reviews.llvm.org/D41942 llvm-svn: 325423
* [OMPT] Update api_calls testcaseJoachim Protze2018-02-171-33/+49
| | | | | | | | | | Only use ompt_ functions when testing OMPT in api_calls testcase. Add size parameter to print_list. Fix small bug in implementation of ompt_get_partition_place_nums(): return correct length. Differential Revision: https://reviews.llvm.org/D42162 llvm-svn: 325422
* [OMPT][test] Correct warning about added wrapper functionsJonas Hahnfeld2018-02-141-2/+4
| | | | | | | | | This affects all outlined functions, not just tasks! Only show warning when using Clang 5.0 or later. Differential Revision: https://reviews.llvm.org/D43190 llvm-svn: 325131
* [OMPT] Add tool_available_search testcaseJoachim Protze2018-02-081-0/+104
| | | | | | | | | | | | | | | | | | Tests the search for tools as defined in the spec. The OMP_TOOL_LIBRARIES environment variable contains paths to the following files(in that order) -to a nonexisting file -to a shared library that does not have a ompt_start_tool function -to a shared library that has an ompt_start_tool implementation returning NULL -to a shared library that has an ompt_start_tool implementation returning a pointer to a valid instance of ompt_start_tool_result_t The expected result is that the last tool gets active and can print in the thread-begin callback. Differential Revision: https://reviews.llvm.org/D42166 llvm-svn: 324588
* [OMPT] Add tool_not_available testcaseJoachim Protze2018-02-082-0/+69
| | | | | | | | | | | | Add a testcase that checks wheter the runtime can handle an ompt_start_tool method that returns NULL indicating that no tool shall be loaded. All tool_available testcases need a separate folder to avoid file conflicts for the generated tools. Differential Revision: https://reviews.llvm.org/D41904 llvm-svn: 324587
* [OMPT] Use fuzzy return addresses in lock testcasesJonas Hahnfeld2018-01-264-71/+71
| | | | | | | | | | | Use fuzzy return addresses in lock testcases so that these testcases can also be run using the Intel Compiler. Patch by Simon Convent! Differential Revision: https://reviews.llvm.org/D41896 llvm-svn: 323529
* [OMPT] Add Workaround for Intel Compiler BugJoachim Protze2018-01-172-1/+2
| | | | | | | | | | | | | | | | | | | | | | Add Workaround for Intel Compiler Bug with Case#: 03138964 A critical region within a nested task causes a segfault in icc 14-18: int main() { #pragma omp parallel num_threads(2) #pragma omp master #pragma omp task #pragma omp task #pragma omp critical printf("test\n"); } When the critical region is in a separate function, the segault does not occur. So we add noinline to make sure that the function call stays there. Differential Revision: https://reviews.llvm.org/D41182 llvm-svn: 322622
* [OMPT] Return appropiate values for ompt runtime entry points for non-OpenMP ↵Joachim Protze2018-01-171-0/+51
| | | | | | | | | | | threads When the current thread is not an (initialized) OpenMP thread, the runtime entry points return values that correspond to "not available" or similar Differential Revision: https://reviews.llvm.org/D41167 llvm-svn: 322620
* Missed to add new test case in previous commitJoachim Protze2018-01-101-0/+150
| | | | llvm-svn: 322179
* [OMPT] Fix cast and printf of wait_id in lock testJonas Hahnfeld2018-01-101-1/+1
| | | | | | | | This didn't work on 32 bit platforms. Differential Revision: https://reviews.llvm.org/D41853 llvm-svn: 322160
* [OMPT] Set and reset frame address when creating a task with dependencesJoachim Protze2017-12-241-7/+14
| | | | | | | | | As for normal task creation, the task frame addresses need to be stored for the encountering task. Differential Revision: https://reviews.llvm.org/D41165 llvm-svn: 321421
* [OMPT] Add missing initialization in nested_lwt.c test casePaul Osmialowski2017-12-221-1/+1
| | | | | | | | Without this initialization this test case tend to fail. Differential Revision: https://reviews.llvm.org/D41542 llvm-svn: 321379
* [OMPT] Fix failing test cases for gcc on UbuntuJoachim Protze2017-12-222-2/+3
| | | | | | | | | | | | | | The compiler warns that _BSD_SOURCE is deprecated and _DEFAULT_SOURCE should be used instead. We keep _BSD_SOURCE for older compilers, that don't know about _DEFAULT_SOURCE. The linker drops the tool when linking, since there is no visible need for the library. So we need to tell the linker, that the tool should be linked anyway. Differential Revision: https://reviews.llvm.org/D41499 llvm-svn: 321362
* Add missing test case from D41171 commitJoachim Protze2017-12-211-0/+29
| | | | llvm-svn: 321270
* [OMPT] Add missing ompt_get_num_procs functionJoachim Protze2017-12-212-0/+8
| | | | | | | | | | | | | This function is defined in OpenMP-TR6 section 4.1.5.1.6 The functions was not implemented yet. Since ompt-functions can only be called after the runtime was initialized and has loaded a tool, it can assume the runtime to be initialized. In contrast to omp_get_num_procs which needs to check whether the runtime is initialized. Differential Revision: https://reviews.llvm.org/D40949 llvm-svn: 321269
* [OMPT] Fix return address handling in a few GOMP interface methodsJoachim Protze2017-12-211-4/+4
| | | | | | | | | | | This revision fixes failing testcases with parallel for loops and the gomp interface. The return address needs to be stored at entry to runtime. The storage is cleared on usage, so we need to update the storage before calling again internal functions, that will trigger event callbacks. Differential Revision: https://reviews.llvm.org/D41181 llvm-svn: 321265
* [OMPT] Use frames at different level when using clang version 5 or higher ↵Joachim Protze2017-12-217-18/+35
| | | | | | | | | | | | with debug flag Clang 5 or higher adds an intermediate function call in certain cases when compiling with debug flag. This revision updates the testcases to work correctly. Differential Revision: https://reviews.llvm.org/D40595 llvm-svn: 321263
* [OMPT] Add annotations to testcases that are expected to fail when using ↵Joachim Protze2017-12-2125-7/+30
| | | | | | | | | | | | | | | | | certain compilers Reasons for expected failures are mainly bugs when using lables in OpenMP regions or missing support of some OpenMP features. For some worksharing clauses, support to distinguish the kind of workshare was added just recently. If an issue was fixed in a minor release version of a compiler, we flag the test as unsupported for this compiler version to avoid false positives. Same for fixes that where backported to older compiler versions. Differential Revision: https://reviews.llvm.org/D40384 llvm-svn: 321262
* [AArch64] add required arch specific code for running OMPT test casesPaul Osmialowski2017-12-211-0/+6
| | | | | | Differential Revision: https://reviews.llvm.org/D41482 llvm-svn: 321258
* [CMake] Refactor testing infrastructureJonas Hahnfeld2017-11-291-1/+1
| | | | | | | | | | | | | | | The code for the two OpenMP runtime libraries was very similar. Move to common CMake file that is included and provides a simple interface for adding testsuites. Also add a common check-openmp target that runs all testsuites that have been registered. Note that this renames all test options to the common OPENMP namespace, for example OPENMP_TEST_C_COMPILER instead of LIBOMP_TEST_COMPILER and so on. Differential Revision: https://reviews.llvm.org/D40082 llvm-svn: 319343
* [OMPT] Fix inaccuracies in worksharing testsJonas Hahnfeld2017-11-172-8/+7
| | | | | | | | | | | | | | | | | These tests were failing rarely on my MacBook when there was some activity in the background. Read: one of a thousand executions? * sections.c missed the sorting based on thread ids. This worked as long as the master thread finished its section before the worker thread started the second one but failed if the master thread was put to sleep by the OS. * The checks in single.c assumed that the master thread executes the single region which works most of the time because it is usually faster than the newly spawned worker thread. Differential Revision: https://reviews.llvm.org/D39853 llvm-svn: 318527
* [OMPT] Provide initialization for Mac OS XJonas Hahnfeld2017-11-111-8/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Traditionally, the library had a weak symbol for ompt_start_tool() that served as fallback and disabled OMPT if called. Tools could provide their own version and replace the default implementation to register callbacks and lookup functions. This mechanism has worked reasonably well on Linux systems where this interface was initially developed. On Darwin / Mac OS X the situation is a bit more complicated and the weak symbol doesn't work out-of-the-box. In my tests, the library with the tool needed to link against the OpenMP runtime to make the process work. This would effectively mean that a tool needed to choose a runtime library whereas one design goal of the interface was to allow tools that are agnostic of the runtime. The solution is to use dlsym() with the argument RTLD_DEFAULT so that static implementations of ompt_start_tool() are found in the main executable. This works because the linker on Mac OS X includes all symbols of an executable in the global symbol table by default. To use the same code path on Linux, the application would need to be built with -Wl,--export-dynamic. To avoid this restriction, we continue to use weak symbols on Linux systems as before. Finally this patch extends the existing test to cover all possible ways of initializing the tool as described by the standard. It also fixes ompt_finalize() to not call omp_get_thread_num() when the library is shut down which resulted in hangs on Darwin. The changes have been tested on Linux to make sure that it passes the current tests as well as the newly extended one. Differential Revision: https://reviews.llvm.org/D39801 llvm-svn: 317980
* [OMPT] Fix test cancel_parallel.cJonas Hahnfeld2017-11-091-16/+14
| | | | | | | | | | | | | | | | | | | | | If a parallel region is cancelled, execution resumes at the end of the structured block. That is why this test cannot use the "normal" macros that print right after inserting the label. Instead it previously printed the addresses before the pragma and swapped the checks compared to the other tests. However, this does not work because FileChecks '*' is greedy so that RETURN_ADDRESS always matched the second address. This makes the test fail when an "overflow" occurrs and the first address matches the value of codeptr_ra. I discovered this on my MacBook but I'm unable to reproduce the failure with the current version. Nevertheless we should fix this problem to avoid that this test fails later after an unrelated change. Differential Revision: https://reviews.llvm.org/D39708 llvm-svn: 317787
* [OMPT] Add support for testing return addresses on POWERJonas Hahnfeld2017-11-091-16/+72
| | | | | | | | | | | | | | | | | | | Return addresses are determined based on the address of a label that is inserted directly after a pragma / API call. In some cases the tests can assume a known number of instructions between the addresses. However, the instructions and their encoded lengths depend on the target that the test is compiled on. Firstly, this patch refactors the macro print_current_address() to allow such target dependent modifications and adds information for the observed instructions on POWER. Secondly, it adapts the related macro print_fuzzy_address() to reuse much of "hacky" code and fixes the used formatting strings in the printf() call. Finally, it also adds documentation about how these macros are intended to work. Differential Revision: https://reviews.llvm.org/D39699 llvm-svn: 317786
* [OMPT] Fix null pointer in parallel/no_thread_num_clause.cJonas Hahnfeld2017-11-061-1/+1
| | | | | | | Looks like the implementation of printf on Darwin uses "0x0" instead of "(nil)" like glibc does. llvm-svn: 317515
* [OMPT] Fix callback.h for tests for changes in TR6Jonas Hahnfeld2017-11-061-4/+4
| | | | | | This was also lost in the last commit. llvm-svn: 317484
* Updating implementation of OMPT as specified in OpenMP 5.0 Preview 2 (TR6)Joachim Protze2017-11-052-19/+19
| | | | | | | | | | | The TR6 document is expected to be publically released around November 15. This patch does not implement OMPT for libomptarget. Patch by Simon Convent and Joachim Protze Differential Revision: https://reviews.llvm.org/D39182 llvm-svn: 317436
* Rename fields of ompt_frame_tJoachim Protze2017-11-051-4/+4
| | | | | | | | | | This is part of the renaming of data types from OpenMP TR4 to TR6 Patch by Simon Convent Differential Revision: https://reviews.llvm.org/D39326 llvm-svn: 317435
* Revert "Rename fields of ompt_frame_t"Jonas Hahnfeld2017-11-031-4/+4
| | | | | | This reverts commit r317338 which discarded some recent commits. llvm-svn: 317347
* Revert "Updating implementation of OMPT as specified in OpenMP 5.0 Preview 2 ↵Jonas Hahnfeld2017-11-036-27/+34
| | | | | | | | (TR6)" This reverts commit r317339 which discarded some recent commits. llvm-svn: 317346
* Updating implementation of OMPT as specified in OpenMP 5.0 Preview 2 (TR6)Joachim Protze2017-11-036-34/+27
| | | | | | | | | | | The TR6 document is expected to be publically released around November 15. This patch does not implement OMPT for libomptarget. Patch by Simon Convent and Joachim Protze Differential Revision: https://reviews.llvm.org/D39182 llvm-svn: 317339
* Rename fields of ompt_frame_tJoachim Protze2017-11-031-4/+4
| | | | | | | | | | This is part of the renaming of data types from OpenMP TR4 to TR6 Patch by Simon Convent Differential Revision: https://reviews.llvm.org/D39326 llvm-svn: 317338
* Update implementation of OMPT to the specification OpenMP 5.0 Preview 1 (TR4).Joachim Protze2017-11-0156-396/+3610
| | | | | | | | | | | | | | The code is tested to work with latest clang, GNU and Intel compiler. The implementation is optimized for low overhead when no tool is attached shifting the cost to execution with tool attached. This patch does not implement OMPT for libomptarget. Patch by Simon Convent and Joachim Protze Differential Revision: https://reviews.llvm.org/D38185 llvm-svn: 317085
* [OMPT] fix task frame information for gomp interfaceJonas Hahnfeld2016-09-141-0/+4
| | | | | | | | | | | Previous differencials D23305-D23310 changed task frame information management only for the kmp interface, but not for the whole gomp interface. This broke some testcases when building with gcc. This patch fixes the broken task frame information for the gomp interface. Patch by Joachim Protze! Differential Revision: https://reviews.llvm.org/D24502 llvm-svn: 281468
* [OMPT] save exit address to lwt if availableJonas Hahnfeld2016-09-141-20/+8
| | | | | | | | | | | In case, the current team is a serialized team (lwt), the frame information should be written to this data structure. Before, nested serialized teams would overwrite the same task information. Patch by Joachim Protze! Differential Revision: https://reviews.llvm.org/D23310 llvm-svn: 281467
* [OMPT] fix __ompt_get_teaminfo to consult lwt entries of parent teamsJonas Hahnfeld2016-09-141-0/+311
| | | | | | | | | | | | | | | The comment already states, that this function should work similarly as __ompt_get_taskinfo. The function only looked for lwt entries of the current team, but not when unrolling the parents. This fix aligns the implementation to __ompt_get_taskinfo. The new test case creates a single theaded team (->lwt) and then a nested active team. Before the innermost print_id(1) would deliver a different team then the outer print_id(0). Patch by Joachim Protze! Differential Revision: https://reviews.llvm.org/D23309 llvm-svn: 281466
* [OMPT] Reset task exit frame when execution is finishedJonas Hahnfeld2016-09-141-0/+8
| | | | | | | | | | | | | | | | The exit address is set when execution of a task is started and should be reset as soon as the execution is finished. Especially for the asm implementation of __kmp_invoke_microtask, resetting in this call would be painfull, so reset just after the invokation. The testcase shows the effect of this patch: Before, the implicit barriers at the end of an implicit task would see an exit address for the implicit task. This barrier is a task scheduling point. Thus, any explicit task scheduled there would see an exit, but no reenter address for the implicit task. Patch by Joachim Protze! Differential Revision: https://reviews.llvm.org/D23307 llvm-svn: 281465
* [OMPT] Align implementation of reenter frame address to latest (frozen) ↵Jonas Hahnfeld2016-09-141-8/+19
| | | | | | | | | | | | | | | | version of OMPT spec The latest OMPT spec changed the semantic of a tasks reenter frame to be the application frame, that will be entered, when the runtime frame drops. Before it was the last frame in the runtime. This doesn't work for some gcc execution pathes or even clang generated code for : Since there is no runtime frame between the executed task and the encountering task. The test case compares exit and reenter addresses against addresses captured in application code Patch by Joachim Protze! Differential Revision: https://reviews.llvm.org/D23305 llvm-svn: 281464
* [OMPT] extend ompt tests by checks for frame pointersJonas Hahnfeld2016-09-147-19/+39
| | | | | | | | | | | | | | | OMPT tests can check for right frame information of tasks: * parent_task_frame was directly printed as a pointer, but actually points to a struct ompt_frame {void*, void*} * NULL is printed in the beginning of execution and loaded to FileChecker variable [[NULL]] * implicit tasks now also print their frame information * macro to print frame address from application * print task info for barrier begin Patch by Joachim Protze! Differential Revision: https://reviews.llvm.org/D23304 llvm-svn: 281463
* [OMPT] Fix parallel_id and task_id in loop_end with schedule staticJonas Hahnfeld2016-03-2413-0/+132
| | | | | | | | | For serialized parallel regions, wrong ids were reported. Now the same code is used as in kmp_dispatch.cpp which emits the correct ids. Differential Revision: http://reviews.llvm.org/D18348 llvm-svn: 264266
* [OMPT] Test ids reported by ompt_get_{parallel,task}_idJonas Hahnfeld2016-03-245-3/+124
| | | | llvm-svn: 264265
OpenPOWER on IntegriCloud