Advertisement
Bernard0x01

Untitled

Apr 18th, 2019
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.51 KB | None | 0 0
  1. for (i = 0; i < num_trials; i++) {
  2.   MPI_Barrier(MPI_COMM_WORLD);
  3.   total_my_bcast_time -= MPI_Wtime();
  4.   my_bcast(data, num_elements, MPI_INT, 0, MPI_COMM_WORLD);
  5.   // Synchronize again before obtaining final time
  6.   MPI_Barrier(MPI_COMM_WORLD);
  7.   total_my_bcast_time += MPI_Wtime();
  8.  
  9.   // Time MPI_Bcast
  10.   MPI_Barrier(MPI_COMM_WORLD);
  11.   total_mpi_bcast_time -= MPI_Wtime();
  12.   MPI_Bcast(data, num_elements, MPI_INT, 0, MPI_COMM_WORLD);
  13.   MPI_Barrier(MPI_COMM_WORLD);
  14.   total_mpi_bcast_time += MPI_Wtime();
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement