-
Notifications
You must be signed in to change notification settings - Fork 626
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
merge_subgroup_data #1192
merge_subgroup_data #1192
Conversation
New test script: import meep as mp
import numpy as np
num_groups = 3
a = np.zeros((5,7),dtype=np.complex128)
n = mp.divide_parallel_processes(num_groups)
a[:] = (1+n) + 1j*(1+n)
b = mp.merge_subgroup_data(a)
print(b.shape)
print(b) Produces the same output as above, but now more efficiently (no more overwriting redundant data). I also added helper functions that return the number of groups ( |
You can put a test in the documentation PR. |
@stevengj @smartalecH |
Yes, those three groupings are correct with the ranks of each process divided into (0-4), (5-8), and (9-12). The relevant line in the function Line 706 in 14fe4e0
|
* add merge_subgroup_data * fixed issues Co-authored-by: Alec Hammond <[email protected]>
Closes #1178
Adds a
merge_subgroup_data
method. Takes a numpy array (int, float, complex, etc) and returns a new array with an extra dimension corresponding to the concatenated input from each subgroup.An example script
test.py
:Execute using:
Produces the expected output: