diff --git a/exercise4/wave_2d_parallel.c b/exercise4/wave_2d_parallel.c index bffb5ef..bfe57b7 100644 --- a/exercise4/wave_2d_parallel.c +++ b/exercise4/wave_2d_parallel.c @@ -276,7 +276,18 @@ int main(int argc, char **argv) { // TASK: T2 // Time your code // BEGIN: T2 + if (world_rank == ROOT) + gettimeofday(&t_start, NULL); + simulate(); + // MPI_Barrier(MPI_COMM_WORLD); // TODO + + if (world_rank == ROOT) { + gettimeofday(&t_end, NULL); + + printf("Total elapsed time: %lf seconds\n", + WALLTIME(t_end) - WALLTIME(t_start)); + } // END: T2 // Clean up and shut down