This commit is contained in:
Raffaele Mignone 2021-03-26 17:37:13 +01:00
parent 4f03fc2d5b
commit 0637fcdba1
Signed by: norangebit
GPG Key ID: F5255658CB220573
1 changed files with 5 additions and 0 deletions

5
main.c
View File

@ -4,6 +4,7 @@
#include "util.h"
#include <mpi.h>
#include <malloc.h>
#include <papi.h>
#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);
}
}