summaryrefslogtreecommitdiffstats
path: root/openmp/runtime/test
Commit message (Collapse)AuthorAgeFilesLines
...
* [test] Support 'lit' executable nameMichal Gorny2016-09-301-1/+1
| | | | | | | | | Support finding lit as plain 'lit', which is the name used by setup.py in LLVM's utils/lit. Differential Revision: https://reviews.llvm.org/D25072 llvm-svn: 282876
* Fix respecting LIBOMP_LLVM_LIT_EXECUTABLE as full pathMichal Gorny2016-09-191-6/+3
| | | | | | | | | | | | | | | | | | | | | | | | | Fix lit search to correctly respect LIBOMP_LLVM_LIT_EXECUTABLE as full program path. The variable passed to find_program() is created by CMake as a cache variable, and therefore can be directly overriden by the user. Since this was the design of LIBOMP_LLVM_LIT_EXECUTABLE (as can be deduced from the error messages) and there is no other use of LIT_EXECUTABLE, remove the redundant variable and pass LIBOMP_LLVM_LIT_EXECUTABLE directly to find_program(). Furthermore, the previous code did not work since the HINTS argument specifies more search directories rather than expected full path. Quoting the CMake documentation: > 3. Search the paths specified by the HINTS option. These should be > paths computed by system introspection, such as a hint provided by > the location of another item already found. Hard-coded guesses should > be specified with the PATHS option. Differential Revision: https://reviews.llvm.org/D24710 llvm-svn: 281887
* [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
* Appease older gcc compilers for the many-microtask-args.c testJonathan Peyton2016-08-301-1/+2
| | | | | | | Older gcc compilers error out with the C99 syntax of: for (int i =...) so this change just moves the int i; declaration up above. llvm-svn: 280138
* Fix linking of omp_foreign_thread_team_reuse test on FreeBSDDimitry Andric2016-08-081-1/+1
| | | | | | | | | | | | | | | | | | | | | Summary: On FreeBSD, linking the misc_bugs/omp_foreign_thread_team_reuse.c test case fails with: /usr/local/bin/ld: /tmp/omp_foreign_thread_team_reuse-c5e71b.o: undefined reference to symbol 'pthread_create@@FBSD_1.0' This is because the program is linked without `-lpthread`. Since the %libomp-compile-and-run macro does not allow that option to be added to the compile command line, split it up and add the required `-lpthread` between %libomp-compile and %libomp-run. Reviewers: jlpeyton, hfinkel, Hahnfeld Subscribers: Hahnfeld, emaste, openmp-commits Differential Revision: https://reviews.llvm.org/D23084 llvm-svn: 278036
* kmp_gsupport: Fix library initialization with taskgroupJonas Hahnfeld2016-08-081-0/+16
| | | | | | Differential Revision: https://reviews.llvm.org/D23259 llvm-svn: 278003
* Mark tests with task dependencies as unsupported with GCCJonas Hahnfeld2016-08-082-0/+6
| | | | llvm-svn: 277996
* Do not block on explicit task depending on proxy taskJonas Hahnfeld2016-08-081-0/+131
| | | | | | | | | | | | | | | | | | | | | | Consider the following code: int dep; #pragma omp target nowait depend(out: dep) { sleep(1); } #pragma omp task depend(in: dep) { printf("Task with dependency\n"); } printf("Doing some work...\n"); In its current state the runtime will block on the second task and not continue execution. Differential Revision: https://reviews.llvm.org/D23116 llvm-svn: 277992
* __kmp_free_task: Fix for serial explicit tasks producing proxy tasksJonas Hahnfeld2016-08-081-0/+128
| | | | | | | | | | | | | | | | | | | | | | | | | | | Consider the following code which may be executed by a serial team: int dep; #pragma omp target nowait depend(out: dep) { sleep(1); } #pragma omp task depend(in: dep) { #pragma omp target nowait { sleep(1); } } Here the explicit task may not be freed until the nested proxy task has finished. The current code hasn't considered this and called __kmp_free_task anyway which triggered an assert because of remaining incomplete children: KMP_DEBUG_ASSERT( TCR_4(taskdata->td_incomplete_child_tasks) == 0 ); Differential Revision: https://reviews.llvm.org/D23115 llvm-svn: 277991
* Add test case for nested creation of tasksJonas Hahnfeld2016-08-041-0/+35
| | | | | | For discussion in D23115 llvm-svn: 277730
* Fix the nowait tests for omp for and omp singleJonathan Peyton2016-07-062-48/+88
| | | | | | | | | | These tests are now modeled after the sections nowait test where threads wait to be released in the first construct (either for or single) and the last thread skips the last for/single construct and releases those threads. If the test fails, then it hangs because an unnecessary barrier is executed in between the constructs. llvm-svn: 274641
* Fix omp_sections_nowait.c test to address Bugzilla Bug 28336Jonathan Peyton2016-06-291-24/+59
| | | | | | | | | | | | | This rewrite of the omp_sections_nowait.c test file causes it to hang if the nowait is not respected. If the nowait isn't respected, the lone thread which can escape the first sections construct will just sleep at a barrier which shouldn't exist. All reliance on timers is taken out. For good measure, the test makes sure that all eight sections are executed as well. The test should take no longer than a few seconds on any modern machine. Differential Revision: http://reviews.llvm.org/D21842 llvm-svn: 274151
* Fix bugs in TAS and futex lockJonathan Peyton2016-06-281-0/+2
| | | | | | | | | * Incorrect lock value written in __kmp_test_futex_lock * Incorrect lock value check in tas/futex lock with USE_LOCK_PROFILE on Patch by Hansang Bae llvm-svn: 274053
* Remove redundant %libomp-compile step from test/lock/omp_lock.cJonathan Peyton2016-06-231-1/+1
| | | | llvm-svn: 273576
* Apply the KMP_USE_FUTEX feature macro everywhereJonathan Peyton2016-06-221-0/+1
| | | | llvm-svn: 273438
* Bug fix for hang when tasks used in nested parallelJonathan Peyton2016-06-211-0/+32
| | | | | | | | | | | | Bug fix for hang when omp task and nested parallelism used together. Still some problem remains with task state saving/restoring, but user's case works fine now. All tasking unit tests passed as well. Patch by Andrey Churbanov Differential Revision: http://reviews.llvm.org/D21558 llvm-svn: 273297
* Revert accidental commit to lit.cfgJonathan Peyton2016-06-091-3/+0
| | | | llvm-svn: 272287
* Refactor __kmp_execute_tasks_template functionJonathan Peyton2016-06-091-0/+3
| | | | | | | | | | | | | | Refactored __kmp_execute_tasks_template to shorten and remove code redundancy. The original code for __kmp_execute_tasks_template was very redundant with large sections of repeated code that needed to be kept consistent, and goto statements that made the control flow difficult to discern. This refactoring removes all gotos and redundancy. Patch by Terry Wilmarth Differential Revision: http://reviews.llvm.org/D20879 llvm-svn: 272286
* Offer API for setting number of loop dispatch buffersJonathan Peyton2016-05-312-0/+167
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The problem is the lack of dispatch buffers when thousands of loops with nowait, about 10 iterations each, are executed by hundreds of threads. We only have built-in 7 dispatch buffers, but there is a need in dozens or hundreds of buffers. The problem can be fixed by setting KMP_MAX_DISP_BUF to bigger value. In order to give users same possibility I changed build-time control into run-time one, adding API just in case. This change adds an environment variable KMP_DISP_NUM_BUFFERS and a new API function kmp_set_disp_num_buffers(int num_buffers). The KMP_DISP_NUM_BUFFERS envirable works only before serial initialization, because during the serial initialization we already allocate buffers for the hot team, so it is too late to change the number of buffers later (or we need to reallocate buffers for all teams which sounds too complicated). The kmp_set_defaults() routine does not work for this envirable, because it calls serial initialization before reading the parameter string. So a new routine, kmp_set_disp_num_buffers(), is created so that it can set our internal global variable before the library initialization. If both the envirable and API used the envirable wins. Differential Revision: http://reviews.llvm.org/D20697 llvm-svn: 271318
* Add a test case for microtask dispatch with many argumentsHal Finkel2016-05-261-0/+38
| | | | | | This is a cleaned-up version of the test case posted in the D19879 review. llvm-svn: 270867
* Allow unit testing on WindowsJonathan Peyton2016-05-235-2/+69
| | | | | | | | | | | | | | These changes allow testing on Windows using clang.exe. There are two main changes: 1. Only link to -lm when it actually exists on the system 2. Create basic versions of pthread_create() and pthread_join() for windows. They are not POSIX compliant by any stretch but will allow any existing and future tests to use pthread_create() and pthread_join() for testing interactions of libomp with os threads. Differential Revision: http://reviews.llvm.org/D20391 llvm-svn: 270464
* Remove unnecessary unistd.h header from tests.Jonathan Peyton2016-05-184-4/+0
| | | | llvm-svn: 269987
* Remove trailing whitespace from testsJonathan Peyton2016-05-1754-181/+181
| | | | llvm-svn: 269841
* [OpenMP Testing] Have lit.py be a valid lit executableJonathan Peyton2016-05-171-1/+1
| | | | | | | Users can use either llvm-lit (generated during llvm build) or lit.py which exists in llvm/utils/lit. llvm-svn: 269774
* Adding new kmp_aligned_malloc() entry pointJonathan Peyton2016-05-121-0/+62
| | | | | | | | | | | | | This change adds a new entry point, kmp_aligned_malloc(size_t size, size_t alignment), an entry point corresponding to kmp_malloc() but with the capability to return aligned memory as well. Other allocator routines have been adjusted so that kmp_free() can be used for freeing memory blocks allocated by any kmp_*alloc() routine, including the new kmp_aligned_malloc() routine. Differential Revision: http://reviews.llvm.org/D19814 llvm-svn: 269365
* Fix team reuse with foreign threadsJonathan Peyton2016-05-121-0/+82
| | | | | | | | | | | | | | After hot teams were enabled by default, the library started using levels kept in the team structure. The levels are broken in case foreign thread exits and puts its team into the pool which is then re-used by another foreign thread. The broken behavior observed is when printing the levels for each new team, one gets 1, 2, 1, 2, 1, 2, etc. This makes the library believe that every other team is nested which is incorrect. What is wanted is for the levels to be 1, 1, 1, etc. Differential Revision: http://reviews.llvm.org/D19980 llvm-svn: 269363
* Fix trip count calculation for parallel loops in runtimeJonathan Peyton2016-04-181-0/+67
| | | | | | | | | | | | | | | The trip count calculation was incorrect for loops with large bounds. For example, for(int i=-2,000,000,000; i < 2,000,000,000; i+=50000000), the trip count calculation had overflow (trying to calculate 2,000,000,000 + 2,000,000,000 with signed integers) and wasn't giving the right value. This patch fixes this error in the runtime by using unsigned integers instead. There is still a bug in the clang compiler component because it warns that there is overflow in the test case file when there isn't. This error isn't there for the Intel Compiler. So for now, the test case is designated as XFAIL. Differential Revision: http://reviews.llvm.org/D19078 llvm-svn: 266677
* Exponential back off logic for test-and-set lockJonathan Peyton2016-04-141-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | This change adds back off logic in the test and set lock for better contended lock performance. It uses a simple truncated binary exponential back off function. The default back off parameters are tuned for x86. The main back off logic has a two loop structure where each is controlled by a user-level parameter: max_backoff - limits the outer loop number of iterations. This parameter should be a power of 2. min_ticks - the inner spin wait loop number of "ticks" which is system dependent and should be tuned for your system if you so choose. The "ticks" on x86 correspond to the time stamp counter, but on other architectures ticks is a timestamp derived from gettimeofday(). The user can modify these via the environment variable: KMP_SPIN_BACKOFF_PARAMS=max_backoff[,min_ticks] Currently, since the default user lock is a queuing lock, one would have to also specify KMP_LOCK_KIND=tas to use the test-and-set locks. Differential Revision: http://reviews.llvm.org/D19020 llvm-svn: 266329
* OMP_WAIT_POLICY changesJonathan Peyton2016-04-041-0/+40
| | | | | | | | | | | | | This change has OMP_WAIT_POLICY=active to mean that threads will busy-wait in spin loops and virtually never go to sleep. OMP_WAIT_POLICY=passive now means that threads will immediately go to sleep inside a spin loop. KMP_BLOCKTIME was the previous mechanism to specify this behavior via KMP_BLOCKTIME=0 or KMP_BLOCKTIME=infinite, but the standard OpenMP environment variable should also be able to specify this behavior. Differential Revision: http://reviews.llvm.org/D18577 llvm-svn: 265339
* [OMPT] Fix parallel_id and task_id in loop_end with schedule staticJonas Hahnfeld2016-03-2414-0/+138
| | | | | | | | | 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
* [OMPT] Fix duplicate implicit_task_end events for master thread with GCCJonas Hahnfeld2016-03-243-0/+28
| | | | | | | | | | For non-serialized parallel regions the master thread issued two callbacks: The first one in kmp_gsupport.c and the second in __kmp_join_call. Therefore only trigger the callback in kmp_gsupport.c for serialized parallel regions. Differential Revision: http://reviews.llvm.org/D16716 llvm-svn: 264264
* [OMPT] Make tests require OMPT_BLAMEJonas Hahnfeld2016-03-227-8/+6
| | | | | | | ompt_event_barrier_{begin,end} are optional blame events. In total it doesn't make any sense to test partially built OMPT support. llvm-svn: 264031
* [OMPT] Create infrastructure and add first tests for OMPTJonas Hahnfeld2016-03-228-0/+404
| | | | | | | | | | | | | | | | | | Some basic checks next to the implementation should futher lower the possibility to introduce regressions. (Note that this would have catched the ordering issue fixed in rL258866 and pointed to rL263940.) The tests are implementation dependent in one point because they assume that thread ids are assigned in ascending order. This is not defined by the standard but currently ensured in libomp. We have to think about another way of ordering the threads should this ever be subject to change... Note that this isn't aiming at replacing the implementation independent test-suite at https://github.com/OpenMPToolsInterface/ompt-test-suite! Differential Revision: http://reviews.llvm.org/D16715 llvm-svn: 264027
* Add new OpenMP 4.5 taskloop construct featureJonathan Peyton2016-03-021-0/+158
| | | | | | | | | | | | | | | | | | From the standard: The taskloop construct specifies that the iterations of one or more associated loops will be executed in parallel using OpenMP tasks. The iterations are distributed across tasks created by the construct and scheduled to be executed. This initial implementation uses a simple linear tasks distribution algorithm. Later we can add other algorithms to speedup generation of huge number of tasks (i.e., tree-like tasks generation should be faster). This needs to be put into the OpenMP runtime library in order for the compiler team to develop the compiler side of the implementation. Differential Revision: http://reviews.llvm.org/D17404 llvm-svn: 262535
* Forgot to add test files for doacross and task priority.Jonathan Peyton2016-03-022-0/+78
| | | | llvm-svn: 262533
* Add initial support for OpenMP 4.5 task priority featureJonathan Peyton2016-02-251-1/+4
| | | | | | | | | | | The maximum task priority value is read from envirable: OMP_MAX_TASK_PRIORITY. But as of now, nothing is done with it. We just handle the environment variable and add the new api: omp_get_max_task_priority() which returns that value or zero if it is not set. Differential Revision: http://reviews.llvm.org/D17411 llvm-svn: 261908
* [CMake] Introduce OPENMP_LLVM_TOOLS_DIRJonas Hahnfeld2016-02-051-2/+5
| | | | | | | | | This will be used in a later patch to find additional LLVM tools for tests and enables reusability for libomptarget that is currently under review. Differential Revision: http://reviews.llvm.org/D16713 llvm-svn: 259876
* omp_barrier.c test fixed in order to reliably and faster run on any number ↵Andrey Churbanov2016-01-251-1/+5
| | | | | | of processors llvm-svn: 258695
* lit.cfg: Pass -isysroot to the SDK on DarwinHans Wennborg2016-01-191-0/+11
| | | | | | | Newly-built Clangs don't automatically find the SDK, and newer versions of Mac OS X don't provide it under /usr/include etc. llvm-svn: 258169
* test omp_threadprivate_for.c fixedAndrey Churbanov2015-12-271-2/+3
| | | | llvm-svn: 256473
* Adding Hwloc library option for affinity mechanismJonathan Peyton2015-11-303-9/+33
| | | | | | | | | | | | | | | | | | | These changes allow libhwloc to be used as the topology discovery/affinity mechanism for libomp. It is supported on Unices. The code additions: * Canonicalize KMP_CPU_* interface macros so bitmask operations are implementation independent and work with both hwloc bitmaps and libomp bitmaps. So there are new KMP_CPU_ALLOC_* and KMP_CPU_ITERATE() macros and the like. These are all in kmp.h and appropriately placed. * Hwloc topology discovery code in kmp_affinity.cpp. This uses the hwloc interface to create a libomp address2os object which the rest of libomp knows how to handle already. * To build, use -DLIBOMP_USE_HWLOC=on and -DLIBOMP_HWLOC_INSTALL_DIR=/path/to/install/dir [default /usr/local]. If CMake can't find the library or hwloc.h, then it will tell you and exit. Differential Revision: http://reviews.llvm.org/D13991 llvm-svn: 254320
* [OPENMP] Fixed tests for gcc build.Alexey Bataev2015-11-162-2/+3
| | | | llvm-svn: 253200
* Fix for zero chunk sizeJonathan Peyton2015-11-061-0/+39
| | | | | | | | Setting dynamic schedule with chunk size 0 via omp_set_schedule(dynamic,0) and then using "schedule (runtime)" causes infinite loop because for the chunked dynamic schedule we didn't correct zero chunk to the default (1). llvm-svn: 252338
* [OPENMP] Add dependency to clang/clang-headers etc. for in-tree build of libomp.Alexey Bataev2015-11-024-7/+6
| | | | | | | Add additional dependency to clang/clang-headers/FileCheck to avoid possible troubles with in-tree build/test of libomp + allow parallel testing of libomp. Also includes bugfixes for tests + improvements to avoid possible race conditions. Differential Revision: http://reviews.llvm.org/D14055 llvm-svn: 251797
OpenPOWER on IntegriCloud