Skip to content
  1. Nov 28, 2016
  2. Nov 14, 2016
    • Jonathan Peyton's avatar
      Introduce dynamic affinity dispatch capabilities · 1cdd87ad
      Jonathan Peyton authored
      This set of changes enables the affinity interface (Either the preexisting
      native operating system or HWLOC) to be dynamically set at runtime
      initialization. The point of this change is that we were seeing performance
      degradations when using HWLOC. This allows the user to use the old affinity
      mechanisms which on large machines (>64 cores) makes a large difference in
      initialization time.
      
      These changes mostly move affinity code under a small class hierarchy:
      
      KMPAffinity
        class Mask {}
      KMPNativeAffinity : public KMPAffinity
        class Mask : public KMPAffinity::Mask
      KMPHwlocAffinity
        class Mask : public KMPAffinity::Mask
      
      Since all interface functions (for both affinity and the mask implementation)
      are virtual, the implementation can be chosen at runtime initialization.
      
      Differential Revision: https://reviews.llvm.org/D26356
      
      llvm-svn: 286890
      1cdd87ad
  3. Oct 07, 2016
  4. Sep 27, 2016
    • Jonathan Peyton's avatar
      Disable monitor thread creation by default. · b66d1aab
      Jonathan Peyton authored
      This change set disables creation of the monitor thread by default.  The global
      counter maintained by the monitor thread was replaced by logic that uses system
      time directly, and cyclic yielding on Linux target was also removed since there
      was no clear benefit of using it. Turning on KMP_USE_MONITOR variable (=1)
      enables creation of monitor thread again if it is really necessary for some
      reasons.
      
      Differential Revision: https://reviews.llvm.org/D24739
      
      llvm-svn: 282507
      b66d1aab
  5. Sep 09, 2016
  6. Jul 11, 2016
  7. Jun 16, 2016
    • Jonathan Peyton's avatar
      Deprecate KMP_PLACE_THREADS and rename as KMP_HW_SUBSET · b9d28fbe
      Jonathan Peyton authored
      Deprecate KMP_PLACE_THREADS and rename it to KMP_HW_SUBSET due to confusion
      about its purpose and function among users.  KMP_HW_SUBSET is an environment
      variable which allows users to easily pick a subset of the hardware topology to
      use.  e.g., KMP_HW_SUBSET=30c,2t means use 30 cores, 2 threads per core.
      
      Patch by Andrey Churbanov
      
      Differential Revision: http://reviews.llvm.org/D21340
      
      llvm-svn: 272937
      b9d28fbe
  8. 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
  9. Jun 13, 2016
    • Jonathan Peyton's avatar
      Hwloc refactoring patch · 202a24dd
      Jonathan Peyton authored
      These changes remove the hwloc_topology_ignore_type function which doesn't exist
      in the hwloc 2.0 API. In the existing code, the topology extracted from hwloc
      has the cache levels stripped out and then assumes the final stripped topology
      follows the typical three-level topology: packages -> cores -> HW threads.
      But the code is doing unclean manipulations to determine at what level those
      resources are located and also assumes too much about what hwloc is detecting
      (there could be intermediate levels in between socket and core for instance).
      This new way of extracting the topology doesn't strip out any hardware objects
      that hwloc detects. It does not assume the three level topology, and instead
      searches for the relevant three levels within the topology for each bit of
      information using hwloc interface functions. i.e., the three level topology
      subset that our affinity code is interested in is extracted from the hwloc
      topology tree directly.
      
      For example, the new __kmp_hwloc_get_nobjs_under_obj function gives the user the
      number of cores under a socket reliably without worrying if there are unexpected
      objects between the socket object and core object in the hwloc topology
      structure. Also, now that all topology information is kept, there are also
      possibilities of using the caches/numa nodes to determine more sophisticated
      affinity settings in the future.
      
      There is also some cleanup code added for the destruction of the
      __kmp_hwloc_topology object.
      
      Differential Revision: http://reviews.llvm.org/D21195
      
      llvm-svn: 272565
      202a24dd
  10. May 31, 2016
    • Jonathan Peyton's avatar
      Offer API for setting number of loop dispatch buffers · 067325f9
      Jonathan Peyton authored
      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
      067325f9
  11. May 16, 2016
    • Paul Osmialowski's avatar
      Clean all the mess around KMP_USE_FUTEX and kmp_lock.h · fb043fdf
      Paul Osmialowski authored
      KMP_USE_FUTEX preprocessor definition defined in kmp_lock.h is used
      inconsequently throughout LLVM libomp code.
      
      * some .c files that use this define do not include kmp_lock.h file,
        in effect guarded part of code are never compiled
      * some places in code use architecture-depending preprocessor
        logic expressions which effectively disable use of Futex for
        AArch64 architecture, all these places should use
        '#if KMP_USE_FUTEX' instead to avoid any further confusions
      * some places use KMP_HAS_FUTEX which is nowhere defined,
        KMP_USE_FUTEX should be used instead
      
      Differential Revision: http://reviews.llvm.org/D19629
      
      llvm-svn: 269642
      fb043fdf
  12. May 13, 2016
  13. May 12, 2016
  14. Apr 14, 2016
    • Jonathan Peyton's avatar
      Exponential back off logic for test-and-set lock · 377aa40d
      Jonathan Peyton authored
      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
      377aa40d
  15. Apr 04, 2016
    • Jonathan Peyton's avatar
      OMP_WAIT_POLICY changes · 50e8f18b
      Jonathan Peyton authored
      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
      50e8f18b
  16. Feb 25, 2016
  17. Jan 27, 2016
  18. Jan 26, 2016
  19. Dec 11, 2015
    • Jonathan Peyton's avatar
      Hinted lock (OpenMP 4.5 feature) Updates/Fixes Part 2 · dae13d81
      Jonathan Peyton authored
      * 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
      dae13d81
  20. Dec 03, 2015
  21. 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
  22. Nov 04, 2015
  23. Oct 20, 2015
  24. Oct 08, 2015
    • Jonathan Peyton's avatar
      Added sockets to the syntax of KMP_PLACE_THREADS environment variable. · dd4aa9b6
      Jonathan Peyton authored
      Added (optional) sockets to the syntax of the KMP_PLACE_THREADS environment variable.
      Some limitations:
      * The number of sockets and then optional offset should be specified first (before other parameters).
      * The letter designation is mandatory for sockets and then for other parameters.
      * If number of cores is specified first, then the number of sockets is defaulted to all sockets on the machine; also, the old syntax is partially supported if sockets are skipped.
      * If number of threads per core is specified first, then the number of sockets and cores per socket are defaulted to all sockets and all cores per socket respectively.
      * The number of cores per socket cannot be specified before sockets or after threads per core.
      * The number of threads per core can be specified before or after core-offset (old syntax required it to be before core-offset);
      * Parameters delimiter can be: empty, comma, lower-case x;
      * Spaces are allowed around numbers, around letters, around delimiter.
      Approximate shorthand specification:
      KMP_PLACE_THREADS="[num_sockets(S|s)[[delim]offset(O|o)][delim]][num_cores_per_socket(C|c)[[delim]offset(O|o)][delim]][num_threads_per_core(T|t)]"
      
      Differential Revision: http://reviews.llvm.org/D13175
      
      llvm-svn: 249708
      dd4aa9b6
  25. Sep 21, 2015
  26. Jun 08, 2015
  27. Apr 02, 2015
  28. Mar 10, 2015
  29. Feb 20, 2015
  30. Jan 29, 2015
  31. Jan 27, 2015
Loading