From 897f078b8a1c3ef7ddd9bb3920d36c0a98d2498b Mon Sep 17 00:00:00 2001 From: Matt Strapp Date: Tue, 27 Oct 2020 14:23:53 -0500 Subject: Start Shuffle (none of these probably work) --- P2/lib/utils.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'P2/lib') diff --git a/P2/lib/utils.c b/P2/lib/utils.c index a97aa36..8963d16 100644 --- a/P2/lib/utils.c +++ b/P2/lib/utils.c @@ -66,9 +66,9 @@ int hashFunction(char* Qkey, int reducers){ } int getInterData(char *Qkey, int reducerID) { + struct msgBuffer message; //make sure it work. int id = openQueue(); - struct msgBuffer message; msgrcv(id, &message, chunkSize, reducerID, 0); Qkey = message.msgText; if (strncmp("END", message.msgText, 3)) @@ -82,8 +82,15 @@ int getInterData(char *Qkey, int reducerID) { } void shuffle(int nMappers, int nReducers) { + struct msgBuffer message; //Once again, MAKE SURE THIS WORKS PROPERLY! int id = openQueue(); + for (int i = 1; i <= nMappers; i++) { + //Extra for loop traversing directory + + message.msgType = hashFunction(/* SOMETHING */, nReducers); + msgsnd(id, &message, chunkSize, 0); + } } -- cgit v1.2.3