summaryrefslogtreecommitdiffstats
path: root/openmp
Commit message (Collapse)AuthorAgeFilesLines
...
* Add initial support for OpenMP 4.5 task priority featureJonathan Peyton2016-02-2512-8/+107
| | | | | | | | | | | 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
* dd new OpenMP 4.5 schedule clause modifiers (monotonic/non-monotonic) featureJonathan Peyton2016-02-253-0/+44
| | | | | | | | | | | | | | | | | The monotonic/non-monotonic flags are sent to the runtime via the sched_type by setting the 30th (non-monotonic) or 29th (monotonic) bit in the sched_type. Macros are added to probe if monotonic or non-monotonic is specified (SCHEDULE_HAS_[NON]MONOTONIC & SCHEDULE_HAS_NO_MODIFIERS) and also to to get the base sched_type (SCHEDULE_WITHOUT_MODIFIERS) Currently, nothing is done with the modifiers. Also, this patch adds some comments on the use of the enumerations in at least one place where it is subtle. Differential Revision: http://reviews.llvm.org/D17406 llvm-svn: 261906
* Remove unnecessary semicolons after bracesJonathan Peyton2016-02-181-2/+2
| | | | llvm-svn: 261249
* [OMPT] Frame information for openmp taskwaitJonas Hahnfeld2016-02-121-3/+6
| | | | | | | | | | | | | For pragma omp taskwait the runtime is called from the task context. Therefore, the reentry frame information should be updated. The information should be available for both taskwait event calls; therefore, set before the first event and reset after the last event. Patch by Joachim Protze Differential Revision: http://reviews.llvm.org/D17145 llvm-svn: 260674
* Fix incorrect task_team in __kmp_give_taskJonathan Peyton2016-02-112-4/+9
| | | | | | | | | | | | When a target task finishes and it tries to access the th_task_team from the threads in the team where it was created, th_task_team can be NULL or point to a different place when that thread started a nested region that is still running. Finding the exact task_team that the threads were using is difficult as it would require to unwind the task_state_memo_stack. So a new field was added in the taskdata structure to point to the active task_team when the task was created. llvm-svn: 260615
* Fix a couple of typos in commentsJonathan Peyton2016-02-111-2/+2
| | | | llvm-svn: 260613
* Proxy task fix: task_state stack push condition on forkJonathan Peyton2016-02-091-1/+2
| | | | | | | The problem is that the master's thread state was not saved before entering a parallel region so it does not remember tasks when it returns. llvm-svn: 260306
* Have Mac builds use @rpath when supported in CMakeJonathan Peyton2016-02-092-0/+10
| | | | | | | The -install_name linker flag will use "@rpath/" when supported in CMake which is the recommended usage for dynamic libraries on Mac OSX. llvm-svn: 260300
* [GCC] GOMP_task: Change argument type of if_cond from int to boolJonas Hahnfeld2016-02-091-1/+1
| | | | | | | | | | | | (libgomp has bool as well) This was causing a test failure in omp_test_if.c when building with GCC in Debug mode. I have verified that GCC versions 4.9.2 and 5.3.0 now work and compile-tested this change with clang 3.7.1 and Intel Compiler 16.0. Differential Revision: http://reviews.llvm.org/D16921 llvm-svn: 260204
* [CMake] Introduce OPENMP_LLVM_TOOLS_DIRJonas Hahnfeld2016-02-053-2/+16
| | | | | | | | | 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
* Add LIBOMP_ENABLE_SHARED option for CMakeJonathan Peyton2016-02-043-9/+38
| | | | | | | | | | | | | | | | When building executables for Cray supercomputers, statically-linked executables are preferred. This patch makes it possible to build the OpenMP runtime as an archive for building statically-linked executables. The patch adds the flag LIBOMP_ENABLE_SHARED, which defaults to true. When true, a build of the OpenMP runtime yields dynamic libraries. When false, a build of the OpenMP runtime yields static libraries. There is no setting that allows both kinds of libraries to be built. Patch by John Mellor-Crummey Differential Revision: http://reviews.llvm.org/D16525 llvm-svn: 259817
* Fix task dependency performance problemJonathan Peyton2016-01-282-10/+22
| | | | | | | | | | | | | | | | | | In: http://lists.llvm.org/pipermail/openmp-dev/2015-August/000858.html, a performance issue was found with libomp's task dependencies. The task dependencies hash table has an issue with collisions. The current table size is a power of two. This combined with the current hash function causes a large number of collisions to occurr. Also, the current size (64) is too small for larger applications so the table size is increased. This patch creates a two level hash table approach for task dependencies. The implicit task is considered the "master" or "top-level" task which has a large static sized hash table (997), and nested tasks will have smaller hash tables (97). Prime numbers were chosen to help reduce collisions. Differential Revision: http://reviews.llvm.org/D16640 llvm-svn: 259113
* [OMPT] Add support for ompt_event_task_dependences and ↵Jonas Hahnfeld2016-01-286-11/+170
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ompt_event_task_dependence_pair The attached patch adds support for ompt_event_task_dependences and ompt_event_task_dependence_pair events from the OMPT specification [1]. These events only apply to OpenMP 4.0 and 4.1 (aka 4.5) because task dependencies were introduced in 4.0. With respect to the changes: ompt_event_task_dependences According to the specification, this event is raised after the task has been created, thefore this event needs to be raised after ompt_event_task_begin (in __kmp_task_start). However, the dependencies are known at __kmpc_omp_task_with_deps which occurs before __kmp_task_start. My modifications extend the ompt_task_info_t struct in order to store the dependencies of the task when _kmpc_omp_task_with_deps occurs and then they are emitted in __kmp_task_start just after raising the ompt_event_task_begin. The deps field is allocated and valid until the event is raised and it is freed and set to null afterwards. ompt_event_task_dependence_pair The processing of the dependences (i.e. checking whenever a dependence is already satisfied) is done within __kmp_process_deps. That function checks every dependence and calls the __kmp_track_dependence routine which gives some support for graphical output. I used that routine to emit the dependence pair but I also needed to know the sink_task. Despite the fact that the code within KMP_SUPPORT_GRAPH_OUTPUT refers to task_sink it may be null because sink->dn.task (there's a comment regarding this) and in fact it does not point to a proper pointer value because the value is set in node->dn.task = task; after the __kmp_process_deps calls in __kmp_check_deps. I have extended the __kmp_process_deps and __kmp_track_dependence parameter list to receive the sink_task. [1] https://github.com/OpenMPToolsInterface/OMPT-Technical-Report/blob/target/ompt-tr.pdf Patch by Harald Servat Differential Revision: http://reviews.llvm.org/D14746 llvm-svn: 259038
* [OMPT] Avoid SEGV when a worker thread needs its parallel id behind the barrierJonas Hahnfeld2016-01-281-1/+4
| | | | | | | | | | When the code behind the barrier is executed, the master thread may have already resumed execution. That's why we cannot safely assume that *pteam is not yet freed. This has been introduced by r258866. llvm-svn: 259037
* [OMPT] Workaround clang failing with 'declare target'Jonas Hahnfeld2016-01-283-6/+9
| | | | | | | | | | Current clang trunk reports _OPENMP to be 201307 = OpenMP 4.0. It doesn't recognize '#pragma omp declare target' though (patch still pending) and therefore fails compilation. Differential Revision: http://reviews.llvm.org/D16631 llvm-svn: 259026
* Restore th_current_task first as suggested by John Mellor-CrummeyJonathan Peyton2016-01-271-5/+4
| | | | | | | If an asynchronous inquiry peers into the runtime system it doesn't see the freed task as the current task. llvm-svn: 258990
* Formatting fixesJonathan Peyton2016-01-274-146/+84
| | | | | | | Removing extraneous { } bracket sections. Unindenting blocks of code as a result. Also removing empty #ifdef KMP_STUB llvm-svn: 258986
* Fixing comments.Jonathan Peyton2016-01-273-10/+2
| | | | | | Removing references to non-existent functions, fixing typos. llvm-svn: 258985
* Removing extra empty linesJonathan Peyton2016-01-276-35/+0
| | | | llvm-svn: 258984
* Change whitespace to test commit accessJonas Hahnfeld2016-01-271-1/+1
| | | | llvm-svn: 258910
* [OMPT]: Fix the order of implicit_task_end_eventsJonathan Peyton2016-01-261-15/+31
| | | | | | | | | | | | | | | For implcit barriers in simple parallel for loops, the order of the OMPT events was wrong. The barrier_{begin,end} events came after the implcit_task_end event for the implcit barrier at the end of the parallel region. This is wrong because the implicit task executes the barrier before ending. This patch fixes the order of the event: It will be triggerd now just before __kmp_pop_current_task_from_thread() is called. Patch by Tim Cramer Differential Revision: http://reviews.llvm.org/D16347 llvm-svn: 258866
* Bypass Perl modules in build systemJonathan Peyton2016-01-267-17/+33
| | | | | | | | | This change fixes the bug: https://llvm.org/bugs/show_bug.cgi?id=25975 by bypassing the perl module files which try to deduce system information. These perl modules files don't offer useful information and are from the original build system. They can be removed after this change. llvm-svn: 258843
* Fix compilations with msvc's /Zc:strictStringsIsmail Donmez2016-01-261-2/+2
| | | | llvm-svn: 258797
* 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
* Add missing cleanup code for cached indirect lock pool.Jonathan Peyton2016-01-221-0/+1
| | | | | | | | | | | This change fixes one issue reported at https://llvm.org/bugs/show_bug.cgi?id=26184 There was missing cleanup code for the cached indirect lock pool. The change will fix the reported case where it tries to initialize a lock after runtime cleanup/reinitialization, but it is still possible that the user program runs into another problem because most test programs have a call to __kmpc_set_lock after cleanup/reinitialization without calling __kmpc_init_lock causing a crash/hang. llvm-svn: 258528
* 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
* Don't use __DATE__ or __TIME__; it breaks release builds (PR26145)Hans Wennborg2016-01-141-1/+1
| | | | | | | | | | | | | | The release builds are configured to be reproducible, so that the binaries compare equal between bootstrap iterations. The OpenMP run-time build was failing like this: runtime/src/kmp_version.c:108:79: error: expansion of date or time macro is not reproducible [-Werror,-Wdate-time] char const __kmp_version_build_time[] = KMP_VERSION_PREFIX "build time: " __DATE__ " " __TIME__; Figuring as the build currently doesn't set LIBOMP_DATE, it's probably OK to skip setting the build time here too. llvm-svn: 257833
* New API for restoring current thread's affinity to init affinity of applicationJonathan Peyton2016-01-121-0/+38
| | | | | | | | | | | | | | | This new API, int kmp_set_thread_affinity_mask_initial(), is available for use by other parallel runtime libraries inside a possibly OpenMP-registered thread. This entry point restores the current thread's affinity mask to the affinity mask of the application when it first began. If -1 is returned it can be assumed that either the thread hasn't called affinity initialization or that the thread isn't registered with the OpenMP library. If 0 is returned then, then the call was successful. Any return value greater than zero indicates an error occurred when setting affinity. Differential Revision: http://reviews.llvm.org/D15867 llvm-svn: 257489
* Remove double negative in if() logic.Jonathan Peyton2016-01-111-2/+2
| | | | | | Change (__kmp_mic_type != non_mic) to (__kmp_mic_type == mic2) llvm-svn: 257380
* Put function names on their own line.Jonathan Peyton2016-01-111-3/+5
| | | | llvm-svn: 257378
* Removed unused __kmp_*_i8 functions.Jonathan Peyton2016-01-049-94/+19
| | | | llvm-svn: 256790
* Fix for barrier problem: applications with many parallel regions (2^30) hangJonathan Peyton2016-01-041-3/+3
| | | | | | The barrier states type doesn't need to be explicitly set. llvm-svn: 256778
* test omp_threadprivate_for.c fixedAndrey Churbanov2015-12-271-2/+3
| | | | llvm-svn: 256473
* Fix build error: OMPT_SUPPORT=true was not tested after hinted lock changesJonathan Peyton2015-12-231-1/+8
| | | | | | | | | | | | | | | | | | | | Recent changes to support dynamic locks didn't consider the code compiled when OMPT_SUPPORT=true. As a result, the OMPT support was broken by recent changes to nested locks to support dynamic locks. For OMPT to work with dynamic locks, they need to provide a return code indicating whether a nested lock acquisition was the first or not. This patch moves the OMPT support for nested locks into the #else case when DYNAMIC locks were not used. New support is needed for dynamic locks. This patch fixes the build and leaves a placeholder where the missing OMPT callbacks can be added either the author of the OMPT support for locks, or the dynamic locking support. Patch by John Mellor-Crummey Differential Revision: http://reviews.llvm.org/D15656 llvm-svn: 256314
* Prevent monitor thread creation when KMP_BLOCKTIME="infinite"Jonathan Peyton2015-12-182-0/+17
| | | | | | | | | | | When users sets envirable KMP_BLOCKTIME to "infinite" (the time one busy-waits at barrieres, etc.), the monitor thread is not useful and can be ignored. This change prevents the creation of the monitor thread when the users sets KMP_BLOCKTIME to "infinite". Differential Revision: http://reviews.llvm.org/D15628 llvm-svn: 256061
* Remove some extra spacesJonathan Peyton2015-12-181-3/+3
| | | | llvm-svn: 256060
* [STATS] Have CMake do real check for stats functionalityJonathan Peyton2015-12-184-5/+42
| | | | | | | | | | | This change allows clang to build the stats library for every architecture which supports __builtin_readcyclecounter(). CMake also checks for all necessary features for stats and will error out if the platform does not support it. Patch by Hal Finkel and Johnny Peyton llvm-svn: 256002
* [STATS] Properly guard the tick_time() function and its usesJonathan Peyton2015-12-173-2/+13
| | | | llvm-svn: 255910
* [STATS] replace __cpuid() intrinsic with already existing __kmp_x86_cpuid() ↵Jonathan Peyton2015-12-171-4/+5
| | | | | | function llvm-svn: 255907
* [STATS] Fix stats lock problem to be compatible with new hinted lock codeJonathan Peyton2015-12-172-1/+4
| | | | llvm-svn: 255901
* [STATS] Add libm.so to lib dependencies for stats libraryJonathan Peyton2015-12-171-0/+1
| | | | llvm-svn: 255900
* Fix broken visual studio builds by disabling KMP_USE_TSX.Jonathan Peyton2015-12-141-1/+2
| | | | | | Visual studio can't handle the asm extension in the KMP_USE_TSX code sections. llvm-svn: 255514
* Hinted lock (OpenMP 4.5 feature) Updates/Fixes Part 3Jonathan Peyton2015-12-1116-357/+331
| | | | | | | | | | | | | | | | | | | | | | | | This change set includes all changes to make the code conform to the OMP 4.5 specification: * Removed hint / hinted_init definitions from include/40 files * Hint values are powers of 2 to enable composition (4.5 spec) * Hinted lock initialization functions were renamed (4.5 spec) kmp_init_lock_hinted -> omp_init_lock_with_hint kmp_init_nest_lock_hinted -> omp_init_nest_lock_with_hint * __kmpc_critical_section_with_hint was added to support a critical section with a hint (4.5 spec) * __kmp_map_hint_to_lock was added to convert a hint (possibly a composite) to an internal lock type * kmpc_init_lock_with_hint and kmpc_init_nest_lock_with_hint were added as internal entries for the hinted lock initializers. The preivous internal functions (__kmp_init*) were moved to kmp_csupport.c and reused in multiple places * Added the two init functions to dllexports * KMP_USE_DYNAMIC_LOCK is turned on if OMP_41_ENABLED is turned on Differential Revision: http://reviews.llvm.org/D15205 llvm-svn: 255376
* Hinted lock (OpenMP 4.5 feature) Updates/Fixes Part 2Jonathan Peyton2015-12-1113-222/+376
| | | | | | | | | | | | | | | | | | | * Added a new user TSX lock implementation, RTM, This implementation is a light-weight version of the adaptive lock implementation, omitting the back-off logic for deciding when to specualte (or not). The fall-back lock is still the queuing lock. * Changed indirect lock table management. The data for indirect lock management was encapsulated in the "kmp_indirect_lock_table_t" type. Also, the lock table dimension was changed to 2D (was linear), and each entry is a kmp_indirect_lock_t object now (was a pointer to an object). * Some clean up in the critical section code * Removed the limits of the tuning parameters read from KMP_ADAPTIVE_LOCK_PROPS * KMP_USE_DYNAMIC_LOCK=1 also turns on these two switches: KMP_USE_TSX, KMP_USE_ADAPTIVE_LOCKS Differential Revision: http://reviews.llvm.org/D15204 llvm-svn: 255375
* Hinted lock (OpenMP 4.5 feature) Updates/FixesJonathan Peyton2015-12-113-140/+159
| | | | | | | | | | | | | There are going to be two more patches which bring this feature up to date and in line with OpenMP 4.5. * Renamed jump tables for the lock functions (and some clean up). * Renamed some macros to be in KMP_ namespace. * Return type of unset functions changed from void to int. * Enabled use of _xebgin() et al. intrinsics for accessing TSX instructions. Differential Revision: http://reviews.llvm.org/D15199 llvm-svn: 255373
* Replace DYNA_* names with KMP_* namesJonathan Peyton2015-12-035-213/+213
| | | | llvm-svn: 254637
* Fix honoring of OMP_THREAD_LIMIT in the teams constructJonathan Peyton2015-11-301-7/+36
| | | | | | | | | | | | Fix for crash in the teams construct in case user sets OMP_THREAD_LIMIT to a number less than the number of processors. Now the number of threads will be silently reduced if the user didn't specify teams parameters or with a warning if the user specified teams parameters conflicting with OMP_THREAD_LIMIT. Differential Revision: http://reviews.llvm.org/D14732 llvm-svn: 254322
* Fix crash when __kmp_task_team_setup called for single threaded teamJonathan Peyton2015-11-301-20/+21
| | | | | | | | | | | The task_team pointer is dereferenced unconditionally which causes a SEGFAULT when it is NULL (e.g. for serialized parallel, that can happen for "teams" construct or for "target nowait"). The solution is to skip second task team setup for single thread team. Differential Revision: http://reviews.llvm.org/D14729 llvm-svn: 254321
* Adding Hwloc library option for affinity mechanismJonathan Peyton2015-11-3018-138/+789
| | | | | | | | | | | | | | | | | | | 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
* Add newlines to debug TRACE messages in kmp_taskdeps.cppJonathan Peyton2015-11-161-2/+2
| | | | llvm-svn: 253265
OpenPOWER on IntegriCloud