Skip to content

Commit

Permalink
Merge pull request #237 from slimgroup/wrapper-tweaks
Browse files Browse the repository at this point in the history
Wrapper tweaks
  • Loading branch information
mloubout authored Mar 28, 2024
2 parents b4dee98 + 53276dc commit 395793c
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 7 deletions.
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.4.0"
version = "3.4.1"

This comment has been minimized.

Copy link
@mloubout

mloubout Mar 28, 2024

Author Member

[deps]
ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4"
Expand Down
3 changes: 3 additions & 0 deletions docker/Dockerfile.JUDI
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
ARG JVER=1.7
FROM mloubout/julia-base:$JVER

# Update devito to latest
RUN pip3 install --user --upgrade devito[extras,tests]

# Update julia packages
RUN julia -e 'using Pkg;Pkg.update()'

Expand Down
4 changes: 2 additions & 2 deletions docs/src/inversion.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ res = spg(objective_function, vec(m0), ProjBound, options)
This example script can be run in parallel and requires roughly 220 MB of memory per source location. Execute the following code to generate figures of the initial model and the result, as well as the function values:

```julia
figure(); imshow(sqrt.(1./adjoint(m0))); title("Initial model")
figure(); imshow(sqrt.(1./adjoint(reshape(x, model0.n)))); title("FWI")
figure(); imshow(sqrt.(1. /adjoint(m0))); title("Initial model")
figure(); imshow(sqrt.(1. /adjoint(reshape(x, model0.n)))); title("FWI")
figure(); plot(fvals); title("Function value")
```

Expand Down
4 changes: 2 additions & 2 deletions docs/src/preconditioners.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,5 +129,5 @@ lsrtm_objective(model, q, dobs, dm; model_precon=dPrec, data_precon=dmPrec)
where `dPrec` and `dmPrec` can be:

- A single preconditioner ([DataPreconditionner](@ref) for `data_precon` and [ModelPreconditionner](@ref) for `model_precon`)
- A list/tuple of preconditioners ([DataPreconditionner](@ref) for `data_precon` and ModelPreconditionner](@ref) for `model_precon`)
- A product of preconditioners ([DataPreconditionner](@ref) for `data_precon` and ModelPreconditionner](@ref) for `model_precon`)
- A list/tuple of preconditioners ([DataPreconditionner](@ref) for `data_precon` and [ModelPreconditionner](@ref) for `model_precon`)
- A product of preconditioners ([DataPreconditionner](@ref) for `data_precon` and [ModelPreconditionner](@ref) for `model_precon`)
4 changes: 2 additions & 2 deletions src/TimeModeling/Modeling/propagation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ This is the main multi-source wrapper function for `fwi_objective` and `lsrtm_ob
Computes the misifit and gradient (LSRTM if `lin` else FWI) for the given `q` source and `dobs` and
perturbation `dm`.
"""
function multi_src_fg!(G, model, q, dobs, dm; options=Options(), kw...)
function multi_src_fg!(G, model, q, dobs, dm; options=Options(), ms_func=multi_src_fg, kw...)
# Number of sources and init result
nsrc = try q.nsrc catch; dobs.nsrc end
pool = _worker_pool()
Expand All @@ -111,7 +111,7 @@ function multi_src_fg!(G, model, q, dobs, dm; options=Options(), kw...)
arg_func = i -> (model, q[i], dobs[i], dm, options[i])
kw_func = i -> Dict(:illum=> illum, Dict(k => kw_i(v, i) for (k, v) in kw)...)
# Distribute source
res = run_and_reduce(multi_src_fg, pool, nsrc, arg_func; kw=kw_func)
res = run_and_reduce(ms_func, pool, nsrc, arg_func; kw=kw_func)
f, g = update_illum(res, model, :adjoint_born)
f, g = as_vec(res, Val(options.return_array))
G .+= g
Expand Down

1 comment on commit 395793c

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/103759

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v3.4.1 -m "<description of version>" 395793c9fd98f48922926f82cc2ab1d2a3bc3ff0
git push origin v3.4.1

Please sign in to comment.