Skip to content

Latest commit

 

History

History

Exercise1

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Exercise 1

This folder contains code and data for the first assignment. Further info can be found here.
The goal of the exercise is to implement a parallel version of a variant of the Conway’s “Game of Life”.
Different evolution methods are implemented:

  • Static evolution
  • Ordered evolution
  • Wave evolution

Structure of the repository

  • src folder: here you can find the code for the different evolution methods we implemented. Additionally functions for the initialization of the playground are provided:

  • data folder: this directory is structured as follows.

    • utils.py a .py module containing a python class and pipeline to perform data analysis.
    • init: contains sbatch .sh files, notebook script for data analysis .ipynb and output data in .csv format.
    • static: contains sbatch .sh files, notebook script for data analysis .ipynb and output data in .csv format.
    • ordered: contains sbatch .sh files, notebook script for data analysis .ipynb and output data in .csv format.
    • wave: contains sbatch .sh files, notebook script for data analysis .ipynb and output data in .csv format.
  • files folder: here are stored the .pgm files with the snapshots of the playgrounds. The folder is subdivided according to the evolution methods used, plus a folder for the initial playgrounds: init.

How to compile and run the code

To compile the code simply run:

make

OpenMP and OpenMPI are required to compile the code.
If you are using the ORFEO cluster, you can load the modules with:

module load openMPI/4.1.5/gnu/12.2.1

To run the code use mpirun with the following arguments:

  • -np int value: number of processes
  • -i: initialize a playground
  • -r: run a playground
  • -k value: playground size
  • -e [0|1|2]: type of evoultion; 0 means "ordered", 1 means "static", 2 means "wave"
  • -f string: if used with -i, it is the name of the file where the initial playground is saved. If used with -r, it is the name of the file where the initial playground is read from.
  • -n int value: number of steps to be calculated
  • -s int value:every how many steps a dump of the system is saved on a file (0 meaning only at the end). This will be saved in the folder files/ inside with name of the form snapshot_nnnnn.pgm, where nnnnn is the step at which the image is captured padded with zeros to obtain 5 digits.