Skip to content
Snippets Groups Projects
  1. Aug 02, 2018
  2. Jul 09, 2018
    • Jonathan Peyton's avatar
      [OpenMP] Introduce hierarchical scheduling · f6399367
      Jonathan Peyton authored
      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
      f6399367
  3. Jan 02, 2018
  4. Nov 29, 2017
  5. Nov 03, 2017
  6. Nov 01, 2017
  7. Oct 20, 2017
  8. Aug 02, 2017
  9. Jul 28, 2017
  10. Mar 31, 2017
  11. Mar 06, 2017
    • Jonathan Peyton's avatar
      OpenMP version 5.0 added · e844a54a
      Jonathan Peyton authored
      Add build option LIBOMP_OMP_VERSION=50, 5.0 headers, and add the year/month
      associated with OpenMP 5.0 in relevant source locations. Also, remove the
      deprecated LIBOMP_OMP_VERSION=41 option.
      
      Patch by Olga Malysheva
      
      Differential Revision: https://reviews.llvm.org/D30450
      
      llvm-svn: 297083
      e844a54a
  12. Jan 04, 2017
  13. Dec 14, 2016
  14. Dec 08, 2016
  15. Nov 07, 2016
    • Jonas Hahnfeld's avatar
      [OpenMP] Enable ThreadSanitizer to check OpenMP programs · 50fed047
      Jonas Hahnfeld authored
      This patch allows ThreadSanitizer (Tsan) to verify OpenMP programs.
      It means that no false positive will be reported by Tsan when
      verifying an OpenMP programs.
      This patch introduces annotations within the OpenMP runtime module to
      provide information about thread synchronization to the Tsan runtime.
      
      In order to enable the Tsan support when building the runtime, you must
      enable the TSAN_SUPPORT option with the following environment variable:
      
      -DLIBOMP_TSAN_SUPPORT=TRUE
      
      The annotations will be enabled in the main shared library
      (same mechanism of OMPT).
      
      Patch by Simone Atzeni and Joachim Protze!
      
      Differential Revision: https://reviews.llvm.org/D13072
      
      llvm-svn: 286115
      50fed047
  16. Sep 30, 2016
  17. Sep 14, 2016
  18. Sep 09, 2016
  19. Jun 14, 2016
    • Jonathan Peyton's avatar
      Renaming change: 41 -> 45 and 4.1 -> 4.5 · df6818be
      Jonathan Peyton authored
      OpenMP 4.1 is now OpenMP 4.5.  Any mention of 41 or 4.1 is replaced with
      45 or 4.5.  Also, if the CMake option LIBOMP_OMP_VERSION is 41, CMake warns that
      41 is deprecated and to use 45 instead.
      
      llvm-svn: 272687
      df6818be
  20. May 26, 2016
  21. May 17, 2016
  22. Feb 09, 2016
  23. Feb 04, 2016
    • Jonathan Peyton's avatar
      Add LIBOMP_ENABLE_SHARED option for CMake · fd74f900
      Jonathan Peyton authored
      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
      fd74f900
  24. Dec 18, 2015
    • Jonathan Peyton's avatar
      [STATS] Have CMake do real check for stats functionality · b9e83260
      Jonathan Peyton authored
      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
      b9e83260
  25. Nov 30, 2015
    • Jonathan Peyton's avatar
      Adding Hwloc library option for affinity mechanism · 01dcf36b
      Jonathan Peyton authored
      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
      01dcf36b
  26. Nov 05, 2015
    • Jonathan Peyton's avatar
      Improve OMPT initialization code · 95246e7d
      Jonathan Peyton authored
      Use of #ifdef OMPT_DEBUG was causing messages to be generated under normal
      operation when the OpenMP library was compiled with KMP_DEBUG enabled.
      Elsewhere, KMP_DEBUG evaluates assertions, but never produces messages during
      normal operation. To avoid this inconsistency, set OMPT_DEBUG using a cmake
      variable LIBOMP_OMPT_DEBUG.
      
      While I was editing the associated ompt-specific.h and ompt-general.c files,
      make the spacing and comments consistent.
      
      Patch by John Mellor-Crummey
      
      Differential Revision: http://reviews.llvm.org/D14355
      
      llvm-svn: 252173
      95246e7d
  27. Oct 29, 2015
    • Jonathan Peyton's avatar
      [OMPT] Windows Support for OMPT · 69e596a5
      Jonathan Peyton authored
      The problem is that the ompt_tool() function (which must be implemented by a
      performance tool) should be defined in the RTL as well to cover the case when
      the tool is not present in the address space of the process. This functionality
      is accomplished with weak symbols in Unices. Unfortunately, Windows does not
      support weak symbols.
      
      The solution in these changes is to grab the list of all modules loaded by the
      process and then search for symbol "ompt_tool()" within them. The function
      ompt_tool_windows() performs the search of the ompt_tool symbol. If ompt_tool is
      found, then its return value is used to initialize the tool. If ompt_tool is not
      found, then ompt_tool_windows() returns NULL and OMPT is thus, disabled.
      
      While doing these changes, the OMPT_SUPPORT detection in CMake was changed to
      test for the required featuers for OMPT_SUPPORT, namely: builtin_frame_address()
      existence, weak attribute existence and psapi.dll existence. For
      LIBOMP_HAVE_OMPT_SUPPORT to be true, it must be that the builtin_frame_address()
      intrinsic exists AND one of: either weak attributes exist or psapi.dll exists.
      
      Also, since Process Status API is used I had to add new dependency -- psapi.dll
      to the library dependency micro test.
      
      Differential Revision: http://reviews.llvm.org/D14027
      
      llvm-svn: 251654
      69e596a5
  28. Sep 21, 2015
    • Jonathan Peyton's avatar
      OpenMP Initial testsuite change to purely llvm-lit based testing · 614c7ef8
      Jonathan Peyton authored
      This change introduces a check-libomp target which is based upon llvm's lit
      test infrastructure. Each test (generated from the University of Houston's
      OpenMP testsuite) is compiled and then run. For each test, an exit status of 0
      indicates success and non-zero indicates failure. This way, FileCheck is not
      needed. I've added a bit of logic to generate symlinks (libiomp5 and libgomp)
      in the build tree so that gcc can be tested as well.  When building out-of-
      tree builds, the user will have to provide llvm-lit either by specifying
      -DLIBOMP_LLVM_LIT_EXECUTABLE or having llvm-lit in their PATH.
      
      Differential Revision: http://reviews.llvm.org/D11821
      
      llvm-svn: 248211
      614c7ef8
  29. Aug 28, 2015
    • Jonathan Peyton's avatar
      [OpenMP] [CMake] Removing expand-vars.pl in favor of CMake's configure_file() · c0225ca2
      Jonathan Peyton authored
      Currently, the libomp CMake build system uses a Perl script to configure files
      (tools/expand-vars.pl). This patch replaces the use of the Perl script by using
      CMake's configure_file() function. The major changes include:
      1. *.var has every $KMP_* variable changed to @LIBOMP_*@
      2. kmp_config.h.cmake is a new file which contains all the feature macros and
         #cmakedefine lines
      3. Most of the -D lines have been moved from LibompDefinitions.cmake but some
         OS specific MACROs (e.g., _GNU_SOURCE) remain.
      4. All expand-vars.pl related logic is removed from the CMake files.
      
      One important note about this change is that it breaks the old Perl+Makefile
      build system because it can't create kmp_config.h properly.
      
      Differential Review: http://reviews.llvm.org/D12211
      
      llvm-svn: 246314
      c0225ca2
  30. Aug 11, 2015
    • Jonathan Peyton's avatar
      Tidy statistics collection · 45be4500
      Jonathan Peyton authored
      This removes some statistics counters and timers which were not used,
      adds new counters and timers for some language features that were not
      monitored previously and separates the counters and timers into those
      which are of interest for investigating user code and those which are
      only of interest to the developer of the runtime itself.
      The runtime developer statistics are now ony collected if the
      additional #define KMP_DEVELOPER_STATS is set.
      
      Additional user statistics which are now collected include:
      * Count of nested parallelism (omp parallel inside a parallel region)
      * Count of omp distribute occurrences
      * Count of omp teams occurrences
      * Counts of task related statistics (taskyield, task execution, task
        cancellation, task steal)
      * Values passed to omp_set_numtheads
      * Time spent in omp single and omp master
      
      None of this affects code compiled without stats gathering enabled,
      which is the normal library build mode.
      
      This also fixes the CMake build by linking to the standard c++ library
      when building the stats library as it is a requirement.  The normal library
      does not have this requirement and its link phase is left alone.
      
      Differential Revision: http://reviews.llvm.org/D11759
      
      llvm-svn: 244677
      45be4500
  31. Jul 18, 2015
    • Chandler Carruth's avatar
      [cmake] Support enabling -Werror in the OpenMP runtime CMake build and · 5145156a
      Chandler Carruth authored
      clean up the build.
      
      This disables all of the Clang warnings that fire for me when building
      libomp.so on Linux with a recent Clang binary. Lots of these should
      probably be fixed, but I want to at least get the build warning-clean
      and make it easy to keep that way.
      
      I also switched a bunch of the warnings that are used both for C and C++
      compiles to check the flag with C compilation test.
      
      Differential Revision: http://reviews.llvm.org/D11253
      
      llvm-svn: 242604
      5145156a
  32. Jul 15, 2015
    • Jonathan Peyton's avatar
      Re-indent the CMake refactor to two-space indention · 5b4acbd6
      Jonathan Peyton authored
      I apologize for this nasty commit, but I somehow overlooked Chandler's
      comment to re-indent these files to two space indention.  I know this
      is a horrible commit, but I figured if it was done quickly after the 
      first one, not too many conflicts would arise.
      
      Again, I'm sorry and won't do this again.
      
      llvm-svn: 242301
      5b4acbd6
    • Jonathan Peyton's avatar
      Large Refactor of CMake build system · 2e013352
      Jonathan Peyton authored
      This commit improves numerous functionalities of the OpenMP CMake build 
      system to be more conducive with LLVM's build system and build philosophies.
      The CMake build system, as it was before this commit, was not up to LLVM's 
      standards and did not implement the configuration stage like most CMake based
      build systems offer (check for compiler flags, libraries, etc.) In order to
      improve it dramatically in a short period of time, a large refactoring had 
      to be done.
      The main changes done with this commit are as follows:
      
      * Compiler flag checks - The flags are no longer grabbed from compiler specific
        directories.  They are checked for availability in config-ix.cmake and added
        accordingly inside LibompHandleFlags.cmake.
      * Feature checks were added in config-ix.cmake.  For example, the standard CMake
        module FindThreads is probed for the threading model to use inside the OpenMP
        library.
      * OS detection - There is no longer a LIBOMP_OS variable, OS-specifc build logic
        is wrapped around the WIN32 and APPLE macros with !(WIN32 OR APPLE) meaning 
        a Unix flavor of some sort.
      * Got rid of vestigial functions/macros/variables
      * Added new libomp_append() function which is used everywhere to conditionally
        or undconditionally append to a list
      * All targets have the libomp prefix so as not to interfere with any other
        project
      * LibompCheckLinkerFlag.cmake module was added which checks for linker flags
        specifically for building shared libraries.
      * LibompCheckFortranFlag.cmake module was added which checks for fortran flag
        availability.
      * Removed most of the cruft from the translation between the perl+Makefile based
        build system and this one.  The remaining components that they share are
        perl scripts which I'm in the process of removing.
      
      There is still more left to do.  The perl scripts still need to be removed, and
      a config.h.in file (or similarly named) needs to be added with #cmakedefine lines
      in it.  But this is a much better first step than the previous system.
      
      Differential Revision: http://reviews.llvm.org/D10656
      
      llvm-svn: 242298
      2e013352
  33. Jul 09, 2015
    • Jonathan Peyton's avatar
      Turn debugger interface off by default. · 3bbcb4d7
      Jonathan Peyton authored
      Just changed LIBOMP_USE_DEBUGGER to false.
      
      llvm-svn: 241852
      3bbcb4d7
    • Jonathan Peyton's avatar
      Enable debugger support · 8fbb49ab
      Jonathan Peyton authored
      These changes enable external debuggers to conveniently interface with 
      the LLVM OpenMP Library.  Structures are added which describe the important
      internal structures of the OpenMP Library e.g., teams, threads, etc.
      This feature is turned on by default (CMake variable LIBOMP_USE_DEBUGGER)
      and can be turned off with -DLIBOMP_USE_DEBUGGER=off.
      
      Differential Revision: http://reviews.llvm.org/D10038
      
      llvm-svn: 241832
      8fbb49ab
  34. Jun 17, 2015
  35. Jun 11, 2015
    • Jonathan Peyton's avatar
      Remove unused variables '__kmp_build_check_*' for non assert builds. · 9919dfc3
      Jonathan Peyton authored
      Add new LIBOMP_ENABLE_ASSERTIONS macro which can be set in a standalone build
      or takes the value of LLVM_ENABLE_ASSERTIONS when inside llvm/projects.  This
      change also defines the KMP_BUILD_ASSERT() macro to do nothing when ENABLE_ASSERTIONS
      is off.  This means the __kmp_build_check_* types won't be defined and thus, no warnings.
      http://lists.cs.uiuc.edu/pipermail/openmp-dev/2015-June/000719.html
      
      Patch by Jack Howarth and Jonathan Peyton
      
      llvm-svn: 239546
      9919dfc3
    • Jonathan Peyton's avatar
      Implement recursive CMake. · 5215890c
      Jonathan Peyton authored
      Most CMake build systems put CMakeLists.txt files inside source directories where 
      items need to get built. This change follows that convention by adding a new 
      runtime/src/CMakeLists.txt file. An additional benefit is this helps logically 
      seperate configuring with building as well. This change is mostly just copying and 
      pasting the bottom half of runtime/CMakeLists.txt into runtime/src/CMakeLists.txt, 
      but a few changes had to be made to get it to work. Most of those changes were to 
      directory prefixes.
      
      Differential Revision: http://reviews.llvm.org/D10344
      
      llvm-svn: 239542
      5215890c
Loading