Missing energy computation in MCfoil and MCxyz kernels ?#138
Missing energy computation in MCfoil and MCxyz kernels ?#138clementlfnd wants to merge 2 commits intoEMsoft-org:developfrom
Conversation
|
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 |
|
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. |
|
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. |
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