Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

synchronization/mutex_benchmark fails on macOS #147

Closed
siedentop opened this issue Jul 22, 2018 · 2 comments
Closed

synchronization/mutex_benchmark fails on macOS #147

siedentop opened this issue Jul 22, 2018 · 2 comments
Assignees

Comments

@siedentop
Copy link

I am trying to build and run tests on macOS. The test //absl/synchronization:mutex_benchmark fails with the log below.

Changing kMaxConditionWaiters = 8192; in mutex_benchmark.cc to 2048 makes the test pass.

  • Log:
exec ${PAGER:-/usr/bin/less} "$0" || exit 1
Executing tests from //absl/synchronization:mutex_benchmark
-----------------------------------------------------------------------------
2018-07-22 03:11:35
Running /private/var/tmp/_bazel_user/d6d010710c9a9ecbd01cc5bc4d829501/sandbox/darwin-sandbox/1/execroot/com_google_absl/bazel-out/darwin-fastbuild/bin/absl/synchronization/mutex_benchmark.runfiles/com_google_absl/absl/synchronization/mutex_benchmark
Run on (8 X 3100 MHz CPU s)
CPU Caches:
  L1 Data 32K (x4)
  L1 Instruction 32K (x4)
  L2 Unified 262K (x4)
  L3 Unified 8388K (x1)
***WARNING*** Library was built as DEBUG. Timings may be affected.
-------------------------------------------------------------------
Benchmark                            Time           CPU Iterations
-------------------------------------------------------------------
BM_ConditionWaiters/0/1            280 ns        279 ns    2387709
BM_ConditionWaiters/1/1            284 ns        284 ns    2415351
BM_ConditionWaiters/2/1            311 ns        309 ns    2022975
BM_ConditionWaiters/0/8            440 ns        439 ns    1571004
BM_ConditionWaiters/1/8            273 ns        273 ns    2507496
BM_ConditionWaiters/2/8            295 ns        295 ns    2381592
BM_ConditionWaiters/0/64          2087 ns       2085 ns     323176
BM_ConditionWaiters/1/64           276 ns        276 ns    2436622
BM_ConditionWaiters/2/64          1835 ns       1833 ns    1000000
BM_ConditionWaiters/0/512        18128 ns      18119 ns      38056
BM_ConditionWaiters/1/512          273 ns        272 ns    2560435
BM_ConditionWaiters/2/512        15051 ns      15042 ns     111131
libc++abi.dylib: terminating with uncaught exception of type std::__1::system_error: thread constructor failed: Resource temporarily unavailable
Abort trap: 6
  • macOS version:
❯ system_profiler SPSoftwareDataType
Software:

    System Software Overview:

      System Version: macOS 10.13.5 (17F77)
      Kernel Version: Darwin 17.6.0
      Boot Volume: Macintosh HD
      Boot Mode: Normal
      Computer Name: ...
      User Name: ...
      Secure Virtual Memory: Enabled
      System Integrity Protection: Enabled
      Time since boot: ...
  • Abseil version: 44aa275
  • Compiler version: Could not figure out how to query bazel to show me this.
@derekmauro derekmauro self-assigned this Jul 23, 2018
absl-federation-github pushed a commit that referenced this issue Jul 24, 2018
--
ee644a89fb1429d9337852690a01182853f68964 by Derek Mauro <dmauro@google.com>:

Lower the thread limit in the Mutex benchmark on some platforms.
#147

PiperOrigin-RevId: 205663768
GitOrigin-RevId: ee644a89fb1429d9337852690a01182853f68964
Change-Id: Ic5db4061809aa65f73e6a63dba90b2554376b38c
@derekmauro
Copy link
Member

I lowered the thread limit on some platforms in 9e06068. Note that this is really a benchmark and not a test, and benchmarks may depend on OS details and hardware specs. The benchmark targets should arguably be cc_binary instead of cc_test, but we went with cc_test for ease of testing. You could also pass --test_tag_filters=-benchmark to bazel test if you don't want to run the benchmarks.

@siedentop
Copy link
Author

Thanks for the quick turnaround!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants