Skip to content

Commit

Permalink
Merge pull request #59 from sintefmath/dev
Browse files Browse the repository at this point in the history
Fix to parray solves
  • Loading branch information
moyner committed Mar 4, 2024
2 parents 2a0899c + 3420d32 commit 7b84168
Show file tree
Hide file tree
Showing 4 changed files with 11 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 = "Jutul"
uuid = "2b460a1a-8a2b-45b2-b125-b5c536396eb9"
authors = ["Olav Møyner <olav.moyner@gmail.com>"]
version = "0.2.25"
version = "0.2.26"

[deps]
AlgebraicMultigrid = "2169fc97-5a83-5252-b627-83903c6c433c"
Expand Down
7 changes: 4 additions & 3 deletions ext/JutulPartitionedArraysExt/io.jl
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,14 @@ function rank_folder(pth, rank)
end

function consolidate_distributed_results(states, reports, partitions)
state = JUTUL_OUTPUT_TYPE()
report = JUTUL_OUTPUT_TYPE()
JT = Jutul.JUTUL_OUTPUT_TYPE
state = JT()
report = JT()
mlabel = partitions[1]["main_partition_label"]
if isnothing(mlabel)
consolidate_cell_values!(state, states, partitions)
else
main_state = JUTUL_OUTPUT_TYPE()
main_state = JT()
for substate in states
for (k, v) in pairs(substate)
if k == mlabel
Expand Down
8 changes: 6 additions & 2 deletions src/models.jl
Original file line number Diff line number Diff line change
Expand Up @@ -431,8 +431,12 @@ function setup_storage!(storage, model::JutulModel; setup_linearized_system = tr
else
state0 = setup_state(model, deepcopy(state0))
end
state0 = merge(state0, parameters)
state = merge(state, parameters)
for (k, v) in pairs(model.parameters)
if haskey(parameters, k)
state0[k] = parameters[k]
state[k] = parameters[k]
end
end
# Both states now contain all parameters, ready to store.
storage[:state0] = state0
storage[:state] = state
Expand Down
1 change: 0 additions & 1 deletion src/utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ end
function check_increment(dx, pvar, key)
has_bad_values = any(!isfinite, dx)
if has_bad_values
display(dx)
bad = findall(isfinite.(vec(dx)) .== false)
n_bad = length(bad)
n = min(10, length(bad))
Expand Down

2 comments on commit 7b84168

@moyner
Copy link
Member Author

@moyner moyner commented on 7b84168 Mar 4, 2024

Choose a reason for hiding this comment

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

@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/102231

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 v0.2.26 -m "<description of version>" 7b8416870c7a2ab1a16be4a5f01576c2611c7ab3
git push origin v0.2.26

Please sign in to comment.