aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Strapp <strap012@umn.edu>2020-11-03 08:31:55 -0600
committerMatt Strapp <strap012@umn.edu>2020-11-03 08:31:55 -0600
commit67ea99d7eb7adc88aed1eaa89015aef93b42683b (patch)
tree300c415bb5314ea4ec9811683377962e235bd656
parentcommenting things out (diff)
downloadcsci4061-67ea99d7eb7adc88aed1eaa89015aef93b42683b.tar
csci4061-67ea99d7eb7adc88aed1eaa89015aef93b42683b.tar.gz
csci4061-67ea99d7eb7adc88aed1eaa89015aef93b42683b.tar.bz2
csci4061-67ea99d7eb7adc88aed1eaa89015aef93b42683b.tar.lz
csci4061-67ea99d7eb7adc88aed1eaa89015aef93b42683b.tar.xz
csci4061-67ea99d7eb7adc88aed1eaa89015aef93b42683b.tar.zst
csci4061-67ea99d7eb7adc88aed1eaa89015aef93b42683b.zip
Fix starting at 2 instead of 1
-rw-r--r--P2/lib/utils.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/P2/lib/utils.c b/P2/lib/utils.c
index 297b72e..ab38470 100644
--- a/P2/lib/utils.c
+++ b/P2/lib/utils.c
@@ -40,7 +40,7 @@ void sendChunkData(char *inputFile, int nMappers) {
struct msgBuffer message = makeMessage();
// open message queue
int msgid = openQueue("map");
- int map = 1;
+ int map = 0;
FILE* file = fopen(inputFile, "r");
// construct chunks of 1024 bytes
while(fgets(message.msgText, chunkSize + 1, file) != NULL) {
@@ -53,8 +53,6 @@ void sendChunkData(char *inputFile, int nMappers) {
// DEBUG!
fseek(file, (i - 1023), SEEK_CUR);
- //The first mapper sent to is 2 instead of 1.
- //Is this a problem? Probably not.
message.msgType = (map++ % nMappers) + 1;
printf("%s\n\n",message.msgText);
msgsnd(msgid, &message, map, 0);