-
-
Notifications
You must be signed in to change notification settings - Fork 64
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
Group integrals with common integrand in IntegralData #92
Conversation
@connorjward could you try if this works for us. I think it will need some minor adaptation in the tsfc pipeline to allow the |
Sure will do. |
@connorjward @wence- I’ve find a tiny bug when running it through some of my extensions. I’ll let you know once I’ve fixed it |
@connorjward @wence- I've now corrected some mistakes I made the first time around, and added a test checking that merging integral data does what we expect. |
I've now got a branch of TSFC where this works. I haven't implemented the necessary bits to achieve any performance improvements since we touch code using |
@connorjward any update on this? |
I'm afraid I haven't done anything more on this. I was only intending to work on optimising TSFC once this PR was merged into UFL since they didn't need to land together. Sorry if there was a miscommunication here. |
Ok, I'll get the PR into a mergable shape and then we can get it merged. I thought it was a blocker for getting it merged if Firedrake didn't get the speedup. |
Go right ahead. Firedrake follows a fork of UFL (that we regularly update) so this can even land without needing to coordinate anything with us. It won't break anything for our users. |
@dham @connorjward I'm planning to merge this sometime this week, as the FEniCSx integration tests are passing, and this yields a significant speedup for form-compilation of forms with many subdomains. Note that if TSFC decides not to adapt this in the recent future, changes made by @mscroggs to UFL might not be easily picked up as breaking changes for TSFC |
I am on it. I was able to get most things working (with the optimisation this time) pretty quickly. |
As @chrisrichardson is doing a major restructuring of FFCx, I'll merge this very soon, as it keeps getting tedious to resolve merge conflicts in FFCx. |
Does this fix #70? |
I dont think so |
MWE:
On this branch, we get two
IntegralData
, one forinner(u,v)*dx((1,3,"everywhere"))
and one for(inner(u,v) + inner(grad(u), grad(v)))*dx((2,))
.On main one would get four integral datas;
inner(u,v)*dx(i)
fori=1,3,"everywhere"
and(inner(u,v) + inner(grad(u), grad(v)))*dx((2,))
.This is relevant when loading complex meshes with hundreds of subdomain_ids, where a tuple of subdomain ids is used to indicate a union of domains to integrate over. This would cause the compilers in
Firedrake
andDOLFINx
to generate hundreds of duplicate kernels, which makes the generated code unreadable and slow to generate.