Fix MPI parallelization without processes_per_experiment
@@ -718,6 +718,11 @@ class ExperimentBuilder(object):
# until all of them are done.
completed = [False] # This is just to run the first iteration.
while not all(completed):
+ # Distribute experiments across MPI communicators if requested
+ if processes_per_experiment is None:
+ for exp in all_experiments:
+ self._run_experiment(exp)
+ else:
completed, experiment_indices = mpi.distribute(self._run_experiment,
distributed_args=all_experiments,
group_nodes=processes_per_experiment)
