Skip to content

@batch loops freeze completely on Apple M2 Pro with Julia x86 (Rosetta) #126

@efaulhaber

Description

@efaulhaber

Because of the problems with ARM (#88 and #89) I wanted to give Julia x86 with Rosetta a shot.
Unfortunately, @batch doesn't really work at all for me there:

julia> @btime @batch for _ in 1:1000 end
  1.258 μs (0 allocations: 0 bytes)

julia> @btime @batch for _ in 1:1000 end

It just freezes there forever and doesn't react to Ctrl + C. CPU load goes down to a constant 100%.

I can't reproduce this by just putting @batch for _ in 1:1000 end into a plain for loop, so there must be something that BenchmarkTools is doing to trigger this bug. But it's not just BenchmarkTools. I can't run any multithreaded simulations with our simulation code: trixi-framework/Trixi.jl#1724

julia> versioninfo()
Julia Version 1.9.3
Commit bed2cd540a1 (2023-08-24 14:43 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: macOS (x86_64-apple-darwin22.4.0)
  CPU: 10 × Apple M2 Pro
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-14.0.6 (ORCJIT, westmere)
  Threads: 10 on 10 virtual cores
Environment:
  JULIA_EDITOR = code

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions