aboutsummaryrefslogtreecommitdiffstats
path: root/P1/Template/src/mapreduce.c
diff options
context:
space:
mode:
authorMatt Strapp <strap012@umn.edu>2020-09-24 07:24:19 -0500
committerMatt Strapp <strap012@umn.edu>2020-09-24 07:24:19 -0500
commit7f2f7f7c3e5d4c626d7e8d4d45fee2b11b6d5221 (patch)
tree73142dd8d25f71467fc0fa602e3caaf0f6b8b34f /P1/Template/src/mapreduce.c
parentAdd project 1 files (diff)
downloadcsci4061-7f2f7f7c3e5d4c626d7e8d4d45fee2b11b6d5221.tar
csci4061-7f2f7f7c3e5d4c626d7e8d4d45fee2b11b6d5221.tar.gz
csci4061-7f2f7f7c3e5d4c626d7e8d4d45fee2b11b6d5221.tar.bz2
csci4061-7f2f7f7c3e5d4c626d7e8d4d45fee2b11b6d5221.tar.lz
csci4061-7f2f7f7c3e5d4c626d7e8d4d45fee2b11b6d5221.tar.xz
csci4061-7f2f7f7c3e5d4c626d7e8d4d45fee2b11b6d5221.tar.zst
csci4061-7f2f7f7c3e5d4c626d7e8d4d45fee2b11b6d5221.zip
rearrange
Diffstat (limited to 'P1/Template/src/mapreduce.c')
-rw-r--r--P1/Template/src/mapreduce.c54
1 files changed, 0 insertions, 54 deletions
diff --git a/P1/Template/src/mapreduce.c b/P1/Template/src/mapreduce.c
deleted file mode 100644
index 5b63f3f..0000000
--- a/P1/Template/src/mapreduce.c
+++ /dev/null
@@ -1,54 +0,0 @@
-#include "mapreduce.h"
-
-int main(int argc, char *argv[]) {
-
- if(argc < 4) {
- printf("Less number of arguments.\n");
- printf("./mapreduce #mappers #reducers inputFile\n");
- exit(0);
- }
-
- // ###### DO NOT REMOVE ######
- int nMappers = strtol(argv[1], NULL, 10);
- int nReducers = strtol(argv[2], NULL, 10);
- char *inputFile = argv[3];
-
- // ###### DO NOT REMOVE ######
- bookeepingCode();
-
- // ###### DO NOT REMOVE ######
- pid_t pid = fork();
- if(pid == 0){
- //send chunks of data to the mappers in RR fashion
- sendChunkData(inputFile, nMappers);
- exit(0);
- }
- sleep(1);
-
-
- // To do
- // spawn mappers processes and run 'mapper' executable using exec
-
- // To do
- // wait for all children to complete execution
-
-
- // ###### DO NOT REMOVE ######
- // shuffle sends the word.txt files generated by mapper
- // to reducer based on a hash function
- pid = fork();
- if(pid == 0){
- shuffle(nMappers, nReducers);
- exit(0);
- }
- sleep(1);
-
-
- // To do
- // spawn reducer processes and run 'reducer' executable using exec
-
- // To do
- // wait for all children to complete execution
-
- return 0;
-} \ No newline at end of file