Changeset 455
- Timestamp:
- Nov 24, 2008 12:54:13 PM (14 years ago)
- Location:
- sans/Dev/trunk/NCNR_User_Procedures
- Files:
-
- 6 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) -
sans/Dev/trunk/NCNR_User_Procedures/Analysis/Packages/ModelPicker/SANSModelPicker_v40.ipf
r449 r455 563 563 564 564 Variable num=numpnts(selToDel),ii 565 String fname="" 565 String fname="",funcToDelStr="" 566 566 567 567 ii=num-1 //work backwards … … 575 575 //delete the point 576 576 DeletePoints ii, 1, includedFileWave,selToDel 577 // 578 // be sure to kill the dependencies, otherwise some nasty crashes can result 579 // (a bug in the WM's threading??? 580 funcToDelStr = FunctionList("*",";","WIN:"+fname+fileVerExt+".ipf") 581 KillAllDependentObjects("root:",funcToDelStr, 1, 1, 0) 582 577 583 endif 578 584 ii-=1 579 585 while(ii>=0) 580 // Execute/P "COMPILEPROCEDURES ";Execute/P/Q/Z "RefreshMenu()"581 586 Execute/P "COMPILEPROCEDURES " 582 587 … … 586 591 Sort filewave,filewave 587 592 return(0) 593 End 594 595 Function KillDependentVariables(folderStr,funcToDelStr) 596 String folderStr,funcToDelStr 597 598 String objName,formStr,funcStr,matchStr 599 Variable index = 0,loc 600 601 do 602 objName = GetIndexedObjName(folderStr, 2, index) 603 if (strlen(objName) == 0) 604 break 605 endif 606 formStr = GetFormula($(folderStr+objName)) 607 if(strlen(formStr) != 0) 608 loc = strsearch(formStr,"(",0) 609 funcStr = formStr[0,loc-1] 610 // Print objName,funcStr 611 matchStr = ListMatch(funcToDelStr, funcStr ,";") 612 if(strlen(matchStr) != 0) 613 SetFormula $(folderStr+objName),"" //kill the dependency 614 Printf "killed the dependency of %s on the function %s\r",folderStr+objName,matchStr 615 endif 616 617 endif 618 619 index += 1 620 while(1) 621 End 622 623 624 625 // doesn't really kill all objects... 626 // kills the dependency formula for any variable that has a formula that contains a function name 627 // that matches anything in the funcToDelStr, which are functions that are about to be removed 628 // from the experiment by DELETEINCLUDE 629 // 630 // recursively looks through all data folders 631 // 632 // on the first call: 633 // pass "root:" as the pathName 634 // full = 1 635 // recurse = 1 636 // level = 0 637 // 638 Function KillAllDependentObjects(pathName,funcToDelStr, full, recurse, level) 639 String pathName // Name of symbolic path in which to look for folders. 640 String funcToDelStr //list of functions to look for 641 Variable full // True to print full paths instead of just folder name. 642 Variable recurse // True to recurse (do it for subfolders too). 643 Variable level // Recursion level. Pass 0 for the top level. 644 645 Variable ii 646 String prefix 647 648 // SVAR allFiles=root:Packages:NIST:FileList:allFiles 649 // Build a prefix (a number of tabs to indicate the folder level by indentation) 650 prefix = "" 651 ii = 0 652 do 653 if (ii >= level) 654 break 655 endif 656 prefix += "\t" // Indent one more tab 657 ii += 1 658 while(1) 659 660 // Printf "%s%s\r", prefix, pathName 661 // Print IndexedFile($pathName,-1,"????") 662 //allFiles += IndexedFile($pathName,-1,"????") 663 664 KillDependentVariables(pathName,funcToDelStr) 665 666 String path 667 ii = 0 668 do 669 path = GetIndexedObjName(pathName, 4, ii) 670 if (strlen(path) == 0) 671 break // No more folders 672 endif 673 path = pathName+path+":" //the full path 674 // Print "ii, path = ",ii,path 675 676 if (recurse) // Do we want to go into subfolder? 677 KillAllDependentObjects(path, funcToDelStr, full, recurse, level+1) 678 endif 679 680 ii += 1 681 while(1) 588 682 End 589 683 -
sans/Dev/trunk/NCNR_User_Procedures/Common/NCNR_Package_Loader.ipf
r451 r455 39 39 SVAR gMenuStr1b = root:Packages:NCNRItemStr1b 40 40 41 String SANSAna_WinList = "wrapperPanel;Procedure_List; "41 String SANSAna_WinList = "wrapperPanel;Procedure_List;Report;" 42 42 strswitch(itemStr) // string switch 43 43 case "Load NCNR Analysis Macros": … … 121 121 SVAR gMenuStr2b = root:Packages:NCNRItemStr2b 122 122 123 String SANSRed_WinList = "Main_Panel;CatVSTable;" 123 String SANSRed_WinList = "Main_Panel;CatVSTable;SANS_Data;Plot_Manager;Average_Panel;Plot_1d;CatWin;Surface_3D;FitPanel;FitWindow;" 124 SANSRed_WinList += "FitRPAPanel;SANS_Histo;drawMaskWin;Multiple_Reduce_Panel;NSORT_Panel;NSORT_Graph;CombineTable;ToCombine;Patch_Panel;" 125 SANSRed_WinList += "ProtocolPanel;Schematic_Layout;Tile_2D;RAW_to_ASCII;Trans_Panel;TransFileTable;ScatterFileTable;Convert_to_Trans;" 126 SANSRed_WinList += "WorkFileMath;Pref_Panel;Subtract_1D_Panel;Plot_Sub1D;SASCALC;MC_SASCALC;Saved_Configurations;TISANE;" 124 127 strswitch(itemStr) // string switch 125 128 case "Load NCNR SANS Reduction Macros": … … 187 190 SVAR gMenuStr3b = root:Packages:NCNRItemStr3b 188 191 189 String USANS_WinList = "USANS_Panel;COR_Graph;RawDataWin;Desmear_Graph; "192 String USANS_WinList = "USANS_Panel;COR_Graph;RawDataWin;Desmear_Graph;USANS_Slope;" 190 193 191 194 strswitch(itemStr) // string switch -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/MultScatter_MonteCarlo_2D.ipf
r454 r455 572 572 Integrate/METH=1 Gq/D=Gq_INT 573 573 574 SASxs = lam*lam/2/pi*Gq_INT[nPts_ran-1] 574 // SASxs = lam*lam/2/pi*Gq_INT[nPts_ran-1] //if the approximation is used 575 SASxs = lam*Gq_INT[nPts_ran-1] 575 576 576 577 Gq_INT /= Gq_INT[nPts_ran-1] … … 687 688 list = RemoveFromList("BinaryHS_PSF11;BinaryHS_PSF12;BinaryHS_PSF22;EllipCyl_Integrand;PP_Inner;PP_Outer;Phi_EC;TaE_Inner;TaE_Outer;",list,";") 688 689 //////////////// 690 691 //more functions from analysis models (2008) 692 tmp = "Barbell_Inner;Barbell_Outer;Barbell_integrand;BCC_Integrand;Integrand_BCC_Inner;Integrand_BCC_Outer;" 693 list = RemoveFromList(tmp, list ,";") 694 tmp = "CapCyl;CapCyl_Inner;CapCyl_Outer;ConvLens;ConvLens_Inner;ConvLens_Outer;" 695 list = RemoveFromList(tmp, list ,";") 696 tmp = "Dumb;Dumb_Inner;Dumb_Outer;FCC_Integrand;Integrand_FCC_Inner;Integrand_FCC_Outer;" 697 list = RemoveFromList(tmp, list ,";") 698 tmp = "Integrand_SC_Inner;Integrand_SC_Outer;SC_Integrand;SphCyl;SphCyl_Inner;SphCyl_Outer;" 699 list = RemoveFromList(tmp, list ,";") 689 700 690 701 //simplify the display, forcing smeared calculations behind the scenes
Note: See TracChangeset
for help on using the changeset viewer.