aboutsummaryrefslogtreecommitdiffstats
path: root/P2
diff options
context:
space:
mode:
authorMatt Strapp <strap012@umn.edu>2020-11-03 09:15:54 -0600
committerMatt Strapp <strap012@umn.edu>2020-11-03 09:15:54 -0600
commite6665b2572e8b40ed47a6d0e6fa2a0ae8f84f76a (patch)
tree34aa05fdbba691a31aeeb0628a0b55629a084d33 /P2
parentwork on it more (diff)
downloadcsci4061-e6665b2572e8b40ed47a6d0e6fa2a0ae8f84f76a.tar
csci4061-e6665b2572e8b40ed47a6d0e6fa2a0ae8f84f76a.tar.gz
csci4061-e6665b2572e8b40ed47a6d0e6fa2a0ae8f84f76a.tar.bz2
csci4061-e6665b2572e8b40ed47a6d0e6fa2a0ae8f84f76a.tar.lz
csci4061-e6665b2572e8b40ed47a6d0e6fa2a0ae8f84f76a.tar.xz
csci4061-e6665b2572e8b40ed47a6d0e6fa2a0ae8f84f76a.tar.zst
csci4061-e6665b2572e8b40ed47a6d0e6fa2a0ae8f84f76a.zip
Fix it?
Diffstat (limited to 'P2')
-rw-r--r--P2/lib/utils.c9
1 files changed, 4 insertions, 5 deletions
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);
}