Skip to content

Commit

Permalink
bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
mloubout committed Jan 3, 2024
1 parent 9505e0d commit 9f904d6
Show file tree
Hide file tree
Showing 11 changed files with 44 additions and 32 deletions.
13 changes: 3 additions & 10 deletions .github/workflows/ci-examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
run-examples:
runs-on: ubuntu-latest
needs: list-examples
name: ${{ matrix.example }} on Julia ${{ matrix.version }}
name: ${{ matrix.example }}

env:
DEVITO_ARCH: gcc-9
Expand All @@ -48,15 +48,8 @@ jobs:
fail-fast: false
matrix:
example: ${{ fromJson(needs.list-examples.outputs.matrix) }}
version: ['1.8']

include:
- example: "examples/scripts/modeling_basic_2D.jl"
version: '1.6'

- example: "examples/scripts/modeling_basic_2D.jl"
version: '1.7'

version: ['1']

steps:
- name: Checkout JUDI
uses: actions/checkout@v3
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/ci-op.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,18 @@ jobs:
omp: 1

- os: macos-latest
version: '1.7'
version: '1.8'
op: "ISO_OP"
omp: 1

- os: macos-latest
version: '1.8'
version: '1.9'
op: "ISO_OP"
omp: 1

- os: ubuntu-latest
version: '1.9'
op: "ISO_OP"
op: "VISCO_AC_OP"
omp: 2

- os: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "JUDI"
uuid = "f3b833dc-6b2e-5b9c-b940-873ed6319979"
authors = ["Philipp Witte, Mathias Louboutin"]
version = "3.3.8"
version = "3.3.9"

[deps]
ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4"
Expand Down
20 changes: 12 additions & 8 deletions examples/scripts/lsrtm_2D.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,19 @@ if ~isfile("$(JUDI.JUDI_DATA)/marmousi_model.h5")
end
n, d, o, m0 = read(h5open("$(JUDI.JUDI_DATA)/marmousi_model.h5", "r"), "n", "d", "o", "m0")

# Smaller model for CI
if get(ENV, "NITER", "10") == "2"
fact = 4
m0 = m0[1:fact:end, 1:fact:end]
n = size(m0)
d = d .* fact
else
fact = 1
end

# Set up model structure
model0 = Model(n, d, o, m0)
grad_mem = 40 # Based on n and CFL condition

# Coarsen for CI
if get(ENV, "CI", nothing) == "true"
model0 = Model(ceil.(Int, n ./ 2), d .* 2, o, m0[1:2:end, 1:2:end])
grad_mem = 5
end
grad_mem = 40 / (fact^3) # Based on n and CFL condition

# Load data
if ~isfile("$(JUDI.JUDI_DATA)/marmousi_2D.segy")
Expand Down Expand Up @@ -53,7 +57,7 @@ Ml = judiDataMute(q.geometry, d_lin.geometry)
#' set up number of iterations
niter = parse(Int, get(ENV, "NITER", "10"))
# Default to 64, 5 for CI only with NITER=1
nsrc = 5 * parse(Int, get(ENV, "NITER", "$(q.nsrc ÷ 5)"))
nsrc = 5 * parse(Int, get(ENV, "NITER", "10"))
indsrc = randperm(q.nsrc)[1:nsrc]
lsqr_sol = zeros(Float32, prod(model0.n))

Expand Down
16 changes: 13 additions & 3 deletions examples/scripts/splsrtm_2D.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,19 @@ if ~isfile("$(JUDI.JUDI_DATA)/marmousi_model.h5")
end
n, d, o, m0 = read(h5open("$(JUDI.JUDI_DATA)/marmousi_model.h5", "r"), "n", "d", "o", "m0")

# Smaller model for CI
if get(ENV, "NITER", "10") == "2"
fact = 4
m0 = m0[1:fact:end, 1:fact:end]
n = size(m0)
d = d .* fact
else
fact = 1
end

# Set up model structure
model0 = Model(n, d, o, m0)
grad_mem = 40 # Based on n and CFL condition
grad_mem = 40 / (fact^3) # Based on n and CFL condition

# Coarsen for CI
if get(ENV, "CI", nothing) == "true"
Expand Down Expand Up @@ -54,7 +64,7 @@ C = joEye(prod(model0.n); DDT=Float32, RDT=Float32)
# If available use curvelet instead for better result

# Setup linearized bregman
batchsize = 5 * parse(Int, get(ENV, "NITER", "$(q.nsrc ÷ 5)"))
batchsize = 5 * parse(Int, get(ENV, "NITER", "10"))
niter = parse(Int, get(ENV, "NITER", "10"))
g_scale = 0

Expand All @@ -65,7 +75,7 @@ function obj(x)

residual = Ml[inds]*J[inds]*Mr*dm - Ml[inds]*d_lin[inds]
# grad
G = reshape(Mr'J[inds]'*Ml[inds]'*residual, model0.n)
G = reshape(Mr'*J[inds]'*Ml[inds]'*residual, model0.n)
g_scale == 0 && (global g_scale = .05f0/maximum(G))
G .*= g_scale
return .5f0*norm(residual)^2, G[:]
Expand Down
2 changes: 1 addition & 1 deletion src/JUDI.jl
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import Base.depwarn
import Base.*, Base./, Base.+, Base.-, Base.==, Base.\
import Base.copy!, Base.copy, Base.copyto!, Base.deepcopy, Base.summary
import Base.sum, Base.ndims, Base.reshape, Base.fill!, Base.axes, Base.dotview
import Base.eltype, Base.length, Base.size, Base.iterate, Base.show, Base.display, Base.showarg
import Base.eltype, Base.length, Base.size, Base.iterate, Base.show, Base.display, Base.showarg, Base.elsize
import Base.maximum, Base.minimum, Base.push!
import Base.Broadcast.ArrayStyle, Base.Broadcast.extrude
import Base.Broadcast.broadcasted, Base.BroadcastStyle, Base.Broadcast.DefaultArrayStyle, Base.Broadcast, Base.broadcast!
Expand Down
5 changes: 4 additions & 1 deletion src/TimeModeling/Preconditioners/ModelPreconditioners.jl
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,10 @@ function matvec(D::TopMute{T, N}, x::Array{T, N}) where {T, N}
taper = D.taperwidth < 2 ? 1 : _taper(Val(:reflection), D.taperwidth)
for i in CartesianIndices(D.wb)
out[i, 1:D.wb[i]-D.taperwidth] .= 0
out[i, D.wb[i]-D.taperwidth+1:D.wb[i]] .*= taper
s = max(D.wb[i]-D.taperwidth+1, 1)
ni = length(s:D.wb[i])
tap = D.taperwidth < 2 ? 1 : taper[end-ni+1:end]
out[i, s:D.wb[i]] .*= tap
end
out
end
Expand Down
2 changes: 2 additions & 0 deletions src/TimeModeling/Types/ModelStructure.jl
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,8 @@ dotview(m::PhysicalParameter, i) = Base.dotview(m.data, i)
getindex(A::PhysicalParameter{T, N}, i::Int) where {T<:Real, N} = A.data[i]
getindex(A::PhysicalParameter{T, N}, ::Colon) where {T<:Real, N} = A.data[:]

elsize(A::PhysicalParameter) = elsize(A.data)

get_step(r::StepRange) = r.step
get_step(r) = 1

Expand Down
2 changes: 1 addition & 1 deletion src/TimeModeling/Types/broadcasting.jl
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ end

# Broadcasted custom type
check_compat() = true
get_src(ms::judiMultiSourceVector, j) = ms.data[j]
get_src(ms::judiMultiSourceVector, j) = make_input(ms[j])
get_src(v::Vector{<:Array}, j) = v[j]
get_src(v::Array{T, N}, j) where {T<:Number, N} = v
get_src(n::Number, j) = n
Expand Down
2 changes: 1 addition & 1 deletion src/pysource/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ def wavefield_subsampled(model, u, nt, t_sub, space_order=8):
for wf in as_tuple(u):
usave = TimeFunction(name='us_%s' % wf.name, grid=model.grid, time_order=2,
space_order=space_order, time_dim=time_subsampled,
save=nsave)
save=int(nsave))
wf_s.append(usave)
return wf_s

Expand Down
4 changes: 2 additions & 2 deletions src/pysource/propagators.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,11 @@ def gradient(model, residual, rcv_coords, u, return_op=False, space_order=8, fw=
"""
# Setting adjoint wavefieldgradient
v = wavefield(model, space_order, fw=not fw)
if as_tuple(u)[0].indices[0].is_Conditional:
try:
t_sub = as_tuple(u)[0].indices[0]._factor
if isinstance(t_sub, Constant):
t_sub = t_sub.data
else:
except AttributeError:
t_sub = 1

# Setup gradient wrt m
Expand Down

0 comments on commit 9f904d6

Please sign in to comment.