From 9716c0ea250451f345780e79269e20603ca92382 Mon Sep 17 00:00:00 2001 From: Matt Strapp Date: Tue, 3 Nov 2020 08:29:03 -0600 Subject: commenting things out --- P2/lib/utils.c | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/P2/lib/utils.c b/P2/lib/utils.c index 8c578a0..297b72e 100644 --- a/P2/lib/utils.c +++ b/P2/lib/utils.c @@ -17,18 +17,19 @@ struct msgBuffer makeMessage() { char *getChunkData(int mapperID) { //Message struct msgBuffer message = makeMessage(); + // printf("%ld\n", message.msgType); //Queue ID int mid = openQueue("map"); - printf("%d\n", mapperID); + // printf("%d\n", mapperID); msgrcv(mid, &message, chunkSize, mapperID, 0); - printf("\n%s\n", message.msgText); - printf("%d\n", strncmp("END", message.msgText, 3)); + // printf("\n%s\n", message.msgText); + // printf("%d\n", strncmp("END", message.msgText, 3)); if (strncmp("END", message.msgText, 3) == 0) { return NULL; } char* value = message.msgText; - printf("%s\n", message.msgText); + // printf("%s\n", message.msgText); printf("%s\n", value); return value; //return &(message.msgText); @@ -55,6 +56,7 @@ void sendChunkData(char *inputFile, int nMappers) { //The first mapper sent to is 2 instead of 1. //Is this a problem? Probably not. message.msgType = (map++ % nMappers) + 1; + printf("%s\n\n",message.msgText); msgsnd(msgid, &message, map, 0); } @@ -85,13 +87,7 @@ int getInterData(char *Qkey, int reducerID) { msgrcv(id, &message, chunkSize, reducerID, 0); *Qkey = *message.msgText; // printf("%s\n", Qkey); - return abs(strncmp("END", message.msgText, 3)); - // if (strncmp("END", message.msgText, 3)) - // { - // return 0; - // } else { - // return 1; - // } + return strncmp("END", message.msgText, 3) == 0; } void shuffle(int nMappers, int nReducers) { -- cgit v1.2.3