Skip to content

sanyamjain0315/cuda-wildfirespread-simulation

Repository files navigation

Project Monte Carlo

  1. Project Name: Project Monte Carlo Fire Spread
  2. Members:
  3. Topic/Goals: Running montecarlo simlations for wildfire spread in parallel on GPUs and speed up the simulation process.

Versions

Each version of most of the optimizations we tried and measured are in the following branches of the code base:

  1. main: Had the most up to date code. Includes the implementation with dynamic parallelism as well as pinned memory and asynchronous mem copy. Best performing version.
  2. cudastreams-ersion: Implementation of simulation with cuda streams, where each simulation was run on one stream, and all streams executing in parallel. Performed poorly due to what we think is overheads related to executing soo many streams at once.
  3. frontier-per-timestep-all-sims: Implements a frontier array that stores the indices of active burning cells, such that only no. threads equal to the burning cells are launched and executed. Requires all simulations to run in sync per time step. Yeilded slightly less performance thatn dynamic parallelism.
  4. all-sim-1-timestep: Same as above version but no frontier array (thread launched for each cell of the grid). Performance almost as bad as cuda streams
  5. synchronous-memcpy: A version of code without async mem copy and pinned memory. Should be compared with the dynamic parallelism version. Total time is the same due to sync, but copy to and from device is reduced by a great deal.

compile and run instructions

  • Run make to compile
  • Following args need to be passed to the ./build file created
    • Grid width: (int) no. of cells in width
    • Grid height: (int) no. of cells in height
    • Number of simulations: (int) no. of simulations to run in parallel
    • Timestep size: (int) size of each timestep in seconds
    • Max time: (int) max time till which a simulation can run
    • Max Height: (float) max height according to which the terrain heights will be scaled
    • Cell resolution: (float) Area that a cell will represent in sq meter.

Template:

./build <GRID_WIDTH> <GRID_HEIGHT> <NUM_SIMULATIONS> <TIMESTEP_SIZE> <MAX_TIME> <MAX_HEIGHT> <CELL_RESOLUTION>

Example call:

./build 1024 1024 128 3600 36000 200.0f 10.0f

Working notes

To easily sync to oc pod, run the script using:

chmod +x scripts/rsync.sh
scripts/rsync.sh

About

A CUDA C/C++ project to simulate wildfire spread on GPUs and estimate hotspots using Montecarlo simulations

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors