DTsuna / CHIPS

Open source code to unveil the Complete History of Interaction-Powered Supernovae
GNU General Public License v3.0
11 stars 1 forks source link

Optimizing CHIPS: Utilizing Multiple Cores #4

Open sanjith123456 opened 9 months ago

sanjith123456 commented 9 months ago

Hi all,

While working on CHIPS, I've noticed that the computation time for sample cases, such as those provided in the example files 'mesa_models_rsg,' seems to be substantial on a single core. I appreciate the expertise in this community and would like to seek guidance on the possibility of optimizing these calculations by utilizing multiple cores.

Any insights or recommendations you could provide would be immensely valuable.

Thank you for your time, and I look forward to the community's feedback on this matter.

-Sanjith

DTsuna commented 9 months ago

Thanks Sanjith for your feedback. As you pointed out, enabling multi-thread calculations using OMP can be important in some cases but we unfortunately don’t have the person-power/expertise to do it swiftly. For the eruption part that takes longer time, one part that we’re thinking multi-core may help is where the Riemann problem is solved (src/eruption/hydro/riemnt.f). If you have good expertise in parallelization with fortran, it might be something simple enough to implement.

We do prepare another way to speed up the calculations without hacking the code, to do with lower resolution. This can be done by specifying the argument --eruption-Ncell (default is 10000) when running run.py. We’ve done resolution tests for some parameter sets with reduced Ncell = 5000, finding similar results for the CSM profile. Note that how much you can reduce the cells depends on your purpose. For instance, if you’re interested in something that involves radiation (e.g. precursors), it would be good to check if the photosphere is resolved.