From c2c0eb935c2e4f55b81f7fbf80b7d5c195883e23 Mon Sep 17 00:00:00 2001 From: Matt Strapp Date: Tue, 3 Nov 2020 19:34:21 -0600 Subject: poggers???????? --- P2/lib/utils.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/P2/lib/utils.c b/P2/lib/utils.c index 02f4a9f..3b4f829 100644 --- a/P2/lib/utils.c +++ b/P2/lib/utils.c @@ -90,12 +90,9 @@ int getInterData(char *Qkey, int reducerID) { struct msgBuffer message= makeMessage(); //DEBUG! make sure it work. int id = openQueue(); - //Likes to hang msgrcv(id, &message, MSGSIZE, reducerID, 0); - // printf("INTER DATA: %s\n", message.msgText); - // *Qkey = *message.msgText; strcpy(Qkey, message.msgText); - // printf("INTER DATA: %s\n", Qkey); + printf("INTER DATA: %s\nREDUCER ID:%ld\n", Qkey, message.msgType); return (strncmp("END", message.msgText, 3) != 0); } @@ -113,9 +110,8 @@ void shuffle(int nMappers, int nReducers) { if (!strcmp(".", entry->d_name) || !strcmp("..", entry->d_name)) continue; sprintf(message.msgText, "%s/%s", newpath, entry -> d_name); - message.msgType = hashFunction(entry -> d_name, nReducers); - // printf("SENT SHUFFLE:%s\n", message.msgText); - // printf("%ld\n", message.msgType); + printf("%s\n%d\n", entry->d_name, hashFunction(entry->d_name, nReducers)+1); + message.msgType = (hashFunction(entry -> d_name, nReducers)+1); msgsnd(id, &message, MSGSIZE, 0); } closedir(dir); -- cgit v1.2.3