aboutsummaryrefslogtreecommitdiffstats
path: root/P1
diff options
context:
space:
mode:
authorMatthew Strapp <strap012@umn.edu>2020-09-24 13:30:28 -0500
committerGitHub Enterprise <noreply-github@umn.edu>2020-09-24 13:30:28 -0500
commitf013fe258e5fc2cdaa72730613b93da233c04108 (patch)
tree877bd369fd48bb2e86da96c323e06cb87d5aaef0 /P1
parentedit main README (diff)
parentStart Master (diff)
downloadcsci4061-f013fe258e5fc2cdaa72730613b93da233c04108.tar
csci4061-f013fe258e5fc2cdaa72730613b93da233c04108.tar.gz
csci4061-f013fe258e5fc2cdaa72730613b93da233c04108.tar.bz2
csci4061-f013fe258e5fc2cdaa72730613b93da233c04108.tar.lz
csci4061-f013fe258e5fc2cdaa72730613b93da233c04108.tar.xz
csci4061-f013fe258e5fc2cdaa72730613b93da233c04108.tar.zst
csci4061-f013fe258e5fc2cdaa72730613b93da233c04108.zip
Merge pull request #7 from STRAP012/Matt's-Branch
Start working on Master (#4)
Diffstat (limited to '')
-rwxr-xr-x[-rw-r--r--]P1/solutionexe/mapperbin38848 -> 38848 bytes
-rwxr-xr-x[-rw-r--r--]P1/solutionexe/mapreducebin32616 -> 32616 bytes
-rwxr-xr-x[-rw-r--r--]P1/solutionexe/reducerbin33848 -> 33848 bytes
-rw-r--r--P1/src/mapreduce.c33
4 files changed, 24 insertions, 9 deletions
diff --git a/P1/solutionexe/mapper b/P1/solutionexe/mapper
index 63e089d..63e089d 100644..100755
--- a/P1/solutionexe/mapper
+++ b/P1/solutionexe/mapper
Binary files differ
diff --git a/P1/solutionexe/mapreduce b/P1/solutionexe/mapreduce
index 6857ba1..6857ba1 100644..100755
--- a/P1/solutionexe/mapreduce
+++ b/P1/solutionexe/mapreduce
Binary files differ
diff --git a/P1/solutionexe/reducer b/P1/solutionexe/reducer
index 58e0ec4..58e0ec4 100644..100755
--- a/P1/solutionexe/reducer
+++ b/P1/solutionexe/reducer
Binary files differ
diff --git a/P1/src/mapreduce.c b/P1/src/mapreduce.c
index 5b63f3f..ed1f9e5 100644
--- a/P1/src/mapreduce.c
+++ b/P1/src/mapreduce.c
@@ -26,12 +26,19 @@ int main(int argc, char *argv[]) {
sleep(1);
- // To do
- // spawn mappers processes and run 'mapper' executable using exec
+ pid_t mapperPid;
+ for (int i = 0; i < nMappers; i++) {
+ mapperPid = fork();
+ if (mapperPid != 0) {
+ //TODO: exec here
+ }
+ }
- // To do
- // wait for all children to complete execution
-
+ for (int i = 0; i < nMappers; i++) {
+ //Hopefully this works
+ wait(NULL);
+ }
+
// ###### DO NOT REMOVE ######
// shuffle sends the word.txt files generated by mapper
@@ -44,11 +51,19 @@ int main(int argc, char *argv[]) {
sleep(1);
- // To do
- // spawn reducer processes and run 'reducer' executable using exec
- // To do
- // wait for all children to complete execution
+ pid_t reducerPid;
+ for (int i = 0; i < nReducers; i++) {
+ reducerPid = fork();
+ if (reducerPid != 0) {
+ //TODO: exec here
+ }
+ }
+
+ for (int i = 0; i < nReducers; i++) {
+ //Maybe this works too?
+ wait(NULL);
+ }
return 0;
} \ No newline at end of file