aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Strapp <strap012@umn.edu>2020-11-04 10:59:35 -0600
committerMatt Strapp <strap012@umn.edu>2020-11-04 10:59:35 -0600
commit21bc19e46b8781e52f761656cec20e3e390bbc0a (patch)
tree709ac74ed9a7482fa565cc8a29e9487d0b9a85a2
parentMerge branch 'master' of github.umn.edu:STRAP012/csci4061Projects (diff)
downloadcsci4061-21bc19e46b8781e52f761656cec20e3e390bbc0a.tar
csci4061-21bc19e46b8781e52f761656cec20e3e390bbc0a.tar.gz
csci4061-21bc19e46b8781e52f761656cec20e3e390bbc0a.tar.bz2
csci4061-21bc19e46b8781e52f761656cec20e3e390bbc0a.tar.lz
csci4061-21bc19e46b8781e52f761656cec20e3e390bbc0a.tar.xz
csci4061-21bc19e46b8781e52f761656cec20e3e390bbc0a.tar.zst
csci4061-21bc19e46b8781e52f761656cec20e3e390bbc0a.zip
Fix extra {
-rw-r--r--P2/lib/utils.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/P2/lib/utils.c b/P2/lib/utils.c
index 7bdf941..e0683ef 100644
--- a/P2/lib/utils.c
+++ b/P2/lib/utils.c
@@ -45,7 +45,7 @@ void sendChunkData(char *inputFile, int nMappers) {
while(validChar(message.msgText[i])) {
message.msgText[i--] = '\0';
}
- if (fseek(file, (i - 1023), SEEK_CUR) == -1) {
+ if (fseek(file, (i - 1023), SEEK_CUR) == -1)
break;
message.msgType = (map++ % nMappers) + 1;
@@ -87,6 +87,8 @@ int getInterData(char *Qkey, int reducerID) {
void shuffle(int nMappers, int nReducers) {
struct msgBuffer message = makeMessage();
int id = openQueue();
+ if (id == -1)
+ exit(-1);
for (int i = 1; i <= nMappers; i++) {
char newpath[100];
sprintf(newpath, "output/MapOut/Map_%d", i); // Removed /, add to current dir
@@ -106,7 +108,6 @@ void shuffle(int nMappers, int nReducers) {
}
for (int i = 1; i <= nReducers; i++) {
struct msgBuffer END = {i, "END"};
- msgsnd(id, &END, MSGSIZE, 0);
if (msgsnd(id, &END, MSGSIZE, 0))
break;
}