Changeset 455 for sans/Dev/trunk/NCNR_User_Procedures/Analysis/Models
- Timestamp:
- Nov 24, 2008 12:54:13 PM (14 years ago)
- 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 290 290 Function Cyl_PolyRadius(cw,yw,xw) : FitFunc 291 291 Wave cw,yw,xw 292 293 #if exists("Cyl_PolyRadiusX")294 295 Variable npt=numpnts(yw)296 Variable i,nthreads= ThreadProcessorCount297 variable mt= ThreadGroupCreate(nthreads)298 292 299 293 // 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 312 324 // 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 317 326 return(0) 318 327 End -
sans/Dev/trunk/NCNR_User_Procedures/Analysis/Models/NewModels_2008/BCC_ParaCrystal_v40.ipf
r451 r455 97 97 End 98 98 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 // 105 104 Function BCC_ParaCrystal(cw,yw,xw) : FitFunc 106 105 Wave cw,yw,xw 107 106 107 ///// NO threading ///////// 108 108 #if exists("BCC_ParaCrystalX") 109 109 yw = BCC_ParaCrystalX(cw,xw) … … 111 111 yw = fBCC_ParaCrystal(cw,xw) 112 112 #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) 145 End 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 156 ThreadSafe 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 113 170 return(0) 114 171 End -
sans/Dev/trunk/NCNR_User_Procedures/Analysis/Models/NewModels_2008/FCC_ParaCrystal_v40.ipf
r451 r455 271 271 272 272 // 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) 274 274 275 275 return(0)
Note: See TracChangeset
for help on using the changeset viewer.