diff options
author | Matt Strapp <strap012@umn.edu> | 2020-11-03 08:17:59 -0600 |
---|---|---|
committer | Matt Strapp <strap012@umn.edu> | 2020-11-03 08:17:59 -0600 |
commit | 8dee844eaad99d005262206325144476dee297c3 (patch) | |
tree | 5b643c07f4b35643cfb5511f0e37d872502735c4 /P2 | |
parent | help (diff) | |
download | csci4061-8dee844eaad99d005262206325144476dee297c3.tar csci4061-8dee844eaad99d005262206325144476dee297c3.tar.gz csci4061-8dee844eaad99d005262206325144476dee297c3.tar.bz2 csci4061-8dee844eaad99d005262206325144476dee297c3.tar.lz csci4061-8dee844eaad99d005262206325144476dee297c3.tar.xz csci4061-8dee844eaad99d005262206325144476dee297c3.tar.zst csci4061-8dee844eaad99d005262206325144476dee297c3.zip |
help me
Diffstat (limited to 'P2')
-rw-r--r-- | P2/lib/utils.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/P2/lib/utils.c b/P2/lib/utils.c index 700aaa7..8c578a0 100644 --- a/P2/lib/utils.c +++ b/P2/lib/utils.c @@ -21,11 +21,10 @@ char *getChunkData(int mapperID) { int mid = openQueue("map"); printf("%d\n", mapperID); msgrcv(mid, &message, chunkSize, mapperID, 0); - // printf("\n%s\n", message.msgText); - // printf("%d\n", strncmp("END", message.msgText, 3)); - if (!strncmp("END", message.msgText, 3)) + printf("\n%s\n", message.msgText); + printf("%d\n", strncmp("END", message.msgText, 3)); + if (strncmp("END", message.msgText, 3) == 0) { - printf("END\n"); return NULL; } char* value = message.msgText; @@ -46,7 +45,7 @@ void sendChunkData(char *inputFile, int nMappers) { while(fgets(message.msgText, chunkSize + 1, file) != NULL) { int i = 1023; - while((validChar(message.msgText[i]) )) { + while((validChar(message.msgText[i]))) { message.msgText[i] = '\0'; i--; } @@ -85,7 +84,7 @@ int getInterData(char *Qkey, int reducerID) { int id = openQueue("reduce"); msgrcv(id, &message, chunkSize, reducerID, 0); *Qkey = *message.msgText; - printf("%s\n", Qkey); + // printf("%s\n", Qkey); return abs(strncmp("END", message.msgText, 3)); // if (strncmp("END", message.msgText, 3)) // { |