You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When constructing an EnsembleProblem with a SchrodingerProblem and using the EnsembleDistributed algorithm to parallelize the simulations, several workers cannot run simultaneously due to a lock on .CondaPkg. The error message produced is the following:
From worker 3: ┌ Info: CondaPkg: Waiting for lock to be freed. You may delete this file if no other process is resolving.
From worker 3: └ lock_file = "/Users/queraintern/.julia/environments/v1.9/.CondaPkg/lock"
To Reproduce
Here is a minimum working example:
using Bloqade
using OrdinaryDiffEq
atoms = generate_sites(ChainLattice(), 1, scale = 1)
h = rydberg_h(atoms; Ω = 2π)
reg = zero_state(1)
problem = SchrodingerProblem(reg, 1.0, h)
ep = EnsembleProblem(problem)
sim = solve(ep, DP8(), EnsembleDistributed(); trajectories = 2)
Running this code with julia -p 2 minimum_working_example.jl produces the issue.
Version Info
Julia: v1.9
Bloqade: v0.1.23
OrdinaryDiffEq: v6.11.2
The text was updated successfully, but these errors were encountered:
Update: I think that PythonCall is the issue. The bug can be fixed by avoiding the Bloqade init through replacing using Bloqade with using BloqadeExpr, BloqadeODE, BloqadeLattices.
A quick fix is to only let the master process import Python Call, and only allow master proc to plot
So if we modify the following part in src/Bloqade.jl :
using PythonCall
const plt = PythonCall.pynew()
function __init__()
# copied from PyPlotCall.jl
PythonCall.pycopy!(plt, pyimport("matplotlib.pyplot"))
return
end
to
using Distributed
const plt = nothing
@spawnat 1 :(using PythonCall)
@spawnat 1 :(const plt = PythonCall.pynew())
function __init__()
if getpid()==1
# copied from PyPlotCall.jl
PythonCall.pycopy!(plt, pyimport("matplotlib.pyplot"))
end
return
end
Describe the bug
When constructing an
EnsembleProblem
with aSchrodingerProblem
and using theEnsembleDistributed
algorithm to parallelize the simulations, several workers cannot run simultaneously due to a lock on.CondaPkg
. The error message produced is the following:To Reproduce
Here is a minimum working example:
Running this code with
julia -p 2 minimum_working_example.jl
produces the issue.Version Info
The text was updated successfully, but these errors were encountered: