Skip to content
  1. Nov 25, 2017
  2. Nov 22, 2017
  3. Nov 20, 2017
  4. Nov 17, 2017
    • Jonas Hahnfeld's avatar
      [OMPT] Fix inaccuracies in worksharing tests · 0924094e
      Jonas Hahnfeld authored
      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
      0924094e
  5. Nov 16, 2017
  6. Nov 11, 2017
    • Jonas Hahnfeld's avatar
      [OMPT] Provide initialization for Mac OS X · d0ef19ef
      Jonas Hahnfeld authored
      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
      d0ef19ef
  7. Nov 10, 2017
  8. Nov 09, 2017
    • Jonas Hahnfeld's avatar
      Add const to some variables to avoid const_casts · e9b7c0a3
      Jonas Hahnfeld authored
      In these places the const attribute seems correct and doesn't
      need any other change, so let's do it.
      
      Differential Revision: https://reviews.llvm.org/D39756
      
      llvm-svn: 317798
      e9b7c0a3
    • Jonas Hahnfeld's avatar
      Remove const from variables with dynamic memory · aeb40ada
      Jonas Hahnfeld authored
      Allocated memory is typically not 'const' if it needs to be freed.
      This patch removes around 50 wrong const attributes, modifies the
      corresponding functions and finally gets rid of some const_casts.
      These have especially been strange for __kmp_str_fname_free() that
      added a 'const' to call __kmp_str_free() which removed it again.
      
      Two minor cleanups that I performed in this process:
       * __kmp_tool_libraries now lives in kmp_settings.cpp as it is
         used nowhere else.
       * __kmp_msg_empty was removed as it was never used and Clang
         now complained that it was assigned a string literal that
         is 'const char *'.
      
      Differential Revision: https://reviews.llvm.org/D39755
      
      llvm-svn: 317797
      aeb40ada
    • Jonas Hahnfeld's avatar
      [OMPT] Fix test cancel_parallel.c · c6030033
      Jonas Hahnfeld authored
      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
      c6030033
    • Jonas Hahnfeld's avatar
      [OMPT] Add support for testing return addresses on POWER · 380346fc
      Jonas Hahnfeld authored
      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
      380346fc
  9. Nov 08, 2017
  10. Nov 06, 2017
  11. Nov 05, 2017
  12. Nov 03, 2017
  13. Nov 01, 2017
    • Jonathan Peyton's avatar
      [OpenMP] Fix race condition in omp_init_lock · 3d18a37c
      Jonathan Peyton authored
      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
      3d18a37c
    • Joachim Protze's avatar
      Update implementation of OMPT to the specification OpenMP 5.0 Preview 1 (TR4). · 82e94a59
      Joachim Protze authored
      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
      82e94a59
  14. Oct 26, 2017
    • Jonathan Peyton's avatar
      Fix fatal error message displaying · 5e6cb902
      Jonathan Peyton authored
      Replacing call to __kmp_msg(kmp_ms_fatal,...) with __kmp_fatal(...) caused an
      issue when incomplete message is displayed in case an error message is followed
      by another message (e.g. by a hint messa)ge. This is because __kmp_fatal()
      passes incomplete list of arguments to __kmp_msg().
      
      Patch by Olga Malysheva
      
      Differential Revision: https://reviews.llvm.org/D39248
      
      llvm-svn: 316623
      5e6cb902
  15. Oct 24, 2017
    • Jonathan Peyton's avatar
      Disable threadprivate data cleanup if runtime is terminating · dff0ee2f
      Jonathan Peyton authored
      The problem is due to the runtime's threadprivate cleanup code which tries to
      access data that was already destroyed by one of the root threads.
      __kmp_init_gtid is used as a checker here since it is set to false before actual
      resource cleanup is done in __kmp_cleanup().
      
      Patch by Hansang Bae
      
      llvm-svn: 316452
      dff0ee2f
  16. Oct 20, 2017
  17. Oct 06, 2017
    • Jonathan Peyton's avatar
      KMP_HW_SUBSET vs KMP_PLACE_THREADS rival envirables fix · 3f850bfc
      Jonathan Peyton authored
      If both KMP_HW_SUBSET and KMP_PLACE_THREADS are set and KMP_PLACE_THREADS gets
      parsed first, then the current environment variable parser rejects both and
      neither get used. This patch uses the rivals mechanism that is used for other
      environment variable groups (e.g., KMP_STACKSIZE, GOMP_STACKSIZE, OMP_STACKSIZE).
      If both are set, then it tells the user that it is ignoring KMP_PLACE_THREADS in
      favor of KMP_HW_SUBSET. The message about deprecating KMP_PLACE_THREADS when it
      is set is still printed regardless.
      
      Differential Revision: https://reviews.llvm.org/D38292
      
      llvm-svn: 315091
      3f850bfc
  18. Sep 29, 2017
  19. Sep 27, 2017
    • Jonathan Peyton's avatar
      Remove unnecessary semicolons · bd3a7633
      Jonathan Peyton authored
      Removes semicolons after if {} blocks, function definitions, etc.
      I was able to apply the large OMPT patch cleanly on top of this one
      with no conflicts.
      
      llvm-svn: 314340
      bd3a7633
  20. Sep 26, 2017
  21. Sep 05, 2017
  22. Aug 20, 2017
  23. Aug 17, 2017
  24. Aug 11, 2017
Loading