Question of Global synchronization and data collection in embrassing parallel #2723
Replies: 2 comments 1 reply
-
I would take a look at the relevant section in the docs: https://meep.readthedocs.io/en/latest/Parallel_Meep/#different-forms-of-parallelization In particular, there's a function No need to formulate your own communication blocks etc. This will prevent any deadlocking (unless you have deadlocking elsewhere...)
You can peek inside that function in the codebase, and modify it to work with dicts or whatever data structure you have in mind. |
Beta Was this translation helpful? Give feedback.
-
OK,I see. But since I am running in the cluster and I have no permission to modified the codebase, could it be bulid up from the function already existed in codebase?
|
Beta Was this translation helpful? Give feedback.
-
Hi, I am new to use meep with mpi and I am currently creating a embrassing parallelization file. I separate the progresses in several subgroups and assign several simulation on each of the subgroup. Each of the simulation will use Harminv to get several modes and save. At the end of the simulation, I hope to transfer the data in each master progress to the global master and make some plot with this. However, since I am not familar with the C++ and the MPI, I don't know how to use the send or broadcast to do so. Then, I ask the group masters write temporary txt files to list its data and then globally synchronization with following code:
Although this code work for most of cases, I found out sometimes the global master cannot find the temporary files from some of the master though I can see these files are created. Thus, I think the problem is that some subgroup may still using there own comm while the others are finished so that the global all_wait just apply to these subgroup that already finished. Then the global master start processing before all the subgroup finished. Thus, I am wondering is there a way that could guarantee this global synchronization work properly? Also, could we use other functions like send or broadcast to communicate as well? merge_subgroup_data doesn't work since the data we transfer is a dict and its size depend on how many mode we find.
These are the code of my simulation:
Beta Was this translation helpful? Give feedback.
All reactions