Skip to content

Conversation

JHopeCollins
Copy link
Member

This means the call site for Function/Cofunction looks the same as the call site for non-Firedrake types.
Currently to send a non-Firedrake type:

x = ensemble.ensemble_rank
x = ensemble.ensemble_comm.bcast(x, root=0)

This PR changes it to:

x = ensemble.ensemble_rank
x = ensemble.bcast(x, root=0)

Comment on lines 16 to 17
# if only kwargs are given we need to get the
# first kw value instead of the first arg.
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure about this. One would expect ensemble.bcast(op=MPI.SUM, f=myfunction) to be isomorphic to ensemble.bcast(f=myfunction, op=MPI.SUM). If you're doing things with functools.partial this might get confusing.
I wonder if it might be a good idea to use / in the function signature (https://www.srcecde.me/posts/2024/02/asterisk-and-forward-slash-as-function-parameters-python/).

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

Successfully merging this pull request may close these issues.

2 participants