Add new time

This commit is contained in:
Raffaele Mignone 2021-03-27 14:52:53 +01:00
parent e9349bdcae
commit 0e089bb00a
Signed by: norangebit
GPG Key ID: F5255658CB220573

View File

@ -66,6 +66,9 @@ int main(int argc, char **argv) {
int *matches = search_pattern(private_text, pattern, lps, &match_number, &residue); int *matches = search_pattern(private_text, pattern, lps, &match_number, &residue);
search_for_splitted_pattern(&residue, &match_number, &matches); search_for_splitted_pattern(&residue, &match_number, &matches);
#ifdef TIME
long_long stop_search = PAPI_get_real_usec();
#endif
//free(private_text); //free(private_text);
@ -75,6 +78,10 @@ int main(int argc, char **argv) {
printf("%d -> result number: %d\n", rank, match_number); printf("%d -> result number: %d\n", rank, match_number);
#endif #endif
#ifdef TIME
long_long start_collect = PAPI_get_real_usec();
#endif
collect_results(&match_number, matches); collect_results(&match_number, matches);
#ifdef TIME #ifdef TIME
@ -92,7 +99,8 @@ int main(int argc, char **argv) {
#ifdef TIME #ifdef TIME
printf("total elapsed: %d\n", end_time - start_time); printf("total elapsed: %d\n", end_time - start_time);
printf("search elapsed: %d\n", end_time - start_search); printf("search elapsed: %d\n", stop_search - start_search);
printf("collect elapsed: %d\n", end_time - start_collect);
#endif #endif
} }
} }