Skip to content

Asierzubia/COVID

Repository files navigation


Covid propagation simulator

MPI paralell Covid propagation

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Contributing
  5. License
  6. Contact

About The Project

!alt text

The main objective of this project is to simulate the spread of Covid in civilization. The computation of the simulation has been carried out in parallel, using the MPI library of C.

The following components have been taken into account to perform the simulation:

  • Person
  • Population
  • Scenario

In the specified scenario, each person can perform the following actions: move, vaccinate and propagate. The simulation results are stored in a .out file. Here is a summary of the simulation execution:

  • Initialize the variables required for MPI.
  • If it is Node 0, the different program configuration methods are checked, and the global variables of the simulation configuration are initialized.
  • Initialize the global variables.
  • The gsl library is initialized, for the probabilities calculation.
  • In the case of Node 0, the quadrants, the people to be vaccinated and the population per node are calculated. Once calculated, each variable is sent with an MPI_Bcast.
  • Initialize the lists dynamically.
  • Each node creates its population, with the previously calculated parameters (population per node, quadrants...).
  • Iterate with a loop up to the stipulated number of iterations. For each iteration, all the actions that people can do are carried out.
  • Each node sends its metrics and positions to Node 0.
  • Node 0 prints the metrics and positions in its corresponding file.
  • All the structures that remain to be freed are released.
  • The simulation is finished.

(back to top)

Built With

The technologies used for this project are as follows:

(back to top)

Getting Started

Prerequisites

Is mandatory to have installed C program an the make package. To avoid errors during runtime, use Linux instead Windows. The following examples are for an Ubuntu distribution:

  • c
    sudo apt install GCC

Installation

  1. Clone the repo
    git clone https://github.com/iakigarci/KernelSimulator.git
  2. Install C packages
    sudo apt install make gsl
  3. Compile source files
    make
  4. Run the init script. Change the parameters name with the simulation parameters
    ./run.sh metrics.txt [parameters]
    For example:
    ./run.sh "covid.out -s8 -p0.2 -g60 -b2 -i10 -d2 -m20" 4 
    With configuration file:
    ./run.sh ”covid.out config_file.txt” 4 

The parameters that the program accepts are the following. it can also be executed using a .txt configuration file

  • -s or -world size: Side of the square matrix. Default value 8.
  • -p or -percent: Percentage of the population to be vaccinated per iteration. Default value 0.05.
  • -g or -population size: Population size. Default value 60.
  • -b or -batch: Number of iterations per batch. Default value 2.
  • -i or -iter: Number of iterations. Default value 10000.
  • -d or -seed: N ́umero que act ́ua como semilla. Default value 3.
  • -m or -ageMean: Average age of the population. Default value 28.

(back to top)

Usage

For more examples, please refer to the Documentation (Spanish)

(back to top)

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

(back to top)

License

Distributed under the MIT License. See LICENSE.txt for more information.

(back to top)

Contact

Iñaki García : [email protected] Asier Zubia: [email protected] Project Link: https://github.com/Asierzubia/CovidMPI

(back to top)

Contributors

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published