Skip to content

Commit

Permalink
fixed some bugs in MPI running when rank != 0
Browse files Browse the repository at this point in the history
  • Loading branch information
ejhigson committed May 17, 2018
1 parent 4cbc9fc commit 19d2722
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions dyPolyChord/run_dynamic_ns.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,10 @@ def run_dypolychord(run_polychord, dynamic_goal, settings_dict_in, **kwargs):
# We definitely won't need to resume midway through in this case, so
# just run PolyChod normally
run_polychord(settings_dict, comm=comm)
final_seed = settings_dict['seed']
if settings_dict['seed'] >= 0:
final_seed += seed_increment
if rank == 0:
final_seed = settings_dict['seed']
if settings_dict['seed'] >= 0:
final_seed += seed_increment
else:
step_ndead, resume_outputs, final_seed = run_and_save_resumes(
run_polychord, settings_dict, init_step, seed_increment, comm=comm)
Expand Down Expand Up @@ -369,4 +370,11 @@ def run_and_save_resumes(run_polychord, settings_dict_in, init_step,
root_name + '_' + str(step_ndead[-1]) + '.resume')
if comm is not None:
add_points = comm.bcast(add_points, root=0)
return step_ndead, resume_outputs, settings_dict['seed']
if rank == 0:
final_seed = settings_dict['seed']
else:
# Define variables for other ranks
step_ndead = None
resume_outputs = None
final_seed = None
return step_ndead, resume_outputs, final_seed

0 comments on commit 19d2722

Please sign in to comment.