File tree Expand file tree Collapse file tree 1 file changed +19
-8
lines changed
package/MDAnalysis/analysis/encore Expand file tree Collapse file tree 1 file changed +19
-8
lines changed Original file line number Diff line number Diff line change @@ -171,14 +171,25 @@ def conformational_distance_matrix(ensemble,
171171 # Initialize workers. Simple worker doesn't perform fitting,
172172 # fitter worker does.
173173 indices = trm_indices ((0 , 0 ), (framesn - 1 , framesn - 1 ))
174- Parallel (n_jobs = n_jobs , verbose = verbose , require = 'sharedmem' ,
175- max_nbytes = max_nbytes )(delayed (conf_dist_function )(
176- np .int64 (element ),
177- rmsd_coordinates ,
178- distmat ,
179- weights ,
180- fitting_coordinates ,
181- subset_weights ) for element in indices )
174+ if n_jobs == 1 :
175+ for element in indices :
176+ conf_dist_function (np .int64 (element ),
177+ rmsd_coordinates ,
178+ distmat ,
179+ weights ,
180+ fitting_coordinates ,
181+ subset_weights )
182+ else :
183+ Parallel (n_jobs = n_jobs ,
184+ verbose = verbose ,
185+ require = 'sharedmem' ,
186+ max_nbytes = max_nbytes )(delayed (conf_dist_function )(
187+ np .int64 (element ),
188+ rmsd_coordinates ,
189+ distmat ,
190+ weights ,
191+ fitting_coordinates ,
192+ subset_weights ) for element in indices )
182193
183194
184195 # When the workers have finished, return a TriangularMatrix object
You can’t perform that action at this time.
0 commit comments