From e6665b2572e8b40ed47a6d0e6fa2a0ae8f84f76a Mon Sep 17 00:00:00 2001 From: Matt Strapp Date: Tue, 3 Nov 2020 09:15:54 -0600 Subject: Fix it? --- P2/lib/utils.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'P2') diff --git a/P2/lib/utils.c b/P2/lib/utils.c index 39e058f..06ab215 100644 --- a/P2/lib/utils.c +++ b/P2/lib/utils.c @@ -95,7 +95,7 @@ void shuffle(int nMappers, int nReducers) { getcwd(path, 100); int id = openQueue("reduce"); for (int i = 1; i <= nMappers; i++) { - char newpath[100]; + char newpath[200]; sprintf(newpath, "%s/output/MapOut/Map_%d", path, i); printf("%s\n", newpath); DIR *dir = opendir(newpath); @@ -103,10 +103,9 @@ void shuffle(int nMappers, int nReducers) { while ((entry = readdir(dir)) != NULL) { if (!strcmp(".", entry->d_name) || !strcmp("..", entry->d_name)) continue; - - - //message.msgType = hashFunction(/* SOMETHING ,*/ nReducers); - msgsnd(id, &message, chunkSize, 0); + message.msgType = hashFunction(entry -> d_name, nReducers); + printf("%ld\n", message.msgType); + msgsnd(id, &message, chunkSize, 0); } closedir(dir); } -- cgit v1.2.3