diff --git a/main.c b/main.c index b672ba2..c98249c 100644 --- a/main.c +++ b/main.c @@ -4,6 +4,7 @@ #include "util.h" #include #include +#include #define MASTER 0 #define DEFAULT_TAG 17 @@ -56,6 +57,7 @@ int main() { int lps[pattern_len]; create_lps(pattern, pattern_len, lps); + long_long start_time = PAPI_get_real_usec(); // search for matches int match_number = 0; int residue; @@ -69,12 +71,15 @@ int main() { collect_results(&match_number, matches); + long_long end_time = PAPI_get_real_usec(); + MPI_Finalize(); if (rank == MASTER) { printf("total matches: %d\n", total_match_number); printf("matches index: "); print_array(total_matches, total_match_number); + printf("elapsed: %d\n", end_time - start_time); } }