diff --git a/osu_benchmarks/mpi/pt2pt/osu_latency.c b/osu_benchmarks/mpi/pt2pt/osu_latency.c index 9437f2e..e98699b 100644 --- a/osu_benchmarks/mpi/pt2pt/osu_latency.c +++ b/osu_benchmarks/mpi/pt2pt/osu_latency.c @@ -133,39 +133,39 @@ main (int argc, char *argv[]) t_total = 0.0; for (i = 0; i < options.iterations + options.skip; i++) { -#ifdef _ENABLE_CUDA_ - if (options.src == 'M') { - touch_managed_src(s_buf, size); - } else if (options.dst == 'M') { - touch_managed_dst(s_buf, size); - } -#endif if (myid == 0) { if (i >= options.skip) { t_start = MPI_Wtime(); } - +#ifdef _ENABLE_CUDA_ + if (options.src == 'M') { + touch_managed_src(s_buf, size); + } +#endif MPI_CHECK(MPI_Send(s_buf, size, MPI_CHAR, 1, 1, MPI_COMM_WORLD)); MPI_CHECK(MPI_Recv(r_buf, size, MPI_CHAR, 1, 1, MPI_COMM_WORLD, &reqstat)); #ifdef _ENABLE_CUDA_ if (options.src == 'M') { - touch_managed_src(r_buf, size); + touch_managed_dst(r_buf, size); } #endif - if (i >= options.skip) { t_end = MPI_Wtime(); t_total += calculate_total(t_start, t_end, t_lo); } } else if (myid == 1) { +#ifdef _ENABLE_CUDA_ + if (options.dst == 'M') { + touch_managed_src(s_buf, size); + } +#endif MPI_CHECK(MPI_Recv(r_buf, size, MPI_CHAR, 0, 1, MPI_COMM_WORLD, &reqstat)); #ifdef _ENABLE_CUDA_ if (options.dst == 'M') { touch_managed_dst(r_buf, size); } #endif - MPI_CHECK(MPI_Send(s_buf, size, MPI_CHAR, 0, 1, MPI_COMM_WORLD)); } }