summaryrefslogtreecommitdiffstats
path: root/openmp/runtime
Commit message (Collapse)AuthorAgeFilesLines
...
* Implementation of OpenMP 5.0 mutexinoutset task dependency type.Andrey Churbanov2018-11-076-199/+682
| | | | | | Differential Revision: https://reviews.llvm.org/D53380 llvm-svn: 346307
* remove duplicate omp_control_tool export to fix windows buildAndrey Churbanov2018-10-251-3/+0
| | | | | | | | Patch by squallatf@gmail.com Differential Revision: https://reviews.llvm.org/D53480 llvm-svn: 345255
* [OpenMP] Convert KMP_DYNAMIC_LIB to a 0 or 1 guard everywhereJonathan Peyton2018-10-054-7/+7
| | | | llvm-svn: 343869
* [OpenMP] Fix KMP_DYNAMIC_LIB to be dependent on LIBOMP_ENABLE_SHAREDJonathan Peyton2018-10-051-1/+2
| | | | | | | The KMP_DYNAMIC_LIB guard was hard set to 1. This patch has the guard depend on CMake variable LIBOMP_ENABLE_SHARED. llvm-svn: 343866
* [OpenMP][OMPT] Fix unsafe initialization of ompt_data_t objectsJonathan Peyton2018-10-041-6/+4
| | | | | | | | | | | | Initializing an ompt_data_t object using the pointer union member is potentially unsafe in 32-bit programs. This change fixes the issue by using the constant, ompt_data_none. Patch by Hansang Bae Differential Revision: https://reviews.llvm.org/D52046 llvm-svn: 343785
* [OpenMP] Shutdown library on Windows if possible for better OMPT behaviorJonathan Peyton2018-10-021-0/+8
| | | | | | | | | | | | | On Windows, child workers are terminated by the parent during the normal program exit process (ExitProcess()) and they are not able to finish generating their OpenMP events. We can force manual library shut down in __kmpc_end() to fix this at least for the cases where __kmpc_end() is properly inserted. Patch by Hansang Bae Differential Revision: https://reviews.llvm.org/D52628 llvm-svn: 343619
* Fixed workaround made in https://reviews.llvm.org/D51694.Andrey Churbanov2018-10-011-4/+4
| | | | | | | | | Patch suggested by Kelvin Li: removed optional "kind=" part of kind-selector for variables with long names and kind names. Differential Revision: https://reviews.llvm.org/D52712 llvm-svn: 343475
* [OpenMP] Add missing __kmpc_critical_with_hint to dllexportsJonathan Peyton2018-09-263-12/+8
| | | | | | | | | This patch puts the __kmpc_critical_with_hint function in dllexports and also replaces some OMP_45_ENABLED to OMP_50_ENABLED Differential Revision: https://reviews.llvm.org/D52380 llvm-svn: 343143
* [OpenMP] Fix balanced affinity so thread's private affinity mask is updatedJonathan Peyton2018-09-263-9/+7
| | | | | | | | | | | Balanced affinity only updated the thread's affinity with the operating system. This change also has the thread's private mask reflect that change as well so that any API that probes the thread's affinity mask will report the correct mask value. Differential Revision: https://reviews.llvm.org/D52379 llvm-svn: 343142
* [OpenMP] Update ittnotify sourcesJonathan Peyton2018-09-267-454/+1010
| | | | | | | | | This patch updates the ittnotify sources to the latest corresponding with Intel(R) VTune(TM) Amplifier 2018 Differential Revision: https://reviews.llvm.org/D52378 llvm-svn: 343139
* [OpenMP] Fix performance issue from 376.kdtreeJonathan Peyton2018-09-264-131/+153
| | | | | | | | | | | | | | This change improves the performance of 376.kdtree by giving the compiler an opportunity to do inlining and other optimizations for the call path, __kmpc_omp_task_complete_if0()->__kmp_task_finish(), which is one of the hot paths in the program; some functions in kmp_taskdeps.cpp were moved to the new header file, kmp_taskdeps.h to achieve this. Patch by Hansang Bae Differential Revision: https://reviews.llvm.org/D51889 llvm-svn: 343138
* [OpenMP][OMPT] A few improvementsJonathan Peyton2018-09-267-22/+38
| | | | | | | | | | | | | | This change includes miscellaneous improvements as follows: 1) Added ompt_get_proc_id() implementation for Windows 2) Added parser and print tool for omp-tool-var, just in case it needs to be printed (OMP_DISPLAY_ENV) 3) omp_control_tool is exported on Windows Patch by Hansang Bae Differential Revision: https://reviews.llvm.org/D50538 llvm-svn: 343137
* [OMPT] Update types according to TR7Joachim Protze2018-09-1016-129/+198
| | | | | | | | | | | | | | | | | | Some types and callback signatures have changed from TR6 to TR7. Major changes (only adding signatures and stubs): (-remove idle callback) done by D48362 -add reduction and dispatch callback -add get_task_memory and finalize_tool runtime entry points -ompt_invoker_t becomes ompt_parallel_flag_t -more types of sync_regions Patch provided by Simon Convent Reviewers: hbae, protze.joachim Differential Revision: https://reviews.llvm.org/D50774 llvm-svn: 341834
* [OpenMP] Change hint parameter type for critical to uint32_tJonathan Peyton2018-09-072-2/+6
| | | | | | | | | | | Add atomic hint flags to the enum. The hint parameter type was changed to uint32_t in __kmpc_critical_with_hint() Patch by Olga Malysheva Differential Revision: https://reviews.llvm.org/D51235 llvm-svn: 341694
* [OpenMP] Synchronization hint constants added to headersJonathan Peyton2018-09-074-56/+99
| | | | | | | | | | | | | | | | ident flags reserved for atomic hints. This patch adds omp_sync_hint_t to omp.h and omp_sync_hint_kind to omp_lib.h. For better maintainability the list of macros for ident flags was replaced with a enum. The new KMP_IDENT_ATOMIC_HINT_MASK was added to the enum to support possible future atomic hints. Also fix omp_lib.h.var to be under 72 chars again after 5.0 OpenMP Memory commit Patch by Olga Malysheva Differential Revision: https://reviews.llvm.org/D51233 llvm-svn: 341693
* [OpenMP] Initial implementation of OMP 5.0 Memory Management routinesJonathan Peyton2018-09-0719-13/+642
| | | | | | | | | | | | | | | | | | | | | | | Implemented omp_alloc, omp_free, omp_{set,get}_default_allocator entries, and OMP_ALLOCATOR environment variable. Added support for HBW memory on Linux if libmemkind.so library is accessible (dynamic library only, no support for static libraries). Only used stable API (hbwmalloc) of the memkind library though we may consider using experimental API in future. The ICV def-allocator-var is implemented per implicit task similar to place-partition-var. In the absence of a requested allocator, the uses the default allocator. Predefined allocators (the only ones currently available) are made similar for C and Fortran, - pointers (long integers) with values 1 to 8. Patch by Andrey Churbanov Differential Revision: https://reviews.llvm.org/D51232 llvm-svn: 341687
* Fix for https://bugs.llvm.org/show_bug.cgi?id=38839:Andrey Churbanov2018-09-071-57/+92
| | | | | | | | Changed style of declarations to be less than 72 char each. Differential Revision: https://reviews.llvm.org/D51694 llvm-svn: 341653
* [libomptaret][test] Announce compiler featuresJonas Hahnfeld2018-09-051-1/+1
| | | | | | | | This is a follow-up to r341371: The new test for PR38704 doesn't work with Clang 6.0. It uses an UNSUPPORTED: clang-6, but that hasn't worked because the compiler features weren't known to lit. llvm-svn: 341448
* [OpenMP][Fix] Conditional compilation leaves variables unusedGheorghe-Teodor Bercea2018-08-271-0/+2
| | | | | | | | | | | | | | Summary: Prevent variables from being left unused by conditional compilation. Reviewers: ABataev, grokos, Hahnfeld, caomhin, protze.joachim Reviewed By: Hahnfeld Subscribers: guansong, openmp-commits Differential Revision: https://reviews.llvm.org/D51303 llvm-svn: 340771
* [OpenMP][Fix] Ensure comparison between unsigned values.Gheorghe-Teodor Bercea2018-08-271-1/+1
| | | | | | | | | | | | | | Summary: Ensure the values being compared are both unsigned. Reviewers: ABataev, Hahnfeld, caomhin, grokos, AndreyChurbanov Reviewed By: AndreyChurbanov Subscribers: AndreyChurbanov, guansong, openmp-commits Differential Revision: https://reviews.llvm.org/D51301 llvm-svn: 340745
* [OpenMP] Remove deprecated/obsolete MIC attributes from headersJonathan Peyton2018-08-241-1/+3
| | | | llvm-svn: 340656
* [OpenMP] Fixed affinity verbose double printing for balanced type.Jonathan Peyton2018-08-241-1/+2
| | | | llvm-svn: 340647
* [OpenMP] Fix tasking bug for decreasing hot team nthreadsJonathan Peyton2018-08-241-1/+1
| | | | | | | | | | | | | | | | | | The __kmp_execute_tasks_template() function reads the task_team and current_task from the thread structure. There appears to be a pathological timing where the number of threads in the hot team decreases and so a thread is put in the pool via __kmp_free_thread(). It could be the case that: 1) A thread reads th_task_team into task_team local variables and is then interrupted by the OS 2) Master frees the thread and sets current task and task team to NULL 3) The thread reads current_task as NULL When this happens, current_task is dereferenced and a segfault occurs. This patch just checks for current_task to not be NULL as well. Differential Revision: https://reviews.llvm.org/D50651 llvm-svn: 340632
* [OpenMP] Add check for hot_teams arrayJonathan Peyton2018-08-241-1/+2
| | | | | | | | | | If hot teams are not being used, this code could seg fault without the added check, and does so when composability is used in conjunction with nesting. The fix prevents the segfault. Differential Revision: https://reviews.llvm.org/D50649 llvm-svn: 340629
* [OpenMP] Fix incorrect barrier imbalance reporting in ITTNOTIFYJonathan Peyton2018-08-242-22/+26
| | | | | | | | | Exclude nested explicit tasks from timing, only outer level explicit task counted and its time added to barrier arrive time for the thread. Differential Revision: https://reviews.llvm.org/D50584 llvm-svn: 340628
* [OMPT] Remove OMPT idle callbackJoachim Protze2018-08-155-72/+0
| | | | | | | | | | | | | The idle callback was removed from the spec as of TR7. This removes it from the implementation. Patch provided by Simon Convent Reviewers: hbae, protze.joachim Differential Revision: https://reviews.llvm.org/D48362 llvm-svn: 339771
* [OMPT] Make omp_control_tool() compliant when called from Fortran programsJonathan Peyton2018-08-132-2/+4
| | | | | | | | | | | | | | This change fixes an incorrect behavior of the omp_control_tool function when called from Fortran applications. A tool callback function for this event is supposed to get NULL for the third argument according to the specification, but the current implementation just passes a garbage value. A possible fix is to use the OPTIONAL attribute for the third argument. Patch by Hansang Bae Differential Revision: https://reviews.llvm.org/D50565 llvm-svn: 339585
* [OpenMP] Cleanup codeJonathan Peyton2018-08-0924-417/+239
| | | | | | | | | | | | | | | | This patch cleans up unused functions, variables, sign compare issues, and addresses some -Warning flags which are now enabled including -Wcast-qual. Not all the warning flags in LibompHandleFlags.cmake are enabled, but some are with this patch. Some __kmp_gtid_from_* macros in kmp.h are switched to static inline functions which allows us to remove the awkward definition of KMP_DEBUG_ASSERT() and KMP_ASSERT() macros which used the comma operator. This had to be done for the innumerable -Wunused-value warnings related to KMP_DEBUG_ASSERT() Differential Revision: https://reviews.llvm.org/D49105 llvm-svn: 339393
* [OpenMP] Fix doacross testing for gccJonathan Peyton2018-08-022-0/+66
| | | | | | | | | | This patch adds a test using the doacross clauses in OpenMP and removes gcc from testing kmp_doacross_check.c which is only testing the kmp rather than the gomp interface. Differential Revision: https://reviews.llvm.org/D50014 llvm-svn: 338757
* [OMPT] Disable by default on WindowsJonas Hahnfeld2018-08-021-1/+1
| | | | | | | | | | This is broken per PR36561 and PR36574, so disable it for now until somebody interested can take a look. OMPT can still be activated manually by passing -DLIBOMP_OMPT_SUPPORT=ON during configuration. Differential Revision: https://reviews.llvm.org/D50086 llvm-svn: 338721
* [tests] Add annotations for taskloop featuresJonas Hahnfeld2018-08-023-0/+16
| | | | | | | | | Only supported since GCC 6 and Intel 17.0. However GCC 6.3.0 is crashing on two of the tests, so disable them as well... Differential Revision: https://reviews.llvm.org/D50085 llvm-svn: 338720
* [OMPT,tests] Fix taskloop testcase scheduling effectsJoachim Protze2018-08-011-10/+23
| | | | | | | | | | | | | | | | | | The taskloop testcase had scheduling effects. Tasks of the taskloop would sometimes be scheduled before all task were created. The testing is now split into two phases. First, the task creation on the master is tested, than the scheduling events of the tasks are tested. Thus, the order of creation and scheduling events is irrelavant. Patch by Simon Convent Reviewed by: protze.joachim, Hahnfeld Subscribers: openmp-commits Differential Revision: https://reviews.llvm.org/D50140 llvm-svn: 338580
* [test] Convert test for PR36720 to c89Jonas Hahnfeld2018-08-011-2/+4
| | | | | | | | | GCC 4.8.5 defaults to this old C standard. I think we should make the tests pass a newer -std=c99|c11 but that's too intrusive for now... Differential Revision: https://reviews.llvm.org/D50084 llvm-svn: 338490
* [OpenMP] Fix tasking + parallel bugJonathan Peyton2018-07-302-0/+37
| | | | | | | | | | | | From the bug report, the runtime needs to initialize the nproc variables (inside middle init) for each root when the task is encountered, otherwise, a segfault can occur. Bugzilla: https://bugs.llvm.org/show_bug.cgi?id=36720 Differential Revision: https://reviews.llvm.org/D49996 llvm-svn: 338313
* [OpenMP] Fix new task creationGheorghe-Teodor Bercea2018-07-301-1/+1
| | | | | | | | | | | | | | | | Summary: When OMPT is not supported the __kmp_omp_task() function is passed the parameters in the wrong order. This is a fix related to patch D47709. Reviewers: Hahnfeld, sconvent, caomhin, jlpeyton Reviewed By: Hahnfeld Subscribers: guansong, openmp-commits Differential Revision: https://reviews.llvm.org/D50001 llvm-svn: 338295
* [CMake] Disable -Wstringop-overflowJonas Hahnfeld2018-07-302-0/+2
| | | | | | | | | | | | | | | | | | | | | | | GCC 8 produces false-positives with this: In file included from <openmp>/src/runtime/src/kmp_os.h:950, from <openmp>/src/runtime/src/kmp.h:78, from <openmp>/src/runtime/src/kmp_environment.cpp:54: <openmp>/src/runtime/src/kmp_environment.cpp: In function ‘char* __kmp_env_get(const char*)’: <openmp>/src/runtime/src/kmp_safe_c_api.h:52:50: warning: ‘char* strncpy(char*, const char*, size_t)’ specified bound depends on the length of the source argument [-Wstringop-overflow=] #define KMP_STRNCPY_S(dst, bsz, src, cnt) strncpy(dst, src, cnt) ~~~~~~~^~~~~~~~~~~~~~~ <openmp>/src/runtime/src/kmp_environment.cpp:97:5: note: in expansion of macro ‘KMP_STRNCPY_S’ KMP_STRNCPY_S(result, len, value, len); ^~~~~~~~~~~~~ <openmp>/src/runtime/src/kmp_environment.cpp:92:28: note: length computed here size_t len = KMP_STRLEN(value) + 1; This is stupid because result is allocated with KMP_INTERNAL_MALLOC(len), so the arguments are correct. Differential Revision: https://reviews.llvm.org/D49904 llvm-svn: 338283
* [OpenMP] Add GOMP version symbols for OMP_4.5 APIJonathan Peyton2018-07-302-7/+18
| | | | | | | | This patch adds the appropriate version symbols to the relevant API functions Differential Revision: https://reviews.llvm.org/D49859 llvm-svn: 338281
* [OpenMP] Implement GOMP doacross compatibilityJonathan Peyton2018-07-305-62/+424
| | | | | | | | | | | | | | | | | | | | | | This change introduces GOMP doacross compatibility. There are 12 new interface functions 6 for long type and 6 for unsigned long long type: GOMP_doacross_post, GOMP_doacross_wait, GOMP_loop_doacross_[schedule]_start where schedule can be static, dynamic, guided, or runtime. These functions just translate the parameters if necessary and send them to the corresponding kmp function. E.g., GOMP_doacross_post() -> __kmpc_doacross_post() For the GOMP_doacross_post function, there is template specialization to account for when long is a four byte vs an eight byte type. If it is a four byte type, then a temporary array has to be created to convert the four byte integers into eight byte integers and then sending that into __kmpc_doacross_post(). Because GOMP_doacross_wait uses varargs, it always needs a temporary array and does not need template specialization. Differential Revision: https://reviews.llvm.org/D49857 llvm-svn: 338280
* [OpenMP] Fix build errors when building with KMP_DEBUG_ADAPTIVE_LOCKS=1Jonathan Peyton2018-07-304-14/+15
| | | | | | | | | | | | | This change fixes build errors when building a runtime with adaptive lock stats enabled. Most of the errors were due to the recent changes in the runtime, but it seems that we have not tried to build this debug runtime on Windows for a long time. Patch by Hansang Bae Differential Revision: https://reviews.llvm.org/D49823 llvm-svn: 338277
* [OpenMP][Stats] Cleanup stats gathering codeJonathan Peyton2018-07-308-303/+609
| | | | | | | | | | | | | | | | | | | | | | 1) Remove unnecessary data from list node structure 2) Remove timerPair in favor of pushing/popping explicitTimers. This way, nested timers will work properly. 3) Fix #pragma omp critical timers 4) Add histogram capability 5) Add KMP_STATS_FILE formatting capability 6) Have time partitioned into serial & parallel by introducing partitionedTimers::exchange(). This also counts the number of serial regions in the executable. 7) Fix up the timers around OMP loops so that scheduling overhead and work are both counted correctly. 8) Fix up the iterations statistics so they count the number of iterations the thread receives at each loop scheduling event 9) Change timers so there is only one RDTSC read per event change 10) Fix up the outdated comments for the timers Differential Revision: https://reviews.llvm.org/D49699 llvm-svn: 338276
* [OMPT] Fix OMPT callbacks for the taskloop construct and add testcaseJoachim Protze2018-07-272-61/+232
| | | | | | | | | | | | | | | | | Fix the order of callbacks related to the taskloop construct. Add the iteration_count to work callbacks (according to the spec). Use kmpc_omp_task() instead of kmp_omp_task() to include OMPT callbacks. Add a testcase. Patch by Simon Convent Reviewed by: protze.joachim, hbae Subscribers: openmp-commits Differential Revision: https://reviews.llvm.org/D47709 llvm-svn: 338146
* [OMPT] Adapt OMPT callbacks for tasks to handle untied tasks correctlyJoachim Protze2018-07-272-52/+93
| | | | | | | | | | | | | | | | | | | | | | The ompt/tasks/task_types.c testcase did not test untied tasks properly. Now, frame addresses are tested and two scheduling points are added at which the task can switch to another thread. Due to scheduling effects, the frame address could be NULL. This needed a restructure of the way OMPT callbacks are called. __ompt_task_finish() now as an extra parameter, whether a task is completed. Its invocation has been moved into __kmp_task_finish(). Thus, the order of the writes to the frame addresses is not subject to scheduling effects anymore. Patch by Simon Convent Reviewed by: protze.joachim, hbae Subscribers: openmp-commits Differential Revision: https://reviews.llvm.org/D49181 llvm-svn: 338145
* [OMPT] Print two more addresses in print_fuzzy_address_block()Joachim Protze2018-07-271-5/+8
| | | | | | | | | | | | | | The two more outputs are needed to match the return addresses when using the Intel Compiler, as it generates more instructions between the fuzzy-printing of the address and the runtime call. Patch by Simon Convent Reviewed By: protze.joachim, hbae Differential Revision: https://reviews.llvm.org/D49373 llvm-svn: 338144
* PR30734: Remove __kmp_ft_page_allocate()Jonas Hahnfeld2018-07-262-36/+0
| | | | | | | | | | | | | This function was not enabled by default and not exported when manually tweaking the build flags. Additionally it was hard to use since there is no corresponding __kmp_ft_page_free(). The code itself is questionable because the returned memory address is padded by an extra pointer which stores the unpadded start of the allocated region (this would need to be freed). Differential Revision: https://reviews.llvm.org/D49802 llvm-svn: 338052
* [test] Remove XFAIL of omp_for_bigbounds.c for Intel CompilerJonas Hahnfeld2018-07-261-1/+4
| | | | | | | | | The initial commit said that the test passes with Intel Compiler, so change XFAIL to only list clang and gcc. Differential Revision: https://reviews.llvm.org/D49801 llvm-svn: 338051
* [OMPT] Fix typo in test parallel/nested_thread_num.cJonas Hahnfeld2018-07-251-1/+1
| | | | | | | This caused test failures with GCC since its initial commit in r336085 (https://reviews.llvm.org/D46533). llvm-svn: 337911
* Block library shutdown until unreaped threads finish spin-waitingJonathan Peyton2018-07-194-11/+61
| | | | | | | | | | | | | | | | This change fixes possibly invalid access to the internal data structure during library shutdown. In a heavily oversubscribed situation, the library shutdown sequence can reach the point where resources are deallocated while there still exist threads in their final spinning loop. The added loop in __kmp_internal_end() checks if there are such busy-waiting threads and blocks the shutdown sequence if that is the case. Two versions of kmp_wait_template() are now used to minimize performance impact. Patch by Hansang Bae Differential Revision: https://reviews.llvm.org/D49452 llvm-svn: 337486
* Fix const cast problem introduced in r336563Jonathan Peyton2018-07-091-3/+3
| | | | | | 336563 eliminated CCAST() macros caused build failures llvm-svn: 336586
* [OpenMP] Fix a few formatting issuesJonathan Peyton2018-07-093-3/+5
| | | | llvm-svn: 336575
* [OpenMP] Introduce hierarchical schedulingJonathan Peyton2018-07-0911-56/+1522
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch introduces the logic implementing hierarchical scheduling. First and foremost, hierarchical scheduling is off by default To enable, use -DLIBOMP_USE_HIER_SCHED=On during CMake's configure stage. This work is based off if the IWOMP paper: "Workstealing and Nested Parallelism in SMP Systems" Hierarchical scheduling is the layering of OpenMP schedules for different layers of the memory hierarchy. One can have multiple layers between the threads and the global iterations space. The threads will go up the hierarchy to grab iterations, using possibly a different schedule & chunk for each layer. [ Global iteration space (0-999) ] (use static) [ L1 | L1 | L1 | L1 ] (use dynamic,1) [ T0 T1 | T2 T3 | T4 T5 | T6 T7 ] In the example shown above, there are 8 threads and 4 L1 caches begin targeted. If the topology indicates that there are two threads per core, then two consecutive threads will share the data of one L1 cache unit. This example would have the iteration space (0-999) split statically across the four L1 caches (so the first L1 would get (0-249), the second would get (250-499), etc). Then the threads will use a dynamic,1 schedule to grab iterations from the L1 cache units. There are currently four supported layers: L1, L2, L3, NUMA OMP_SCHEDULE can now read a hierarchical schedule with this syntax: OMP_SCHEDULE='EXPERIMENTAL LAYER,SCHED[,CHUNK][:LAYER,SCHED[,CHUNK]...]:SCHED,CHUNK And OMP_SCHEDULE can still read the normal SCHED,CHUNK syntax from before I've kept most of the hierarchical scheduling logic inside kmp_dispatch_hier.h to try to keep it separate from the rest of the code. Differential Revision: https://reviews.llvm.org/D47962 llvm-svn: 336571
OpenPOWER on IntegriCloud