/Histograms

applying parallel and distributed computing to histograms :busts_in_silhouette:

Primary LanguageC

Open to contributions. Submit a pull request and I'm happy to take a look.

Histograms

Calculating the run time of various ways of generating a histogram using different parallel and distributed computing algorithms. Using the serial version as a base for comparision.

Note : I haven't uploaded the serial version yet. And there are a few seg faults in MPI for now. I'll redo the whole MPI thing.

  1. MPI : Using a distributed memory system to distribute data over nodes and simultaneously reduce and generate a histogram.
  2. OMP : Using a shared memory system to parallelize blocks of code to optimize performance.
  3. OMP + MPI : Using parallelized for loops over distributed memory to generate a histogram.

How do I run these?

Clone the repo and generate a data file for the program to read.

gcc -g -Wall -o create_file create_file.c -std=c99 (I'm using for loops so I need c++ implementation.)

./create_file 'name of data file' 'number of elements'

To compile the exec files :

gcc -g -Wall -mpi -fopenmp -o execfile mpi_file.c -std=c99 (Pick and choose the optional depending on the program you're running.)

Note: You want to pay close attention to the order of tags used in compilation. Example gcc -g -Wall -o -fopenmp execfile mpi_file.c -std=c99 will not compile.

All the programs take similar command line arguments.

  • Serial version: ./nameofexec 'data file to read from' '# of intervals of histogram'
  • MPI version: ./nameofexec '# of nodes of MPI' 'data_file_to_read_from' '# of intervals'
  • OMP version: ./nameofexec '# of threads' 'data_file_to_read_from' '# of intervals'

Error checks

I've added error checks in the programs to ensure that the minimum # of command line arguments are provided by the user.

Also painstakingly made sure that there are no segfaults.

Please ensure you generate a data file BEFORE you run the exec file.

Updates

I've tried to add verbose comments about functions wherever I can, if you feel I'm lacking submit a pull request and I'll take a look.