From e66e195e7c175c738d0f11ba6d42eb4273f33b94 Mon Sep 17 00:00:00 2001 From: Matt Strapp Date: Tue, 6 Oct 2020 08:26:44 -0500 Subject: Add another define Increase buffer size --- P1/include/utils.h | 3 ++- P1/src/mapper.c | 2 +- P1/src/reducer.c | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/P1/include/utils.h b/P1/include/utils.h index c88c447..8be5169 100644 --- a/P1/include/utils.h +++ b/P1/include/utils.h @@ -18,7 +18,8 @@ #define MSGSIZE 1100 #define ENDTYPE 1000 #define ACKTYPE 1100 -#define BUFFSIZE 1000 +#define BUFFSIZE 500 +#define DIRSIZE 150 struct msgBuffer { long msgType; diff --git a/P1/src/mapper.c b/P1/src/mapper.c index 3a197e0..b401607 100644 --- a/P1/src/mapper.c +++ b/P1/src/mapper.c @@ -119,7 +119,7 @@ void writeIntermediateDS() { } // Put words and their corresponding 1's in a file named [the word].txt - char filename[BUFFSIZE] = ""; + char filename[DIRSIZE] = ""; sprintf(filename, "%s/%s.txt", mapOutDir, tempNode -> key); FILE* fptr = fopen(filename, "w"); fprintf(fptr, "%s %s", tempNode -> key, ones); diff --git a/P1/src/reducer.c b/P1/src/reducer.c index f70c072..92914e2 100644 --- a/P1/src/reducer.c +++ b/P1/src/reducer.c @@ -75,7 +75,7 @@ void writeFinalDS(int reducerID){ while(tempNode != NULL) { // Shove word and number of occurances in a file named word.txt - char filename[BUFFSIZE] = ""; + char filename[DIRSIZE] = ""; sprintf(filename, "output/ReduceOut/Reduce_%d.txt", reducerID); FILE* fptr = fopen(filename, "a"); //append, not overwrite. fprintf(fptr, "%s %d\n", tempNode -> key, tempNode -> value); -- cgit v1.2.3