Skip to content

Commit 92d0966

Browse files
committed
fix : deleted unneccessary files
1 parent eadec59 commit 92d0966

23 files changed

+152890
-990448
lines changed

a.out

0 Bytes
Binary file not shown.

gutenberg.org_cache_epub_100_pg100.txt

Lines changed: 0 additions & 187660 deletions
This file was deleted.

gutenberg.org_cache_epub_4800_pg4800.txt

Lines changed: 0 additions & 59584 deletions
This file was deleted.

gutenberg.org_cache_epub_50954_pg50954.txt

Lines changed: 0 additions & 123834 deletions
This file was deleted.

logs.txt

Lines changed: 0 additions & 3 deletions
This file was deleted.

main.c

Lines changed: 0 additions & 45 deletions
This file was deleted.

main.cpp

Lines changed: 0 additions & 56 deletions
This file was deleted.

main_mpi.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,11 +182,11 @@ int main(int argc, char **argv){
182182
//std::cout<<buf.c_str()<<std::endl;
183183
MPI_Send(buf.c_str(), buffer_sz+1, MPI_CHAR, 0, 0, MPI_COMM_WORLD);
184184
}
185+
MPI_Barrier(MPI_COMM_WORLD);
185186
end = MPI_Wtime();
186187
//std::cout<<MPI_Wtick()<<std::endl;
187188
double time = (end - start)*MPI_Wtick();
188189
printf("Execution time for rank %d : %.9f seconds\n", rank, time);
189-
190190
//tokenizer(str_tolower(message), ' ', words, word_length_min, word_length_max);
191191
if(!rank){
192192
freopen("output_log_parallel.txt", "w", stdout);
@@ -203,7 +203,6 @@ int main(int argc, char **argv){
203203
std::cout<<x.first<<": "<<x.second<<std::endl;
204204
}
205205
}
206-
std::cout<<"Total words : "<<word_counter<<std::endl;
207206
}
208207
MPI_Finalize();
209208
}

main_mpi_file.cpp

Lines changed: 0 additions & 205 deletions
This file was deleted.

main_serial.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
//parallel program
22
//#include <bits/chrono.h>
33
#include<cctype>
4+
#include <ctime>
45
#include<iostream>
56
#include<fstream>
67
#include<string>
@@ -53,7 +54,8 @@ int main(int argc, char **argv){
5354
int num_txt_files, word_length_min, word_length_max;
5455
char order;
5556
int count = 0;
56-
auto start = std::chrono::high_resolution_clock::now();
57+
clock_t start, end;
58+
start = clock();
5759
std::cout<<"Enter the number of text files: ";
5860
std::cin>>num_txt_files;
5961
std::vector<std::string> file_list(num_txt_files);
@@ -80,9 +82,9 @@ int main(int argc, char **argv){
8082
new_file.close();
8183
}
8284
}
83-
std::cout<<count<<std::endl;
84-
auto end = std::chrono::high_resolution_clock::now();
85-
std::cout<<"Time : "<<std::chrono::duration_cast<std::chrono::seconds>(end - start).count()<<" seconds"<<std::endl;
85+
end = clock();
86+
double time_taken = double(end - start) / double(CLOCKS_PER_SEC);
87+
std::cout<<"Time : "<<time_taken<<" seconds"<<std::endl;
8688
freopen("output_log_serial.txt", "w", stdout);
8789
if(order == 'a'){
8890
std::cout<<"Word Count Report (Alphabetical Order):"<<std::endl;
@@ -94,7 +96,7 @@ int main(int argc, char **argv){
9496
std::cout<<"Word Count Report (Number of Words Order):"<<std::endl;
9597
std::set<std::pair<std::string, int>, comp> answers(words.begin(), words.end());
9698
for(auto x : answers){
97-
std::cout<<x.first<<" "<<x.second<<std::endl;
99+
std::cout<<x.first<<": "<<x.second<<std::endl;
98100
}
99101
}
100102
}

0 commit comments

Comments
 (0)