diff options
author | Andrea Smith <smit9523@umn.edu> | 2020-10-24 12:16:30 -0500 |
---|---|---|
committer | Andrea Smith <smit9523@umn.edu> | 2020-10-24 12:16:30 -0500 |
commit | f3eb70b2e2d739179741215b65ab303bf7d8d3f6 (patch) | |
tree | 49d4919c0fb7c6d41ee4e397aae1d707afde4ca7 /P2/lib | |
parent | sendChunk (diff) | |
download | csci4061-f3eb70b2e2d739179741215b65ab303bf7d8d3f6.tar csci4061-f3eb70b2e2d739179741215b65ab303bf7d8d3f6.tar.gz csci4061-f3eb70b2e2d739179741215b65ab303bf7d8d3f6.tar.bz2 csci4061-f3eb70b2e2d739179741215b65ab303bf7d8d3f6.tar.lz csci4061-f3eb70b2e2d739179741215b65ab303bf7d8d3f6.tar.xz csci4061-f3eb70b2e2d739179741215b65ab303bf7d8d3f6.tar.zst csci4061-f3eb70b2e2d739179741215b65ab303bf7d8d3f6.zip |
Add sendChunkData branch
Diffstat (limited to '')
-rw-r--r-- | P2/lib/utils.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/P2/lib/utils.c b/P2/lib/utils.c index 79b309e..dffade8 100644 --- a/P2/lib/utils.c +++ b/P2/lib/utils.c @@ -5,6 +5,19 @@ char *getChunkData(int mapperID) { // sends chunks of size 1024 to the mappers in RR fashion void sendChunkData(char *inputFile, int nMappers) { + msgBuffer message; + key_t key; + int msgid; + + // open message queue + msgid = msgget(key, 0666 | IPC_CREAT); + message -> msgText = 1; + FILE *fptr = fopen(inputFile, "r"); + + // construct chunks of 1024 bytes + while(fgets(message, chunkSize, fptr) != EOF) { + + } } // hash function to divide the list of word.txt files across reducers |