Opened 15 years ago

Closed 15 years ago

#17 closed feature (fixed)

SANS/USANS Resolution Smearing in XOP

Reported by: ajj Owned by: ajj
Priority: major Milestone:
Component: Analysis Keywords:
Cc: Blocking:
Task:

Description

As a first step to getting the matrix smearing for USANS included we should begin by replicating what we currently do in IGOR as XOPS.

Change History (9)

comment:1 Changed 15 years ago by ajj

  • Owner changed from kline to ajj
  • Status changed from new to assigned
  • Summary changed from SANS Resolution Smearing in XOP to SANS/USANS Resolution Smearing in XOP

First attempt at SANS smearing in XOP.

Added smearing function to CylinderFit? XOP that Steve had made.

Only smears SANS data at the moment.

Approx 60x speed up compared to IGOR code alone on a simple Cylinder form factor. About 45x of that is from the smearing.

Working on replicating Smear_Model_20 generic model smearing equivalent.

Having trouble getting function name passed to XOP in suitable fashion.

comment:2 Changed 15 years ago by ajj

Smear_Model_20 equivalent successfully created.

Separate XOP : ResolutionSmearing?.xop

Now need to add USANS code.

comment:3 Changed 15 years ago by ajj

Oh, and with Cyl_PolyRadius the speed up from smearing in an XOP with the XOP calling another XOP routine is approx 1200 times. That is rather a lot! :

SpeedTest?(smear_coef_cypr,smeared_qvals)

-------Speed Test--------
Cyl_PolyRadius
IGOR Func + IGOR Smear Time: 2.7983e+06
XOP Func + IGOR Smear Time: 1.5859e+06 = 1.7644x faster than IGOR+IGOR
XOP Func +XOP Smear Time: 2217.5 = 1261.9x faster than IGOR+IGOR
715.19x faster than XOP+IGOR

comment:4 Changed 15 years ago by ajj

OK. So the speed ups were bogus.

It seems we don't actually get *any* speed up from putting the smearing integration into XOP for SANS data.

I'm now working on getting the trapezoidal integration to behave itself.

comment:5 Changed 15 years ago by ajj

IGOR Pro 6.01B09
Mac OS X / Intel 2Ghz Core Duo

---------------   Speed Test Results    -----------------
  SANS
  CylinderForm - IGOR no smear:    75608
  CylinderForm - XOP no smear:     8863.8= 8.53 x speed up from XOP FF
  IGOR Func + IGOR Smear Time:     9.4057e+05= 12.44 * Cylinder Form
  XOP Func + IGOR Smear Time:      1.9275e+05= 21.746 * Cylinder Form XOP  || 4.8798 x speed up from XOP FF
  XOP Func + XOP Smear Time:        1.8371e+05= 20.726 * Cylinder Form XOP  ||1.0492 x speed up from XOP smearing || 5.1199 x overall
  ------------------------------------------------
  Cyl PR - IGOR no smear:               9.5189e+05
  Cyl PR- XOP no smear:                 1.5301e+05= 6.2209 x speed up from XOP FF
  IGOR Func + IGOR Smear Time:    1.9115e+07= 20.081 * Cyl PR Form
  XOP Func + IGOR Smear Time:     3.0684e+06= 20.053 * Cyl PR Form XOP  || 6.2296 x speed up from XOP FF
  XOP Func + XOP Smear Time:      3.1289e+06= 20.448 * Cylinder Form XOP  ||0.98066 x speed up from XOP smearing || 6.1091 x overall
  ------------------------------------------------
  USANS
  CylinderForm - IGOR no smear:    13664
  CylinderForm - XOP no smear:     1991.9= 6.8596 x speed up from XOP FF
  IGOR Func + IGOR Smear Time:     2.8082e+07= 2055.2 * Cylinder Form
  XOP Func + IGOR Smear Time:      5.3578e+06= 2689.7 * Cylinder Form XOP  || 5.2414 x speed up from XOP FF
  XOP Func + XOP Smear Time:        3.0032e+06= 1507.7 * Cylinder Form XOP  ||1.784 x speed up from XOP smearing || 9.3508 x overall
  ------------------------------------------------
  Cyl PR - IGOR no smear:               2.8813e+05
  Cyl PR- XOP no smear:                 39305= 7.3305 x speed up from XOP FF
  IGOR Func + IGOR Smear Time:    3.53e+08= 1225.2 * Cyl PR Form
  XOP Func + IGOR Smear Time:     5.4164e+07= 1378 * Cyl PR Form XOP  || 6.5173 x speed up from XOP FF
  XOP Func + XOP Smear Time:      3.1079e+07= 790.72 * Cyl PR Form XOP  ||1.7428 x speed up from XOP smearing || 11.358 x overall

comment:6 Changed 15 years ago by ajj

IGOR Pro 5.05A
Mac OS X / Intel 2Ghz Core Duo

 ---------------   Speed Test Results    -----------------  
  SANS  
   
  CylinderForm - IGOR no smear:    2.3583e+05  
  CylinderForm - XOP no smear:     1.0817e+05= 2.1802 x speed up from XOP FF  
  IGOR Func + IGOR Smear Time:     4.1975e+06= 17.799 * Cylinder Form  
  XOP Func + IGOR Smear Time:      3.8972e+05= 3.6029 * Cylinder Form XOP  || 10.771 x speed up from XOP FF  
  XOP Func + XOP Smear Time:       4.4133e+05= 4.08 * Cylinder Form XOP  ||0.88306 x speed up from XOP smearing || 9.5111 x overall  
  ------------------------------------------------  
  Cyl PR - IGOR no smear:          4.3741e+06  
  Cyl PR- XOP no smear:            2.6758e+05= 16.347 x speed up from XOP FF  
  IGOR Func + IGOR Smear Time:     8.6862e+07= 19.858 * Cyl PR Form  
  XOP Func + IGOR Smear Time:      5.3737e+06= 20.082 * Cyl PR Form XOP  || 16.164 x speed up from XOP FF  
  XOP Func + XOP Smear Time:       5.3356e+06= 19.94 * Cylinder Form XOP  ||1.0071 x speed up from XOP smearing || 16.28 x overall  
  ------------------------------------------------  
  USANS  
    
  CylinderForm - IGOR no smear:    62444  
  CylinderForm - XOP no smear:     3768.9= 16.568 x speed up from XOP FF  
  IGOR Func + IGOR Smear Time:     1.239e+08= 1984.1 * Cylinder Form  
  XOP Func + IGOR Smear Time:      9.8457e+06= 2612.3 * Cylinder Form XOP  || 12.584 x speed up from XOP FF  
  XOP Func + XOP Smear Time:       5.3249e+06= 1412.8 * Cylinder Form XOP  ||1.849 x speed up from XOP smearing || 23.268 x overall  
  ------------------------------------------------  
  Cyl PR - IGOR no smear:          1.3394e+06  
  Cyl PR- XOP no smear:            65055= 20.589 x speed up from XOP FF  
  IGOR Func + IGOR Smear Time:     1.6274e+09= 1215 * Cyl PR Form  
  XOP Func + IGOR Smear Time:      9.3955e+07= 1444.2 * Cyl PR Form XOP  || 17.321 x speed up from XOP FF  
  XOP Func + XOP Smear Time:       5.3737e+07= 826.02 * Cyl PR Form XOP  ||1.7484 x speed up from XOP smearing || 30.285 x overall  

comment:7 Changed 15 years ago by ajj

Yet another set of "correct" numbers. Found bug in trapezoidal integration routine courtesy of Lionel - speedup now more consistent between SANS and USANS. Also note that now we see *no* speed up from putting the smearing in the XOP.

Clearly the matrix method is called for to get real speed gains.

  ---------------   Speed Test Results    -----------------
  SANS
  CylinderForm - IGOR no smear:    45807
  CylinderForm - XOP no smear:     8905.5= 5.1437 x speed up from XOP FF
  IGOR Func + IGOR Smear Time:     9.2656e+05= 20.228 * Cylinder Form
  XOP Func + IGOR Smear Time:      1.9259e+05= 21.626 * Cylinder Form XOP  || 4.811 x speed up from XOP FF
  XOP Func + XOP Smear Time:        1.8344e+05= 20.599 * Cylinder Form XOP  ||1.0499 x speed up from XOP smearing || 5.0509 x overall
  ------------------------------------------------
  Cyl PR - IGOR no smear:               9.5105e+05
  Cyl PR- XOP no smear:                 1.532e+05= 6.2078 x speed up from XOP FF
  IGOR Func + IGOR Smear Time:    1.9108e+07= 20.091 * Cyl PR Form
  XOP Func + IGOR Smear Time:     3.0789e+06= 20.097 * Cyl PR Form XOP  || 6.2059 x speed up from XOP FF
  XOP Func + XOP Smear Time:      3.073e+06= 20.058 * Cylinder Form XOP  ||1.0019 x speed up from XOP smearing || 6.2179 x overall
  ------------------------------------------------
  USANS
  CylinderForm - IGOR no smear:    13761
  CylinderForm - XOP no smear:     1999.1= 6.8834 x speed up from XOP FF
  IGOR Func + IGOR Smear Time:     2.7542e+07= 2001.5 * Cylinder Form
  XOP Func + IGOR Smear Time:      5.3232e+06= 2662.8 * Cylinder Form XOP  || 5.174 x speed up from XOP FF
  XOP Func + XOP Smear Time:        5.312e+06= 2657.2 * Cylinder Form XOP  ||1.0021 x speed up from XOP smearing || 5.1848 x overall
  ------------------------------------------------
  Cyl PR - IGOR no smear:               2.8602e+05
  Cyl PR- XOP no smear:                 39069= 7.321 x speed up from XOP FF
  IGOR Func + IGOR Smear Time:    3.5158e+08= 1229.2 * Cyl PR Form
  XOP Func + IGOR Smear Time:     5.4678e+07= 1399.5 * Cyl PR Form XOP  || 6.4299 x speed up from XOP FF
  XOP Func + XOP Smear Time:      5.4151e+07= 1386 * Cyl PR Form XOP  ||1.0097 x speed up from XOP smearing || 6.4925 x overall

comment:8 Changed 15 years ago by ajj

Have put the matrix calculation into branch of the analysis code ( changeset [138] ). Timings suggest that this will only take a few seconds to run each time a data set is loaded. This is not an untolerable burden on users, so we will demote XOPising this to the bottom of the pile.

Given that the SANS smearing calc doesn't seem to be significantly faster in XOP than in IGOR, it might be easiest to keep both in Igor.

comment:9 Changed 15 years ago by ajj

  • Resolution set to fixed
  • Status changed from assigned to closed

The smearing code in in XOP and matrix code in IGOR. Will close this ticket as the ticket details have been met.

Note: See TracTickets for help on using tickets.