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

Missing energy computation in MCfoil and MCxyz kernels ? #138

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

clementlfnd
Copy link
Contributor

Hi Marc,

New energy is not computed before while loop in MCfoil and MCxyz kernels compared to MC kernel. Is there any reason or is it a missing computation ?

Clément

@elena-pascal
Copy link

elena-pascal commented Jan 20, 2021

I found that bit confusing as well. I think in one version of the code it is doing a scattering step before the scattering loop. I think it would make more sense to not do a scattering step before the scattering loop, ie start scattering loop with incident energy and start computing energies in scattering loop (the while loop). But that's just me

@clementlfnd
Copy link
Contributor Author

Hi Elena,

I agree with you, maybe it is possible to make smalls kernels with the common portion of code of the differents Monte-Carlo facilities to unify the computations steps and avoid differences... I am not a specialist of OpenCL but I can try.

@elena-pascal
Copy link

elena-pascal commented Jan 21, 2021

The MC code could definitely use some structure. You could try to make it a common kernel and expose the exit conditions. What I mean is that the difference, as far as I can tell, between MCfoil and MC is the end condition for the while loop; for MC is z<0 (or whatever the scatter out from the top of the sample is) and for MCfoil is z>t (or scatter from the bottom of the foil). I can't remember how MCxyz was different, but I bet is something with the coordinate system. So then if you have a way to switch inside the kernel this exit condition and have it as a parameter, the rest of the code should be virtually identical.

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

Successfully merging this pull request may close these issues.

None yet

2 participants