Skip to main content
SciNet
  • Home
  • All Courses
  • Calendar
  • Certificates
  • SciNet
    Main Site Documentation my.SciNet
  • CCDB
  • More
Close
Toggle search input
English
English Français
You are currently using guest access
Log in
SciNet
Home All Courses Calendar Certificates SciNet Collapse Expand
Main Site Documentation my.SciNet
CCDB
Expand all Collapse all
  1. Dashboard
  2. PHY1610 - Winter 2025
  3. Assignment 8: Parallel histogram computation with OpenMP

Assignment 8: Parallel histogram computation with OpenMP

Completion requirements
Opened: Friday, 21 March 2025, 11:59 PM
Due: Friday, 28 March 2025, 11:59 PM

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.

  • stepnumbers.dat stepnumbers.dat
    22 March 2025, 1:15 AM
Contact site support
You are currently using guest access (Log in)
Data retention summary


All content on this website is made available under the Creative Commons Attribution 4.0 International licence, with the exception of all videos which are released under the Creative Commons Attribution-NoDerivatives 4.0 International licence.
Powered by Moodle