CRPropa / CRPropa3

CRPropa is a public astrophysical simulation framework for propagating extraterrestrial ultra-high energy particles. https://crpropa.github.io/CRPropa3/
https://crpropa.desy.de
GNU General Public License v3.0
72 stars 69 forks source link

Add names to omp critical statements #486

Closed JanNiklasB closed 5 months ago

JanNiklasB commented 6 months ago

Dear All,

with this pull request I want to add names to various #pragma omp critical statements. If such a statement has no name, it blocks every other critical statement with no name, which may cause an increase in runtime. For example, a shell output should only block other shell outputs and not file outputs. Furthermore, if not accessed through a python script but directly through c++, critical statements from the users files may also block critical statements in CRPropa.

lukasmerten commented 6 months ago

Hi @JanNiklasB Thanks for contributing to CRPropa. I did not see any problems with your suggested improvement. If you apply the two small updates suggested above to the code, I will approve it and merge afterwards.

Here, is a reference to the IBM description of the omp critical statement (IBM omp critical).

JanNiklasB commented 6 months ago

Hey, I applied the two small updates, now the typo is fixed and the name for the HDFOutput is more generalized. Sorry that this took so long, I am new to github and did not saw or could not find the "two small updates" you wrote about and forgot about it untill now.

lukasmerten commented 6 months ago

Hi @JanNiklasB That was not your fault. I missed to save my comments properly. They were showing up for me in the conversation but not for anyone else. So do not worry: Obviously you can make mistakes even after several years with GitHub. So now everything looks fine from my sight. If I do not hear any objections, I will merge this in the next days.