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

Simulations using multiple threads freeze on Apple M2 Pro with Julia x86 (Rosetta) #1724

Open
efaulhaber opened this issue Nov 9, 2023 · 2 comments
Labels
bug Something isn't working upstream

Comments

@efaulhaber
Copy link
Member

efaulhaber commented Nov 9, 2023

julia> using Trixi

julia> trixi_include("examples/tree_2d_dgsem/elixir_advection_extended.jl", tspan=(0.0, 1000.0), analysis_interval=5000, interval=5000);
[ Info: You just called `trixi_include`. Julia may now compile the code, please be patient.
Intel MKL WARNING: Support of Intel(R) Streaming SIMD Extensions 4.2 (Intel(R) SSE4.2) enabled only processors has been deprecated. Intel oneAPI Math Kernel Library 2025.0 will require Intel(R) Advanced Vector Extensions (Intel(R) AVX) instructions.

████████╗██████╗ ██╗██╗  ██╗██╗
╚══██╔══╝██╔══██╗██║╚██╗██╔╝██║
   ██║   ██████╔╝██║ ╚███╔╝ ██║
   ██║   ██╔══██╗██║ ██╔██╗ ██║
   ██║   ██║  ██║██║██╔╝ ██╗██║
   ╚═╝   ╚═╝  ╚═╝╚═╝╚═╝  ╚═╝╚═╝

┌──────────────────────────────────────────────────────────────────────────────────────────────────┐
│ SemidiscretizationHyperbolic                                                                     │
│ ════════════════════════════                                                                     │
│ #spatial dimensions: ………………………… 2                                                                │
│ mesh: ………………………………………………………………… TreeMesh{2, Trixi.SerialTree{2}} with length 341                 │
│ equations: …………………………………………………… LinearScalarAdvectionEquation2D                                  │
│ initial condition: ……………………………… initial_condition_convergence_test                               │
│ boundary conditions: ………………………… Trixi.BoundaryConditionPeriodic                                  │
│ source terms: …………………………………………… nothing                                                          │
│ solver: …………………………………………………………… DG                                                               │
│ total #DOFs per field: …………………… 4096                                                             │
└──────────────────────────────────────────────────────────────────────────────────────────────────┘

┌──────────────────────────────────────────────────────────────────────────────────────────────────┐
│ TreeMesh{2, Trixi.SerialTree{2}}                                                                 │
│ ════════════════════════════════                                                                 │
│ center: …………………………………………………………… [0.0, 0.0]                                                       │
│ length: …………………………………………………………… 2.0                                                              │
│ periodicity: ……………………………………………… (true, true)                                                     │
│ current #cells: ……………………………………… 341                                                              │
│ #leaf-cells: ……………………………………………… 256                                                              │
│ maximum #cells: ……………………………………… 30000                                                            │
└──────────────────────────────────────────────────────────────────────────────────────────────────┘

┌──────────────────────────────────────────────────────────────────────────────────────────────────┐
│ LinearScalarAdvectionEquation2D                                                                  │
│ ═══════════════════════════════                                                                  │
│ #variables: ………………………………………………… 1                                                                │
│ │ variable 1: …………………………………………… scalar                                                           │
└──────────────────────────────────────────────────────────────────────────────────────────────────┘

┌──────────────────────────────────────────────────────────────────────────────────────────────────┐
│ DG{Float64}                                                                                      │
│ ═══════════                                                                                      │
│ basis: ……………………………………………………………… LobattoLegendreBasis{Float64}(polydeg=3)                         │
│ mortar: …………………………………………………………… LobattoLegendreMortarL2{Float64}(polydeg=3)                      │
│ surface integral: ………………………………… SurfaceIntegralWeakForm                                          │
│ │ surface flux: ……………………………………… FluxLaxFriedrichs(max_abs_speed_naive)                           │
│ volume integral: …………………………………… VolumeIntegralWeakForm                                           │
└──────────────────────────────────────────────────────────────────────────────────────────────────┘

┌──────────────────────────────────────────────────────────────────────────────────────────────────┐
│ AnalysisCallback                                                                                 │
│ ════════════════                                                                                 │
│ interval: ……………………………………………………… 5000                                                             │
│ analyzer: ……………………………………………………… LobattoLegendreAnalyzer{Float64}(polydeg=6)                      │
│ │ error 1: …………………………………………………… l2_error                                                         │
│ │ error 2: …………………………………………………… linf_error                                                       │
│ │ integral 1: …………………………………………… entropy_timederivative                                           │
│ │ integral 2: …………………………………………… entropy                                                          │
│ │ integral 3: …………………………………………… energy_total                                                     │
│ save analysis to file: …………………… no                                                               │
└──────────────────────────────────────────────────────────────────────────────────────────────────┘

┌──────────────────────────────────────────────────────────────────────────────────────────────────┐
│ AliveCallback                                                                                    │
│ ═════════════                                                                                    │
│ interval: ……………………………………………………… 500                                                              │
└──────────────────────────────────────────────────────────────────────────────────────────────────┘

┌──────────────────────────────────────────────────────────────────────────────────────────────────┐
│ SaveRestartCallback                                                                              │
│ ═══════════════════                                                                              │
│ interval: ……………………………………………………… 5000                                                             │
│ save final solution: ………………………… yes                                                              │
│ output directory: ………………………………… /Users/erik/git/Trixi.jl/out                                     │
└──────────────────────────────────────────────────────────────────────────────────────────────────┘

┌──────────────────────────────────────────────────────────────────────────────────────────────────┐
│ SaveSolutionCallback                                                                             │
│ ════════════════════                                                                             │
│ interval: ……………………………………………………… 5000                                                             │
│ solution variables: …………………………… cons2prim                                                        │
│ save initial solution: …………………… yes                                                              │
│ save final solution: ………………………… yes                                                              │
│ output directory: ………………………………… /Users/erik/git/Trixi.jl/out                                     │
└──────────────────────────────────────────────────────────────────────────────────────────────────┘

┌──────────────────────────────────────────────────────────────────────────────────────────────────┐
│ StepsizeCallback                                                                                 │
│ ════════════════                                                                                 │
│ CFL number: ………………………………………………… 1.6                                                              │
└──────────────────────────────────────────────────────────────────────────────────────────────────┘

┌──────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Time integration                                                                                 │
│ ════════════════                                                                                 │
│ Start time: ………………………………………………… 0.0                                                              │
│ Final time: ………………………………………………… 1000.0                                                           │
│ time integrator: …………………………………… CarpenterKennedy2N54                                             │
│ adaptive: ……………………………………………………… false                                                            │
└──────────────────────────────────────────────────────────────────────────────────────────────────┘
┌──────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Environment information                                                                          │
│ ═══════════════════════                                                                          │
│ #threads: ……………………………………………………… 10                                                               │
└──────────────────────────────────────────────────────────────────────────────────────────────────┘

────────────────────────────────────────────────────────────────────────────────────────────────────
 Simulation running 'LinearScalarAdvectionEquation2D' with DGSEM(polydeg=3)
────────────────────────────────────────────────────────────────────────────────────────────────────
 #timesteps:                  0                run time:       9.90420000e-05 s
 Δt:             1.00000000e+00                └── GC time:    0.00000000e+00 s (0.000%)
 sim. time:      0.00000000e+00 (0.000%)       time/DOF/rhs!:         NaN s
                                               PID:                   Inf s
 #DOFs per field:          4096                alloc'd memory:        191.142 MiB
 #elements:                 256

 Variable:       scalar        
 L2 error:       3.94120825e-06
 Linf error:     1.23670425e-05
 ∑∂S/∂U ⋅ Uₜ :  -8.56960173e-17
 ∑S          :   5.62500000e-01
 ∑e_total    :   5.62500000e-01
────────────────────────────────────────────────────────────────────────────────────────────────────

#timesteps:    500 │ Δt: 5.5556e-02 │ sim. time: 2.7778e+01 (2.778%)   │ run time: 2.9513e-01 s
#timesteps:   1000 │ Δt: 5.5556e-02 │ sim. time: 5.5556e+01 (5.556%)   │ run time: 5.1597e-01 s
#timesteps:   1500 │ Δt: 5.5556e-02 │ sim. time: 8.3333e+01 (8.333%)   │ run time: 6.3013e-01 s
#timesteps:   2000 │ Δt: 5.5556e-02 │ sim. time: 1.1111e+02 (11.111%)  │ run time: 7.5379e-01 s
#timesteps:   2500 │ Δt: 5.5556e-02 │ sim. time: 1.3889e+02 (13.889%)  │ run time: 8.7385e-01 s
#timesteps:   3000 │ Δt: 5.5556e-02 │ sim. time: 1.6667e+02 (16.667%)  │ run time: 9.9571e-01 s

This is it. It just freezes there forever and doesn't react to Ctrl + C. CPU load goes down to a constant 100%. I cannot reproduce this with a MWE (yet).

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

Together with #1463 and #1206, Trixi is basically unusable on an Apple chip except when using only one thread.

@efaulhaber efaulhaber added the bug Something isn't working label Nov 9, 2023
@sloede
Copy link
Member

sloede commented Nov 9, 2023

Thanks for investigating and reporting this! However, could you please change the title into something less menacing (but more accurate), e.g., "Simulations using multiple threads freeze on Apple M2 Pro with Julia x86 (Rosetta)"? It might give off the wrong impression otherwise

@efaulhaber efaulhaber changed the title Simulations freeze on Apple M2 Pro with Julia x86 (Rosetta) Simulations using multiple threads freeze on Apple M2 Pro with Julia x86 (Rosetta) Nov 9, 2023
@efaulhaber
Copy link
Member Author

I did finally manage to reproduce it in a MWE: JuliaSIMD/Polyester.jl#126

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working upstream
Projects
None yet
Development

No branches or pull requests

2 participants