Changeset 185 for sans/Analysis/branches/ajj_23APR07/IGOR_Package_Files/Put in User Procedures/SANS_Models_v3.00/Models_2D
 Timestamp:
 Oct 23, 2007 5:13:28 PM (15 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

sans/Analysis/branches/ajj_23APR07/IGOR_Package_Files/Put in User Procedures/SANS_Models_v3.00/Models_2D/Cylinder_2D.ipf
r182 r185 76 76 parameters_Cyl2D[7] = "Sigma of polydisp in Theta [rad]" 77 77 parameters_Cyl2D[8] = "Sigma of polydisp in Phi [rad]" 78 parameters_Cyl2D[9] = "Sigma of polydisp in Radius [A ngstroem]"78 parameters_Cyl2D[9] = "Sigma of polydisp in Radius [A]" 79 79 80 80 Edit parameters_Cyl2D,coef_Cyl2D … … 114 114 // simply calls the original single point calculation with 115 115 // a wave assignment (this will behave nicely if given point ranges) 116 // 117 // NONTHREADED IMPLEMENTATION 118 // 119 //Function Cylinder2D(cw,zw,yw,xw) : FitFunc 120 // Wave cw,zw,yw,xw 121 // 122 //#if exists("Cylinder_2D_Dist") 123 // zw = Cylinder_2D_Dist(cw,yw,xw) 124 //#else 125 // Abort "You do not have the SANS Analysis XOP installed" 126 //#endif 127 // return(0) 128 //End 129 // 130 131 //threaded version of the function 132 ThreadSafe Function Cylinder2D_T(cw,zw,yw,xw,p1,p2) 133 WAVE cw,zw,yw,xw 134 Variable p1,p2 135 136 zw[p1,p2]= Cylinder_2D_Dist(cw,yw,xw) 137 138 // return stopMSTimer(2) // time when we finished 139 return 0 140 End 141 142 //function that is actually a wrapper to dispatch the calculation to N threads 143 // 116 144 Function Cylinder2D(cw,zw,yw,xw) : FitFunc 117 145 Wave cw,zw,yw,xw 118 146 119 #if exists("Cylinder_2D_Dist") 120 zw = Cylinder_2D_Dist(cw,yw,xw) 121 #else 122 Abort "You do not have the SANS Analysis XOP installed" 123 #endif 147 Variable npt=numpnts(yw) 148 Variable i,nthreads= ThreadProcessorCount 149 variable mt= ThreadGroupCreate(nthreads) 150 151 for(i=0;i<nthreads;i+=1) 152 // Print (i*npt/nthreads),((i+1)*npt/nthreads1) 153 ThreadStart mt,i,Cylinder2D_T(cw,zw,yw,xw,(i*npt/nthreads),((i+1)*npt/nthreads1)) 154 endfor 155 156 do 157 variable tgs= ThreadGroupWait(mt,100) 158 while( tgs != 0 ) 159 160 variable dummy= ThreadGroupRelease(mt) 161 124 162 return(0) 125 163 End
Note: See TracChangeset
for help on using the changeset viewer.