Skip to content

Commit a3cb751

Browse files
committed
Fix failure for OPTIMIZED parallel evaluation.
When parallel calculation is done multiple times with the same calculator object the second and subsequent results are zero because of OPTIMIZED evaluation. Solution: Always use a copy of calculator object for partial job.
1 parent 23cc44b commit a3cb751

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

diffpy/srreal/parallel.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,8 @@ def _parallelData(kwd):
167167
'''Helper for calculating and fetching raw results from a worker node.
168168
'''
169169
pqobj = kwd['pqobj']
170+
if pqobj.evaluatortype == 'OPTIMIZED':
171+
pqobj = copy.copy(pqobj)
170172
pqobj._setupParallelRun(kwd['cpuindex'], kwd['ncpu'])
171173
pqobj.eval()
172174
return pqobj._getParallelData()

0 commit comments

Comments
 (0)