summaryrefslogtreecommitdiffstats
path: root/openmp/runtime/test
Commit message (Collapse)AuthorAgeFilesLines
...
* [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
* Add missing memory barrier for queuing locksJonas Hahnfeld2017-12-081-1/+1
| | | | | | | | | | Otherwise I see hangs in the omp_single_copyprivate test when compiling in release mode. With the debug assertions, I get a failure `head > 0 && tail > 0`. Differential Revision: https://reviews.llvm.org/D40722 llvm-svn: 320150
* Fix alignment in teams-reduction.c testJonas Hahnfeld2017-12-051-1/+6
| | | | | | | | | | The runtime will use the global kmp_critical_name as a lock and tries to atomically store a pointer in there. This will fail if the global is only aligned by 4 bytes, the size of one int32_t element. Use a union to ensure the global is aligned to the size of a pointer on the current platform. llvm-svn: 319811
* Fix PR30890: Reduction across teams hangsJonas Hahnfeld2017-12-051-0/+63
| | | | | | | | | | __kmpc_reduce_nowait() correctly swapped the teams for reductions in a teams construct. Apply the same logic to __kmpc_reduce() and __kmpc_reduce_end(). Differential Revision: https://reviews.llvm.org/D40753 llvm-svn: 319788
* [CMake] Detect information about test compilerJonas Hahnfeld2017-11-304-3/+8
| | | | | | | | | | | | Perform a nested CMake invocation to avoid writing our own parser for compiler versions when we are not testing the in-tree compiler. Use the extracted information to mark a test as unsupported that hangs with Clang prior to version 4.0.1 and restrict tests for libomptarget to Clang version 6.0.0 and later. Differential Revision: https://reviews.llvm.org/D40083 llvm-svn: 319448
* [CMake] Refactor testing infrastructureJonas Hahnfeld2017-11-294-95/+20
| | | | | | | | | | | | | | | 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
* [CMake] Disallow direct configurationJonas Hahnfeld2017-11-291-1/+1
| | | | | | | | | | As a first step, this allows us to generalize the detection of standalone builds and make it fully compatible when building in llvm/runtimes/ which automatically sets OPENMP_STANDLONE_BUILD. Differential Revision: https://reviews.llvm.org/D40080 llvm-svn: 319341
* Fix for OMP doacross implementation on PowerJonas Hahnfeld2017-11-221-1/+1
| | | | | | | | | | Power has a weak consistency model so we need memory barriers to make writes (both from runtime and from user code) available for all threads. Differential Revision: https://reviews.llvm.org/D40175 llvm-svn: 318848
* [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-112-14/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-037-27/+76
| | | | | | | | (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-037-76/+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
* [OpenMP] Fix race condition in omp_init_lockJonathan Peyton2017-11-011-0/+42
| | | | | | | | | | | | | | | | | | | | | This is a partial fix for bug 34050. This prevents callers of omp_set_lock (which does not hold __kmp_global_lock) from ever seeing an uninitialized version of __kmp_i_lock_table.table. It does not solve a use-after-free race condition if omp_set_lock obtains a pointer to __kmp_i_lock_table.table before it is updated and then attempts to dereference afterwards. That race is far less likely and can be handled in a separate patch. The unit test usually segfaults on the current trunk revision. It passes with the patch. Patch by Adam Azarchs Differential Revision: https://reviews.llvm.org/D39439 llvm-svn: 317115
* Update implementation of OMPT to the specification OpenMP 5.0 Preview 1 (TR4).Joachim Protze2017-11-0159-403/+3621
| | | | | | | | | | | | | | 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
* Add license envirable for testing Intel compilersJonathan Peyton2017-10-201-0/+4
| | | | | | | | Patch by Simon Convent Differential Revision: https://reviews.llvm.org/D38881 llvm-svn: 316232
* Add C++ support for testcasesJonathan Peyton2017-10-204-3/+13
| | | | | | | | Patch by Simon Convent Differential Revision: https://reviews.llvm.org/D38878 llvm-svn: 316230
* [test] Fix uninitialized memory in omp_taskloop_grainsize.cJonas Hahnfeld2017-09-291-1/+2
| | | | | | result was never initialized to zero which sometimes failed the test. llvm-svn: 314513
* Fix implementation of OMP_THREAD_LIMITJonathan Peyton2017-07-271-0/+82
| | | | | | | | | | | | | | | | | | This change fixes the implementation of OMP_THREAD_LIMIT. The implementation of this previously was not restricted to a contention group (but it should be, according to the spec), and this is fixed here. A field is added to root thread to store a counter of the threads in the contention group. An extra check is added when reserving threads for a parallel region that checks this variable and compares to threadlimit-var, which is implemented as a new global variable, kmp_cg_max_nth. Associated settings changes were also made, and clean up of comments that referred to OMP_THREAD_LIMIT, but should refer to the new KMP_DEVICE_THREAD_LIMIT (added in an earlier patch). Patch by Terry Wilmarth Differential Revision: https://reviews.llvm.org/D35912 llvm-svn: 309319
* Fix failing taskloop tests by omitting gccJonathan Peyton2017-07-182-0/+4
| | | | | | We do not have GOMP interface support for taskloop yet. llvm-svn: 308351
* Add recursive task scheduling strategy to taskloop implementationJonathan Peyton2017-07-183-0/+174
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Taskloop implementation is extended by using recursive task scheduling. Envirable KMP_TASKLOOP_MIN_TASKS added as a manual threshold for the user to switch from recursive to linear tasks scheduling. Details: * The calculations for the loop parameters are moved from __kmp_taskloop_linear upper level * Initial calculation is done in the __kmpc_taskloop, further range splitting is done in the __kmp_taskloop_recur. * Added threshold to switch from recursive to linear tasks scheduling; * One half of split range is scheduled as an internal task which just moves sub-range parameters to the stealing thread that continues recursive scheduling (if number of tasks still enough), the other half is processed recursively; * Internal task duplication routine fixed to assign parent task, that was not needed when all tasks were scheduled by same thread, but is needed now. Patch by Andrey Churbanov Differential Revision: https://reviews.llvm.org/D35273 llvm-svn: 308338
* Make test/parallel/omp_nested.c not use so many threadsHal Finkel2017-06-271-0/+5
| | | | | | | | | | | | | | | | | | | I've found it very difficult to get test/parallel/omp_nested.c to pass consistently across my build environments. The problem is that it creates N^2 threads (it is testing nested parallel regions), and that often exceeds the thread limits on systems with many cores. We do raise the process limits in lit, and that often helps, but if running lit with a smaller number of threads or on a system where we're otherwise resource constrained, this particular test tends to fail (because the runtime cannot create a sufficient number of threads). This seems to work: if the maximum number of threads is more than some small number, then cap the number of threads used for the parallel region. The choice of 4 here is somewhat arbitrary. Differential Revision: https://reviews.llvm.org/D32033 llvm-svn: 306357
* OpenMP 4.5: implemented support of schedule(simd:guided) andAndrey Churbanov2017-06-054-0/+1028
| | | | | | | | | | schedule(simd:runtime) - library part. Compiler generation should use newly introduced scheduling kinds kmp_sch_guided_simd = 46, kmp_sch_runtime_simd = 47, as parameters to __kmpc_dispatch_init_* entries. Differential Revision: https://reviews.llvm.org/D31602 llvm-svn: 304724
* Fix for KMP_AFFINITY=disabled and KMP_TOPOLOGY_METHOD=hwlocJonathan Peyton2017-05-312-0/+22
| | | | | | | | | | | | With these settings, the create_hwloc_map() method was being called causing an assert(). After some consideration, it was determined that disabling affinity explicitly should just disable hwloc as well. i.e., KMP_AFFINITY overrides KMP_TOPOLOGY_METHOD. This lets the user know that the Hwloc mechanism is being ignored when KMP_AFFINITY=disabled. Differential Revision: https://reviews.llvm.org/D33208 llvm-svn: 304344
* Test cancellation_for_sections.c expectedly fails on GCCOlga Malysheva2017-04-041-0/+1
| | | | llvm-svn: 299437
* Reset cancellation status for 'parallel', 'sections' and 'for' constracts.Olga Malysheva2017-04-041-0/+61
| | | | | | | | | Without this fix cancellation status for parallel, sections and for persists across construct boundaries. Differential Revision: https://reviews.llvm.org/D31419 llvm-svn: 299434
* Fixed intermittent hang on tests with "target teams if(0)" construct with no ↵Andrey Churbanov2017-03-211-0/+64
| | | | | | | | parallel inside. Differential Revision: https://reviews.llvm.org/D29597 llvm-svn: 298373
* [test] Try to link -latomic to provide atomics when availableMichal Gorny2017-02-243-1/+16
| | | | | | | | | | | | | | | | | | | When using -rtlib=libgcc, the fallback implementation of __atomic_* builtins is provided via libatomic (included in GCC). However, neither GCC itself nor clang link libatomic implicitly, and it seems that GCC upstream expects projects to link it explicitly as necessary. Since compiler-rt provides __atomic_* builtins directly in the main library, check if they are provided by the default libraries first. If they are not, check if -latomic is available to provide them and add explicit -latomic for tests in this case. This fixes unresolved __atomic_load() references when running openmp tests on i386 with libgcc backend. Differential Revision: https://reviews.llvm.org/D30083 llvm-svn: 296183
* Run-time library part of OpenMP 5.0 task reduction implementation.Andrey Churbanov2017-02-161-0/+374
| | | | | | | | | Added test kmp_task_reduction_nest.cpp which has an example of possible compiler codegen. Differential Revision: https://reviews.llvm.org/D29600 llvm-svn: 295343
* Correct wrong comment in bug_nested_proxy_task.cJonas Hahnfeld2017-01-301-1/+1
| | | | | | The nested proxy task does not have dependencies. llvm-svn: 293472
* Fix memory error in case of reinit using kmp_set_defaults() for lock code.Jonathan Peyton2017-01-181-0/+53
| | | | | | | | The lock tables were being reallocated if kmp_set_defaults() was called. In the env_init code it says that the user should be able to switch between different KMP_CONSISTENCY_CHECK values which is what this change enables. llvm-svn: 292349
* Enable omp_get_schedule() to return static steal type.Jonathan Peyton2016-10-071-0/+82
| | | | | | | As the code is now, calling omp_get_schedule() when OMP_SCHEDULE=static_steal will cause an assert. llvm-svn: 283576
OpenPOWER on IntegriCloud