Assignment 8: Parallel histogram computation with OpenMP
A similar simulation as that of assignment 7 has produced a record of the number of steps each walker needed to reach the bottom (instead of the fraction of percolating walkers).
You are given the data file with these step numbers (see below). All step numbers were less than 100,000,000. Each recorded step number in the file is on a separate line of 8 characters.
You should write a parallel C++ program using OpenMP to compute the distribution of the time steps. Because the step numbers vary so much in size, it should compute the histogram not of the values themselves, but of their logarithm.
The programs should take the base of the logarithm as a command line arguments, as well as the name of the data file.
The output of the program should have 2 columns. Column 1 has the start of the histogram bin and column 2 the number of data points that fall into that bin.
In the parallelization, both reading the numbers and computing the histogram should be parallelized.
Your submission should use git, and include a README file and include a Makefile that compiles the code.
It should furthermore include three SLURM job scripts for the Teach cluster, one that runs the code with 1 thread, one with 16 threads, and one with 40 threads. Choose a logarithm base that gives at least 30 bins and have these three scripts measure the elapsed times of their computation. Submit these jobs to the queue and save their output. The output of these three runs should be identical except for the timing.
Submit, in a zip file, your git repo, your code, Makefile and README as well as the output of the three SLURM jobs by midnight March 28, 2025.
- 22 March 2025, 1:15 AM