Skip to content

Commit

Permalink
remove blas thread that always segfault
Browse files Browse the repository at this point in the history
  • Loading branch information
mloubout committed Mar 18, 2024
1 parent 7caaf90 commit 9f46a00
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 12 deletions.
2 changes: 0 additions & 2 deletions src/JUDI.jl
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,6 @@ function __init__()
end
end

# BLAS num threads for dense LA such as sinc interpolation
BLAS.set_num_threads(Threads.nthreads())
end

end
2 changes: 1 addition & 1 deletion src/pysource/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ def _cfl_coeff(self):
c_fd = sum(np.abs(coeffs[-1][-1])) / 2
return .9 * np.sqrt(self.dim) / self.dim / c_fd
a1 = 4 # 2nd order in time
so = max(self._space_order, 4)
so = max(self._space_order // 2, 4)
coeffs = fd_w(2, range(-so, so), 0)[-1][-1]
return .9 * np.sqrt(a1/float(self.grid.dim * sum(np.abs(coeffs))))

Expand Down
2 changes: 0 additions & 2 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ parsed_args = parse_commandline()
const nlayer = parsed_args["nlayer"]
const tti = parsed_args["tti"] || contains(GROUP, "TTI")
const fs = parsed_args["fs"] || contains(GROUP, "FS")
const nw = (GROUP == "BASICS" || GROUP == "ISO_OP") ? 2 : 0
const viscoacoustic = parsed_args["viscoacoustic"] || contains(GROUP, "VISCO")


Expand Down Expand Up @@ -72,7 +71,6 @@ issues = ["test_issues.jl"]

# custom
if endswith(GROUP, ".jl")
# VERSION >= v"1.7" && push!(Base.ARGS, "-p 2")
timeit_include(GROUP)
end

Expand Down
8 changes: 4 additions & 4 deletions test/test_adjoint.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Date: May 2020
#

using Distributed
nw = 2

# # Set parallel if specified
if nw > 1 && nworkers() < nw
Expand Down Expand Up @@ -60,9 +60,9 @@ test_adjoint(adj::Bool, last::Bool) = (adj || last) ? (@test adj) : (@test_skip
# Modeling operators
@testset "Adjoint test with $(nlayer) layers and tti $(tti) and viscoacoustic $(viscoacoustic) and freesurface $(fs)" begin
@timeit TIMEROUTPUT "Adjoint" begin
opt = Options(sum_padding=true, dt_comp=dt, free_surface=parsed_args["fs"], f0=f0)
opt = Options(sum_padding=true, dt_comp=dt, free_surface=fs, f0=f0)
F = judiModeling(model0, srcGeometry, recGeometry; options=opt)

@show q.nsrc
# Nonlinear modeling
y = F*q

Expand All @@ -84,7 +84,7 @@ end
# Extended source modeling
@testset "Extended source adjoint test with $(nlayer) layers and tti $(tti) and viscoacoustic $(viscoacoustic) and freesurface $(fs)" begin
@timeit TIMEROUTPUT "Extended source adjoint" begin
opt = Options(sum_padding=true, dt_comp=dt, free_surface=parsed_args["fs"], f0=f0)
opt = Options(sum_padding=true, dt_comp=dt, free_surface=fs, f0=f0)
F = judiModeling(model0, srcGeometry, recGeometry; options=opt)
Pr = judiProjection(recGeometry)
Fw = judiModeling(model0; options=opt)
Expand Down
2 changes: 1 addition & 1 deletion test/test_linearity.jl
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ end


####################### Extended source operators ##########################################
if parsed_args["tti"]
if tti
ftol = 5f-4
end

Expand Down
5 changes: 3 additions & 2 deletions test/test_modeling.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@
# Mathias Louboutin, [email protected]
# Updated July 2020

nw = 2

# Set parallel if specified
if nw > 1 && nworkers() < nw
addprocs(nw-nworkers() + 1; exeflags=["--code-coverage=user", "--inline=no", "--check-bounds=yes"])
end

@everywhere using JOLI
@everywhere using JUDI, LinearAlgebra, Test, Distributed
@everywhere using JOLI, JUDI, LinearAlgebra, Test, Distributed

### Model
model, model0, dm = setup_model(tti, viscoacoustic, nlayer; n=(101, 101), d=(10., 10.))
Expand Down

0 comments on commit 9f46a00

Please sign in to comment.