Skip to content
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

AT does not compile with OpenMP=1 #592

Open
swhite2401 opened this issue Apr 6, 2023 · 6 comments
Open

AT does not compile with OpenMP=1 #592

swhite2401 opened this issue Apr 6, 2023 · 6 comments
Assignees
Labels

Comments

@swhite2401
Copy link
Contributor

The C code including random number (QuantdiffPass, *QuantPass, etc...) generation does not compile anymore if OpenMP is activate below the error:

image

It looks like the random generator has to be added to the shared variables. @lfarv do you confirm?

@swhite2401
Copy link
Contributor Author

swhite2401 commented Apr 6, 2023

In fact adding rng to the shared variables allows to compile correctly, I have not tested if it runs...

@lfarv
Copy link
Contributor

lfarv commented Apr 7, 2023

The rng variable must indeed be added to the shared variables. I then compiles and runs, but there is another problem: the average energy loss from quantum radiation is ~10% too high with OpenMP.

I'm looking at that.

@lfarv
Copy link
Contributor

lfarv commented Apr 7, 2023

Update: the test is done looking at the energy loss over one turn of S28F, with 1000 particles and BndMPoleSymplectic4QuantPass compared to BndMPoleSymplectic4RadPass.

The results are in excellent agreement without OpenMP and differ by ~10% with OpenMP

@lfarv
Copy link
Contributor

lfarv commented Apr 7, 2023

Results without OpenMP

histo1
curve1

Here is the notebook used for the test (remove the .txt extension):
testquantum.ipynb.txt

@lfarv
Copy link
Contributor

lfarv commented Apr 7, 2023

Results with OpenMP:

histo2
curve2

I do not understand what may happen with the random generator… It would be interesting to do the same test with MPI.

For the time being, it seems necessary to disable OpenMP for the 2 passmethods BndMPoleSymplectic4QuantPass, StrMPoleSymplectic4QuantPass and QuantDiffPass. What do you think ?

@swhite2401
Copy link
Contributor Author

Yes I agree, it has to be disabled. I will check that results are correct with MPI

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants