-
Notifications
You must be signed in to change notification settings - Fork 30
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
Better integration #608
base: master
Are you sure you want to change the base?
Better integration #608
Conversation
A more accurate cylinder model has been added to the sasmodels library and library functions have been added to support the model
The new models are appended with "_high_res" to indicate that they are using the new integration system.
(1) Using How does this value compare to the (2) Rather than generic Gauss-Legendre, we could look at the structure of the function and select more points where it is larger (importance sampling). The problematic shapes have high eccentricity, which will show up near θ=0° or θ=90°. (3) There are analytic approximations for large disks and long rods (#109). Can these be used for large q? Can they be extended to other models? (4) The current code cannot run in OpenCL since the arrays are too large to put in constant memory. Not sure how to allocate them in main memory and make them accessible to the kernels. (5) We could unroll the loops, computing the different (q, θ) values in parallel, then summing afterward. This would speed up the kernels a lot on high end graphics cards. (6) Ideally we would update all models to use dynamic integration rather than having normal and high-resolution versions. It would be nice to have a mechanism to set the precision. (7) What is the target precision on your models? Do you really need 32000 angles for them? You may need to be more careful about summing the terms to avoid loss in precision when adding many small numbers to a large total. |
Note that you can adjust the number of points in the loop for an existing model. You can see this with
This is roughly equivalent to the following [untested]:
SasView could do this now, giving the number of theta points as a control parameter and sending that to sasmodels before evaluating. Not as good as having the model set the number of theta points as done in this PR, but it immediately applies to all models. |
Thanks you for your feedback, there are several aspects here that I should have considered earlier.
Target tolerance is a relative tolerance of 1 With
With
Due to memory/space limitations, the number of points is selected from a discrete set (powers of 2 from 1 to 15), so that only those points need to be stored and loaded into memory. As a result, if it selects 32,768 points, it only means 16,384 wouldn’t be enough. It doesn't check any of the possibilities in between. It could have gotten away with less but it can't figure that out. A bit crude but it helps. Do you have any suggestions on a better way to handle this? I'll look some of these issues.
|
This PR is poiniting to SasView:master. Shouldn't be main? |
Sorry, my bad it is sasmodels... |
Updated models that require 1D integration to use new integration system. The new model have "_high_res" appended to their names.
The updated models are:
Details of the method can be found at this repo