diff options
author | Matt Strapp <strap012@umn.edu> | 2020-10-05 19:56:46 -0500 |
---|---|---|
committer | Matt Strapp <strap012@umn.edu> | 2020-10-05 19:56:46 -0500 |
commit | cdcb8e01ea45393e529118d9d8f389cc6eb5664b (patch) | |
tree | 311f13e4b4f37809fa7319e32e33ecfd5bdc8da7 /P1 | |
parent | a (diff) | |
download | csci4061-cdcb8e01ea45393e529118d9d8f389cc6eb5664b.tar csci4061-cdcb8e01ea45393e529118d9d8f389cc6eb5664b.tar.gz csci4061-cdcb8e01ea45393e529118d9d8f389cc6eb5664b.tar.bz2 csci4061-cdcb8e01ea45393e529118d9d8f389cc6eb5664b.tar.lz csci4061-cdcb8e01ea45393e529118d9d8f389cc6eb5664b.tar.xz csci4061-cdcb8e01ea45393e529118d9d8f389cc6eb5664b.tar.zst csci4061-cdcb8e01ea45393e529118d9d8f389cc6eb5664b.zip |
Stuff's hecked mate
Diffstat (limited to '')
-rw-r--r-- | P1/src/mapper.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/P1/src/mapper.c b/P1/src/mapper.c index d897293..09bf132 100644 --- a/P1/src/mapper.c +++ b/P1/src/mapper.c @@ -103,8 +103,8 @@ void map(char *chunkData){ void writeIntermediateDS() { intermediateDS *root = &DS; - intermediateDS *tempNode = root; - valueList *tempNode2 = root -> value; + intermediateDS *tempNode = root -> next; + valueList *tempNode2 = tempNode -> value; while(tempNode != NULL) { // Get string of 1's associated with the word @@ -116,7 +116,9 @@ void writeIntermediateDS() { } // Shove word and ones in a file named word.txt char filename[150] = ""; - sprintf(filename, "output/MapOut/Map_%d/%s.txt", mapperID, tempNode -> key); + //sprintf(filename, "output/MapOut/Map_%d/%s.txt", mapperID, tempNode -> key); + sprintf(filename, "%s/%s.txt", mapOutDir, tempNode -> key); + printf("%s\n", filename); FILE* fptr = fopen(filename, "w"); fprintf(fptr, "%s %s", tempNode -> key, ones); fclose(fptr); @@ -141,7 +143,6 @@ int main(int argc, char *argv[]) { // mapOutDir has the path to the folder where the outputs of // this mapper should be stored mapOutDir = createMapDir(mapperID); - // ###### DO NOT REMOVE ###### while(1) { // create an array of chunkSize=1024B and intialize all |