Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to PartitionedArrays v0.3 #16

Merged
merged 5 commits into from
May 26, 2023

Conversation

moyner
Copy link
Contributor

@moyner moyner commented May 18, 2023

I noticed that PartitionedArrays has had a big API upgrade that was incompatible with HYPRE. I have made an attempt to rewrite the impacted functions and extend the tests to all backends. I think the latest API makes many of the interface operations a bit easier to write. With Julia 1.9 it might be relevant to also make some of the dependencies weak dependencies but this PR is just the API upgrade.

  • Catch up to API changes for PartitionedArrays
  • Rewrite tests to use all available PArray backends (debug, mpi, native)

- Catch up to API changes for PartitionedArrays
- Rewrite tests to use all available PArray backends (debug, mpi, native)
@fredrikekre
Copy link
Owner

Thanks, I have been meaning to upgrade but didn't find the time. I had also planned to make it an extension, but that can be done separately.

@moyner
Copy link
Contributor Author

moyner commented May 18, 2023

I see some failures on CI that I do not have locally. I'm suspecting that it is Julia 1.6 related. Will try to rewrite the test and update the PR...

@moyner
Copy link
Contributor Author

moyner commented May 18, 2023

Ok, I think I figured it the test failure: In Julia 1.9 wrapping a pointer to a SubArray (view) is supported provided that the view is
contigious. This fails in earlier Julia versions. I added a conditional that collects the intermediate data for older Julia versions. For the documentation I think a Manifest is already checked into the docs directory that uses the older PartitionedArrays. Maybe it should be removed?

@codecov
Copy link

codecov bot commented May 19, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.32 🎉

Comparison is base (30fc662) 77.37% compared to head (85f0601) 77.69%.

❗ Current head 85f0601 differs from pull request most recent head d5c3861. Consider uploading reports for the commit d5c3861 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           master      #16      +/-   ##
==========================================
+ Coverage   77.37%   77.69%   +0.32%     
==========================================
  Files           4        4              
  Lines        1118     1139      +21     
==========================================
+ Hits          865      885      +20     
- Misses        253      254       +1     
Impacted Files Coverage Δ
src/HYPRE.jl 98.93% <100.00%> (+0.06%) ⬆️

... and 1 file with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@fredrikekre
Copy link
Owner

Sorry for the slow review here. I want to catch up on the new PartitionedArrays API myself before reviewing/merging here.

Feel free to pkg> up the doc manifest btw.

Copy link
Owner

@fredrikekre fredrikekre left a comment

Choose a reason for hiding this comment

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

Thanks! Indeed, the new PartitionedArrays API is easier, but also I might have misused the old API too, it wasn't documented much at the time.

If we limit to HYPRE_Complex as indicated, and if you update docs/Manifest.toml we can merge and release this.

src/HYPRE.jl Outdated Show resolved Hide resolved
src/HYPRE.jl Outdated Show resolved Hide resolved
src/HYPRE.jl Outdated Show resolved Hide resolved
map_parts(dst.values, dst.owned_values, dst.rows.partition) do vv, _, vr
il_src_part = vr.lid_to_gid[vr.oid_to_lid.start]
iu_src_part = vr.lid_to_gid[vr.oid_to_lid.stop]
map(own_values(dst), dst.index_partition) do ov, vr
Copy link
Owner

Choose a reason for hiding this comment

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

I guess the SubArray issue can be circumvented by using local_values(dst) here, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think so. I was not sure if HYPRE_IJVectorGetValues would safely output the ghost values too.

Copy link
Owner

Choose a reason for hiding this comment

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

I was thinking the indices would just be for the owned ones, but it should be fine to essentially pass a too-long buffer to HYPRE_IJVectorGetValues.

@fredrikekre fredrikekre merged commit e05bead into fredrikekre:master May 26, 2023
@fredrikekre
Copy link
Owner

Registry PR: JuliaRegistries/General#84271

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants