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

FormSum.coefficients() should be ordered deterministically #47

Closed

Conversation

JHopeCollins
Copy link
Member

Form.coefficients() and FormSum.coefficients() both use set to produce a unique collection of the coefficients. However, set does not have deterministic ordering. Form._analyze_form_arguments() uses sorted to make sure that the ordering is deterministic across MPI ranks and across multiple programme executions, but FormSum._analyze_form_arguments() doesn't.

This means that the ordering is sometimes different between different MPI ranks, which causes parallel hangs in MG code when a Function is sent to inject on one rank and a Cofunction is sent to restrict on another rank.

This PR just adds orders FormSum.coefficients() in the same way as Form.coefficients()

@wence-
Copy link

wence- commented Nov 16, 2023

This should go upstream, but be based on top of UFL main

@JHopeCollins
Copy link
Member Author

This should go upstream, but be based on top of UFL main

By UFL main do you mean the FEniCS/ufl main?

@wence-
Copy link

wence- commented Nov 17, 2023

This should go upstream, but be based on top of UFL main

By UFL main do you mean the FEniCS/ufl main?

Yes. For UFL this repo just tracks upstream.

@JHopeCollins JHopeCollins deleted the JHopeCollins/FormSum_coefficients_ordering branch November 17, 2023 14:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants