You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Dozens of people have been asking why none of my tutorials are available here, so I am working on adding an acoustic frequency response solver example to Chapter 2, if it’s welcome.
Of course, both the matematical derivations and the code will be included, following the same style of other tutorials.
I understand that both .ipynb and .py files are required, and the code needs to work in parallel with mpirun.
Before proceeding further, I’d like to confirm if my approach is acceptable:
I often use 'frequency parallelism,' where the frequency loop is computed as follows:
deffrequency_loop(nf):
# solver setup# solver.solvereturnp_values#returns pressure at a microphone location# frequecy axis definition:f_axis=np.arange(5,200,1)
nf=range(0,len(f_axis))
frommultiprocessingimportPooln_proc=4pool=Pool(n_proc)
p_mic=pool.map(frequency_loop,nf) # pressure spectrumpool.close()
pool.join()
Here, each process works on a frequency across the entire mesh. This approach requires more RAM but scales perfectly.
That said, I believe it’s a bad idea to mix multiprocessing.Pool with mpirun, so if you agree, I will make the frequency loop a simple for loop:
# frequecy axis definition:f_axis=np.arange(5,200,1)
p_mic=np.zeros((len(f_axis),1),dtype=complex)
fornfinrange(0,len(frequency_axis):
# solver setup# solver.solvep_mic[nf] =# code for evaluating pressure at mic
This way, the chapter will remain consistent with the rest of the tutorials. Perhaps at the end of it, I can add a link to a repository showcasing the multiprocessing.Pool alternative.
If you approve this approach, I will add the scripts before Christmas.
Best regards,
Antonio
The text was updated successfully, but these errors were encountered:
Dozens of people have been asking why none of my tutorials are available here, so I am working on adding an acoustic frequency response solver example to Chapter 2, if it’s welcome.
Of course, both the matematical derivations and the code will be included, following the same style of other tutorials.
I understand that both .ipynb and .py files are required, and the code needs to work in parallel with mpirun.
Before proceeding further, I’d like to confirm if my approach is acceptable:
I often use 'frequency parallelism,' where the frequency loop is computed as follows:
Here, each process works on a frequency across the entire mesh. This approach requires more RAM but scales perfectly.
That said, I believe it’s a bad idea to mix multiprocessing.Pool with mpirun, so if you agree, I will make the frequency loop a simple for loop:
This way, the chapter will remain consistent with the rest of the tutorials. Perhaps at the end of it, I can add a link to a repository showcasing the multiprocessing.Pool alternative.
If you approve this approach, I will add the scripts before Christmas.
Best regards,
Antonio
The text was updated successfully, but these errors were encountered: