Skip to content

Commit

Permalink
add MPI_Barrier in mg_tune before and after MG update and after inver…
Browse files Browse the repository at this point in the history
…sion: this seems to help with MPI errors (truncated messages)
  • Loading branch information
kostrzewa committed Jul 19, 2024
1 parent 66fa8e8 commit 0c8d86f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions quda_interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -3014,16 +3014,20 @@ void quda_mg_tune_params(void * spinorOut, void * spinorIn, const int max_iter){
copy_quda_mg_tunable_params(&tunable_params[0], &cur_params);
print_tunable_params_pair(&cur_params, &tunable_params[0], mg_n_level);

MPI_Barrier(MPI_COMM_WORLD);
tm_stopwatch_push(&g_timers, "updateMultigridQuda", "");
updateMultigridQuda(quda_mg_preconditioner, &quda_mg_param);
tm_stopwatch_pop(&g_timers, 0, 1, "TM_QUDA");
MPI_Barrier(MPI_COMM_WORLD);
}

MPI_Barrier(MPI_COMM_WORLD);
tm_stopwatch_push(&g_timers, "invertQuda", "");
invertQuda(spinorOut, spinorIn, &inv_param);
tunable_params[0].tts = inv_param.secs;
tunable_params[0].iter = inv_param.iter;
tm_stopwatch_pop(&g_timers, 0, 1, "TM_QUDA");
MPI_Barrier(MPI_COMM_WORLD);

for(i = 1; i < quda_mg_tuning_plan.mg_tuning_iterations; i++){
// the best params from all previous iterations
Expand Down Expand Up @@ -3068,13 +3072,16 @@ void quda_mg_tune_params(void * spinorOut, void * spinorIn, const int max_iter){

print_tunable_params_pair(&cur_params, &tunable_params[i], mg_n_level);

MPI_Barrier(MPI_COMM_WORLD);
tm_stopwatch_push(&g_timers, "updateMultigridQuda", "");
updateMultigridQuda(quda_mg_preconditioner, &quda_mg_param);
tm_stopwatch_pop(&g_timers, 0, 1, "TM_QUDA");
MPI_Barrier(MPI_COMM_WORLD);

tm_stopwatch_push(&g_timers, "invertQuda", "");
invertQuda(spinorOut, spinorIn, &inv_param);
tm_stopwatch_pop(&g_timers, 0, 1, "TM_QUDA");
MPI_Barrier(MPI_COMM_WORLD);

tunable_params[i].tts = inv_param.secs;
tunable_params[i].iter = inv_param.iter;
Expand Down

0 comments on commit 0c8d86f

Please sign in to comment.