Changeset 3049


Ignore:
Timestamp:
Sep 5, 2017 4:20:31 PM (4 years ago)
Author:
toby
Message:

reset InitMP after SelectConfigSetting?.OnApplyChanges? to allow number of cores to change on the fly

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIctrlGUI.py

    r3024 r3049  
    41304130        GSASIIpath.SetConfigValue(self.vars)
    41314131        self.EndModal(wx.ID_OK)
     4132        import GSASIImpsubs as G2mp
     4133        G2mp.ResetMP()
    41324134       
    41334135    def OnSave(self,event):
     
    41374139        if not SaveConfigVars(self.vars,parent=self):
    41384140            self.OnApplyChanges() # force a reload of the config settings
     4141        else:
    41394142            self.EndModal(wx.ID_OK)
    41404143
  • trunk/GSASIImpsubs.py

    r3041 r3049  
    4343ncores = None
    4444
     45def ResetMP():
     46    '''Call after changing Config var 'Multiprocessing_cores' to force a resetting
     47    of the useMP from the parameter.
     48    '''
     49    global ncores
     50    ncores = None
     51   
    4552def InitMP(allowMP=True):
    4653    '''Called to initialize use of Multiprocessing
  • trunk/GSASIIstrMain.py

    r3041 r3049  
    140140def Refine(GPXfile,dlg=None,makeBack=True):
    141141    'Global refinement -- refines to minimize against all histograms'
     142    import GSASIImpsubs as G2mp
     143    G2mp.InitMP()
    142144    import pytexture as ptx
    143145    ptx.pyqlmninit()            #initialize fortran arrays for spherical harmonics
     
    264266    one at a time
    265267    '''
     268    import GSASIImpsubs as G2mp
     269    G2mp.InitMP()
    266270    import pytexture as ptx
    267271    ptx.pyqlmninit()            #initialize fortran arrays for spherical harmonics
     
    756760
    757761def main():
    758     'Needs a doc string'
     762    'Called to run a refinement when this module is executed '
    759763    starttime = time.time()
    760764    arg = sys.argv
     
    764768            print 'ERROR - ',GPXfile," doesn't exist!"
    765769            exit()
    766         Refine(GPXfile,None)
    767770    else:
    768771        print 'ERROR - missing filename'
    769772        exit()
     773    # TODO: figure out if this is a sequential refinement and call SeqRefine(GPXfile,None)
     774    Refine(GPXfile,None)
    770775    print("Done. Execution time {:.2f} sec.".format(time.time()-starttime))
    771776
Note: See TracChangeset for help on using the changeset viewer.