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

Fix OpenMP compilation #882

Merged
merged 1 commit into from
Jan 8, 2025
Merged

Fix OpenMP compilation #882

merged 1 commit into from
Jan 8, 2025

Conversation

lfarv
Copy link
Contributor

@lfarv lfarv commented Jan 2, 2025

The new integrators including the computation of diffusion matrices do not compile with openMP.
The bug in the #pragma omp is fixed here.

@lfarv lfarv added bug fix C For C code / pass methods labels Jan 2, 2025
@oscarxblanco
Copy link
Contributor

oscarxblanco commented Jan 7, 2025

Dear @lfarv ,
I have compiled it in AT matlab and pyat. Both seem to work.
However, I noticed that for a ring with an EnergyLoss element the emittance calculated by radiation_parameters and ohmi_envelope in pyat are different.

# python
# ring with EnergyLoss element
>>> emit0['emitXYZ'] # from ohmi envelope in pyat
array([1.87729544e-10, 5.67160085e-38, 2.28673862e-06])
>>> pars.emittances # from radiation_parameters in pyat
array([2.00381041e-10,            nan, 3.05585928e-06])

This is not the case in AT matlab, atsummary and atx return the same emittance

% matlab
% [~,pa]=atx(THERING,0);
>> pa.modemittance(1)
   1.8778e-10
% atsummary(THERING);
Natural Emittance: 		 1.87429e-10 [mrad] ##  I think this should be rad not mrad !!!

And they all return about 200 pm.rad if the EnergyLoss element pass method is set to IdentityPass.

I believe the reason to have this energy loss pass method was to include the missing energy loss from IDs (maybe some other effects), and it seems to have a non-negligible effect on emittance. The EnergyLossRadPass was included in PR #870 for AT matlab. Maybe it should also be included in pyat radiation_parameters ?

P.D. There seems to be an error in the units printed aside of the atsummary emittance.

@lfarv
Copy link
Contributor Author

lfarv commented Jan 8, 2025

@oscarxblanco: thanks for testing.
I created a new issue reporting your findings. Since the errors you mention are not correlated to the OpenMP compilation bug, they should be covered in another PR, and I'd like to merge this one first.

@lfarv lfarv merged commit cca9a95 into master Jan 8, 2025
28 checks passed
@lfarv lfarv deleted the fix-openmp branch January 8, 2025 09:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug fix C For C code / pass methods
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants