Skip to content

Conversation

@majosm
Copy link
Collaborator

@majosm majosm commented Dec 13, 2021

I think this could help simplify the logic in a couple of places in illinois-ceesd/mirgecom#566 (example).

cc @thomasgibson

@majosm majosm marked this pull request as ready for review December 13, 2021 20:00
@majosm majosm requested review from alexfikl and inducer December 13, 2021 20:00
Copy link
Collaborator

@alexfikl alexfikl left a comment

Choose a reason for hiding this comment

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

One little comment, but code-wise this looks good to me!

What's the use case? Looking at illinois-ceesd/mirgecom#566, it seems like it would only be used with DOFArrays, but there's already a function for that in meshmode.dof_array. Would that do the trick?

@majosm
Copy link
Collaborator Author

majosm commented Dec 13, 2021

What's the use case? Looking at illinois-ceesd/mirgecom#566, it seems like it would only be used with DOFArrays, but there's already a function for that in meshmode.dof_array. Would that do the trick?

TIL 🙂 Yes, I think it might. On the other hand, this change could remove the existing code duplication (i.e., rec_map_dof_array_container could be reimplemented in terms of rec_map_array_container). Either solution would seem to work for me.

@alexfikl
Copy link
Collaborator

On the other hand, this change could remove the existing code duplication (i.e., rec_map_dof_array_container could be reimplemented in terms of rec_map_array_container). Either solution would seem to work for me.

It actually was initially! Well, in terms of _map_array_container_impl. I re-implemented it directly in meshmode at some point in the hopes that it would be a bit faster (and not too much of a maintainence burden, since the code is straightforward).

I don't feel particularly strongly about it either, so we can let @inducer break the tie 😁

@inducer
Copy link
Owner

inducer commented Dec 13, 2021

I'm gravitating towards having this implemented here and making the meshmode.dof_array use this via the leaf_class argument. I don't see too much benefit in keeping both virtually-identical implementations around:

I also feel like the speed difference is probably non-existent. (pending benchmarks proving me wrong 😁 )

@alexfikl
Copy link
Collaborator

alexfikl commented Dec 13, 2021

I also feel like the speed difference is probably non-existent. (pending benchmarks proving me wrong)

Made a simple benchmark using this patch and the version from meshmode is a bit slower!

INFO:__main__:[mm] min 6.767774e-03 mean 6.942166e-03 ± 1.912915e-04
INFO:__main__:[ac] min 5.201670e-03 mean 5.289515e-03 ± 7.113123e-05

so mostly just confused now 😕. Either way, it's definitely negligible!

@majosm majosm force-pushed the map-container-leaf-class branch from 5e61d84 to b395fa8 Compare December 16, 2021 17:42
@majosm majosm force-pushed the map-container-leaf-class branch from 64a4dec to 442a119 Compare December 16, 2021 19:06
@majosm
Copy link
Collaborator Author

majosm commented Dec 16, 2021

Ready for another look @inducer.

Copy link
Owner

@inducer inducer left a comment

Choose a reason for hiding this comment

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

LGTM, thanks! If we can ever get the (currently super flaky) CI to pass, this'll land.

@inducer inducer enabled auto-merge (squash) December 27, 2021 12:18
@inducer inducer merged commit 1810b0e into inducer:main Dec 27, 2021
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.

3 participants