Changeset 507 for MPbranch/GSASIIstruct.py
- Timestamp:
- Mar 1, 2012 3:21:29 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
MPbranch/GSASIIstruct.py
r496 r507 40 40 Controls = dictionary of control items 41 41 ''' 42 Controls = {'deriv type':'analytic Hessian','max cyc':3,'max Hprocess':1, 43 'max Rprocess':1,'min dM/M':0.0001,'shift factor':1.} 42 Controls = {'deriv type':'analytic Hessian','max cyc':3, 43 'max Hprocess':2, 44 'max Rprocess':1, 45 'min dM/M':0.0001,'shift factor':1.} 44 46 file = open(GPXfile,'rb') 45 47 while True: … … 2688 2690 2689 2691 def ComputePowderProfile(args): 2690 Histogram,parmdict,varylist,Phases,calcControls,pawleyLookup = args2692 Histogram,parmdict,varylist,Phases,calcControls,pawleyLookup,histkey = args 2691 2693 hId = Histogram['hId'] 2692 2694 hfx = ':%d:'%(hId) … … 2698 2700 varylist,Histogram,Phases,calcControls, 2699 2701 pawleyLookup) 2700 return xB,xF,yc,yb,Histogram['Reflection Lists'] 2702 return xB,xF,yc,yb,Histogram['Reflection Lists'],histkey 2701 2703 2702 2704 #def errRefine(values,HistoPhases,parmdict,varylist,calcControls,pawleyLookup,dlg): … … 2762 2764 Histogram = Histograms[histogram] 2763 2765 argList.append( 2764 [Histogram,parmdict,varylist,Phases,calcControls,pawleyLookup ]2766 [Histogram,parmdict,varylist,Phases,calcControls,pawleyLookup,histogram] 2765 2767 ) 2766 2768 if MaxProcess > 1: 2767 2769 mpPool = mp.Pool(processes=MaxProcess) 2768 #results = mpPool.map(ComputePowderProfile,argList) 2769 #for arg,res in zip(argList,results): 2770 #results = mpPool.map(ComputePowderProfile,argList) 2771 #for i,res in enumerate(results): 2772 for i,res in enumerate( 2773 mpPool.imap_unordered(ComputePowderProfile,argList) 2774 ): 2775 print 'process',i 2776 xB,xF,ycSect,ybSect,RL = res 2777 Histogram = argList[i][0] 2770 for (xB,xF,ycSect,ybSect,RL,histkey 2771 ) in mpPool.imap_unordered(ComputePowderProfile,argList): 2772 Histogram = Histograms[histkey] 2778 2773 Histogram['Reflection Lists'] = RL 2779 2774 x,y,w,yc,yb,yd = Histogram['Data'] … … 2796 2791 else: 2797 2792 for arg in argList: 2798 xB,xF,ycSect,ybSect,RL = ComputePowderProfile(arg)2793 xB,xF,ycSect,ybSect,RL,histkey = ComputePowderProfile(arg) 2799 2794 Histogram = arg[0] 2800 2795 hId = Histogram['hId'] … … 2970 2965 # file.close() 2971 2966 2967 ShowControls(Controls) 2968 print 'Last Refinement time = %8.3fs'%(runtime) 2972 2969 if dlg: 2973 2970 return Rwp
Note: See TracChangeset
for help on using the changeset viewer.