Changeset 1091


Ignore:
Timestamp:
Oct 9, 2013 9:49:58 AM (8 years ago)
Author:
toby
Message:

randomize parallel processes for MC/SA

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIImath.py

    r1083 r1091  
    24192419        return best_state.x, retval
    24202420
    2421 def worker(iCyc,data,RBdata,reflType,reflData,covData,out_q):
     2421def worker(iCyc,data,RBdata,reflType,reflData,covData,out_q,nprocess=-1):
    24222422    outlist = []
     2423    if nprocess>0: random.random(100*nprocess) # compute some extra numbers to change the state
    24232424    for n in range(iCyc):
    24242425        result = mcsaSearch(data,RBdata,reflType,reflData,covData,None)
     
    24372438        iCyc[i%nprocs] += 1
    24382439    for i in range(nprocs):
    2439         p = mp.Process(target=worker,args=(int(iCyc[i]),data,RBdata,reflType,reflData,covData,out_q))
     2440        p = mp.Process(target=worker,args=(int(iCyc[i]),data,RBdata,reflType,reflData,covData,out_q,i))
    24402441        procs.append(p)
    24412442        p.start()
Note: See TracChangeset for help on using the changeset viewer.