ex3: task 2

This commit is contained in:
2025-09-22 16:43:45 +02:00
parent ad41c944b3
commit 90dbc4e177

View File

@@ -160,7 +160,17 @@ int main(int argc, char **argv) {
// TASK: T2
// Time your code
// BEGIN: T2
if (comm_rank == ROOT)
gettimeofday(&t_start, NULL);
simulate();
MPI_Barrier(MPI_COMM_WORLD);
if (comm_rank == ROOT) {
gettimeofday(&t_end, NULL);
printf("Total elapsed time: %lf seconds\n",
WALLTIME(t_end) - WALLTIME(t_start));
}
// END: T2
domain_finalize();