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

parameter consistency check #270

Open
pkienzle opened this issue Mar 30, 2019 · 4 comments
Open

parameter consistency check #270

pkienzle opened this issue Mar 30, 2019 · 4 comments

Comments

@pkienzle
Copy link
Contributor

pkienzle commented Mar 30, 2019

parameters in the sasmodels description file must match the order of the parameters in the Iq and Iqxy calls.

Two alternatives:

(1) change the Iq/Iqxy definition so that it takes a !ParameterTable struct, with parameters referenced in the code as p.name instead of name.

(2) parse the Iq/Iqxy C code to make sure that the names of the parameters correspond exactly to the names of the parameters in the definition file.


Migrated from http://trac.sasview.org/ticket/609 [pkienzle 2016-08-08T15:52:58]

@butlerpd
Copy link
Member

butlerpd commented Mar 30, 2019

Is this relevant to #775? or to http://trac.sasview.org/ticket/646? If not can probably move back to +1

@butlerpd
Copy link
Member

Trac update at 2016/09/13 14:29:24: butler changed milestone from "SasView 4.0.0" to "SasView 4.1.0"

@butlerpd
Copy link
Member

butlerpd commented Mar 30, 2019

With a quick release turnaround for 4.1 moving this to next +1

@pkienzle
Copy link
Contributor Author

Yet another instance of user frustration with the model was producing incorrect results and even crashing sasview because parameters were in the wrong order (in this case one of the parameters was the number of shells, which really didn't no like receiving overall thickness as its input), so I increased the importance of this task.

Using structures would be easiest, since then all parameters would be sent to form volume and effective radius calculations without having to tag them as volume parameters, and the tag can be reserved for polydispersity parameters. It will require extensive testing to make sure it works across all OpenCL drivers.

static double form_volume(ModelParameters *p) {
    return M_4PI_3 * cube(p->radius);
}

Another option is to pass array parameters but provide macros as array indices:

// Autogenerated...  what do we do about name collisions?
#define radius 0
// user code
static double form_volume(double p[]) {
    return M_4PI_3 * cube(p[radius]);
}
Need to check how to pass the parameter array into the function since OpenCL cares about local vs. global memory pointers.

@pkienzle pkienzle changed the title parameter consistency check (Trac #609) parameter consistency check May 14, 2020
@butlerpd butlerpd added this to the sasmodels 1.1 milestone May 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants