Skip to content

Commit

Permalink
bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
mloubout committed Jan 2, 2024
1 parent 9505e0d commit 814c3e7
Show file tree
Hide file tree
Showing 10 changed files with 39 additions and 30 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
12 changes: 8 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 Expand Up @@ -104,3 +104,7 @@ jobs:
- uses: codecov/codecov-action@v3
with:
file: lcov.info

- name: Run basic example
run: |
julia examples/scripts/modeling_basic_2D.jl
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
18 changes: 10 additions & 8 deletions examples/scripts/lsrtm_2D.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,17 @@ 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
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 +55,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
12 changes: 10 additions & 2 deletions examples/scripts/splsrtm_2D.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,17 @@ 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
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 +62,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 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
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 814c3e7

Please sign in to comment.