Ignore:
Timestamp:
Nov 24, 2008 12:54:13 PM (14 years ago)
Author:
srkline
Message:

Two changes: (1) remove threading of Cyl-PolyRad? model until WM can fix the crashing bug related to compiling/threadsafe...
(2) fixed bug in the calculation of the random deviate for MC calculations. The wrong scattering cross section was calculated depending on wavelength. This has been corrected.

Location:
sans/Dev/trunk/NCNR_User_Procedures/Analysis/Models
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • sans/Dev/trunk/NCNR_User_Procedures/Analysis/Models/NewModels_2006/Cylinder_PolyRadius_v40.ipf

    r379 r455  
    290290Function Cyl_PolyRadius(cw,yw,xw) : FitFunc 
    291291        Wave cw,yw,xw 
    292          
    293 #if exists("Cyl_PolyRadiusX") 
    294  
    295         Variable npt=numpnts(yw) 
    296         Variable i,nthreads= ThreadProcessorCount 
    297         variable mt= ThreadGroupCreate(nthreads) 
    298292 
    299293//      Variable t1=StopMSTimer(-2) 
    300          
    301         for(i=0;i<nthreads;i+=1) 
    302         //      Print (i*npt/nthreads),((i+1)*npt/nthreads-1) 
    303                 ThreadStart mt,i,Cyl_PolyRadius_T(cw,yw,xw,(i*npt/nthreads),((i+1)*npt/nthreads-1)) 
    304         endfor 
    305  
    306         do 
    307                 variable tgs= ThreadGroupWait(mt,100) 
    308         while( tgs != 0 ) 
    309  
    310         variable dummy= ThreadGroupRelease(mt) 
    311          
     294 
     295///////NON-THREADED VERSION /////// 
     296#if exists("Cyl_PolyRadiusX")    
     297        yw = Cyl_PolyRadiusX(cw,xw) 
     298#else 
     299        yw = fCyl_PolyRadius(cw,xw) 
     300#endif 
     301 
     302/// THREADED VERSION HAS BEEN REMOVED DUE TO CRASHES //////      
     303//#if exists("Cyl_PolyRadiusX") 
     304// 
     305//      Variable npt=numpnts(yw) 
     306//      Variable i,nthreads= ThreadProcessorCount 
     307//      variable mt= ThreadGroupCreate(nthreads) 
     308// 
     309//      for(i=0;i<nthreads;i+=1) 
     310//      //      Print (i*npt/nthreads),((i+1)*npt/nthreads-1) 
     311//              ThreadStart mt,i,Cyl_PolyRadius_T(cw,yw,xw,(i*npt/nthreads),((i+1)*npt/nthreads-1)) 
     312//      endfor 
     313// 
     314//      do 
     315//              variable tgs= ThreadGroupWait(mt,100) 
     316//      while( tgs != 0 ) 
     317// 
     318//      variable dummy= ThreadGroupRelease(mt) 
     319//       
     320//#else 
     321//              yw = fCyl_PolyRadius(cw,xw)             //the Igor, non-XOP, non-threaded calculation, messy to make ThreadSafe 
     322//#endif 
     323 
    312324//      Print "elapsed time = ",(StopMSTimer(-2) - t1)/1e6 
    313          
    314 #else 
    315                 yw = fCyl_PolyRadius(cw,xw)             //the Igor, non-XOP, non-threaded calculation 
    316 #endif 
     325 
    317326        return(0) 
    318327End 
  • sans/Dev/trunk/NCNR_User_Procedures/Analysis/Models/NewModels_2008/BCC_ParaCrystal_v40.ipf

    r451 r455  
    9797End 
    9898 
    99  
    100 // nothing to change here 
    101 // 
    102 //AAO version, uses XOP if available 
    103 // simply calls the original single point calculation with 
    104 // a wave assignment (this will behave nicely if given point ranges) 
     99// Threaded version 
     100// Threaded XOP = 2.4 s 
     101// non-threaded, non-XOP = 46.8 s 
     102// = x 19.5 speedup ! 
     103// 
    105104Function BCC_ParaCrystal(cw,yw,xw) : FitFunc 
    106105        Wave cw,yw,xw 
    107          
     106 
     107///// NO threading ///////// 
    108108#if exists("BCC_ParaCrystalX") 
    109109        yw = BCC_ParaCrystalX(cw,xw) 
     
    111111        yw = fBCC_ParaCrystal(cw,xw) 
    112112#endif 
     113 
     114 
     115/// THREADING /////// 
     116 
     117////    Variable t1=StopMSTimer(-2) 
     118//               
     119//#if exists("BCC_ParaCrystalX") 
     120// 
     121//      Variable npt=numpnts(yw) 
     122//      Variable i,nthreads= ThreadProcessorCount 
     123//      variable mt= ThreadGroupCreate(nthreads) 
     124// 
     125//      for(i=0;i<nthreads;i+=1) 
     126//      //      Print (i*npt/nthreads),((i+1)*npt/nthreads-1) 
     127//              ThreadStart mt,i,BCC_ParaCrystal_T(cw,yw,xw,(i*npt/nthreads),((i+1)*npt/nthreads-1)) 
     128//      endfor 
     129// 
     130//      do 
     131//              variable tgs= ThreadGroupWait(mt,100) 
     132//      while( tgs != 0 ) 
     133// 
     134//      variable dummy= ThreadGroupRelease(mt) 
     135//       
     136//#else 
     137//              yw = fBCC_ParaCrystal(cw,xw)            //the Igor, non-XOP, non-threaded calculation, messy to make ThreadSafe 
     138//#endif 
     139// 
     140////    Print "elapsed time = ",(StopMSTimer(-2) - t1)/1e6 
     141 
     142 
     143 
     144        return(0) 
     145End 
     146 
     147 
     148 
     149// nothing to change here 
     150// 
     151//AAO version, uses XOP if available 
     152// simply calls the original single point calculation with 
     153// a wave assignment (this will behave nicely if given point ranges) 
     154// 
     155// Threaded Version 
     156ThreadSafe Function BCC_ParaCrystal_T(cw,yw,xw,p1,p2) : FitFunc 
     157        Wave cw,yw,xw 
     158        Variable p1,p2 
     159 
     160//      Variable t1=StopMSTimer(-2) 
     161 
     162#if exists("BCC_ParaCrystalX") 
     163        yw[p1,p2] = BCC_ParaCrystalX(cw,xw) 
     164#else 
     165        yw[p1,p2] = fBCC_ParaCrystal(cw,xw) 
     166#endif 
     167 
     168//      Print "elapsed time = ",(StopMSTimer(-2) - t1)/1e6 
     169 
    113170        return(0) 
    114171End 
  • sans/Dev/trunk/NCNR_User_Procedures/Analysis/Models/NewModels_2008/FCC_ParaCrystal_v40.ipf

    r451 r455  
    271271 
    272272//      the name of your unsmeared model (AAO) is the first argument 
    273         Smear_Model_76(FCC_ParaCrystal,s.coefW,s.xW,s.yW,s.resW) 
     273        Smear_Model_20(FCC_ParaCrystal,s.coefW,s.xW,s.yW,s.resW) 
    274274 
    275275        return(0) 
Note: See TracChangeset for help on using the changeset viewer.