Passer au contenu principal
SciNet
  • Accueil
  • Tous les cours
  • Calendrier
  • Certificats
  • SciNet
    Site principal Documentation my.SciNet
  • CCDB
  • Plus
Fermer
Activer/désactiver la saisie de recherche
Français
English Français
Vous êtes connecté anonymement
Connexion
SciNet
Accueil Tous les cours Calendrier Certificats SciNet Replier Déplier
Site principal Documentation my.SciNet
CCDB
Tout déplier Tout replier
  1. Tableau de bord
  2. PHY1610 - Winter 2021
  3. 9. Parallelize traffic model using OpenMP

9. Parallelize traffic model using OpenMP

Conditions d’achèvement
Ouvert le : vendredi 26 mars 2021, 00:00
À rendre : vendredi 2 avril 2021, 23:55

You are going to parallelize the Nagel-Schreckenberg model, which you implemented in the last assignment. For fairness, since the submitted implementations were rather divergent in completeness and approach, for this assignment, start from the reference solution which can be git-cloned on the Teach cluster with

$ git clone /scinet/course/phy1610/traffic
You should note that this is an 'agent-based' implementation, i.e., an implementation that keeps track of the positions and velocities of the N cars as (two) vectors of length N. An alternative representation, the 'grid' representation, which assigns a value to every point on the road of length L (used by some of you in your solution to assignment 8), is here only used in the netcdf output routines.

You will see that the default parameters in params.ini are larger than they were in assignment 8. This makes the simulation take longer and will show the effects of parallization better.

In addition, there's a new parameter per in params.ini, which controls how often output is done. In params.ini, per is set to 100, which means the cars positions and velocities are only output once every 100 time steps.

Your task is as follows:

  1. Speed up this code using shared-memory parallelism, by adding OpenMP directives and thread-safe mechanisms for the pseudo-random number generator as discussed in class. Remember to always use default(none) in pragma omp parallel directives.
  2. You should parallelize as much as possible, but you do not have to parallelize the netcdf output routines.
  3. In addition to parallelizing the code, you should write one or more job scripts that can be submitted to the SLURM scheduler on the Teach cluster, and that would run the applications for values of the number of threads ranging from 1 to 16 and record the timings.
  4. Make a plot of the speedups, and, assuming Amdahl's law holds, try to estimate the serial fraction f by fitting to Amdahl's law.
  5. Write a one-paragraph report on the outcomes of the scaling analysis.

Add the plots and report to the git repo, and submit its git2zip-ed version. Submission deadline is April 2, 2021 at 11:55 PM. The usual penalty for late submissions applies.


  • traffic.zip traffic.zip
    14 août 2023, 16:29
Contacter l’assistance du site
Vous êtes connecté anonymement (Connexion)
Résumé de conservation de données


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.
Fourni par Moodle