Skip to content

Commit

Permalink
Updating readme
Browse files Browse the repository at this point in the history
  • Loading branch information
anthonymansur committed Sep 12, 2021
1 parent ba50c3c commit 7341deb
Show file tree
Hide file tree
Showing 9 changed files with 44 additions and 2 deletions.
44 changes: 43 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,50 @@ High number of boids: https://drive.google.com/file/d/1OR57owe2Tcw4ikUtUmHmEYstS
ADD HERE

### Graphs & Explanation
To test the performance of the three implementations, CUDA events were used to measure the execution time of each step function in the simulation (See: https://developer.nvidia.com/blog/how-implement-performance-metrics-cuda-cc/)

### Baseline
To compare the speed of the brute force, scattered uniform grid, and coherent uniform grid implementations, the average fps between 10 second intervals was calculated for a total of 100 seconds, at N = 100,000, DT = 0.2f. As shown in the graphs below, the coherent uniform grid implementation is significantly faster than the scattered, and the scattered is signficantly faster than the brute-force implementation.

![](images/naive-baseline.png)

![](images/scattered-baseline.png)

![](images/coherent-baseline.png)

![](images/comparison-baseline.png)


### FPS as a Function of Number of Boids
Next, we want to see how the fps of each implementation various as we increase the number of boids in the simulation. To do this, we calculate the average fps of the simulation at a 10 second runtime for each implementation. For the brute-force implementation, we go from N=10,000 to N=100,000. For the scattered uniform grid implementation, we go from N=100,000 to N = 550,000, and for the coherent uniform grid implementation, we go from N=100,000 to N = 1,000,000.

Although any conclusion made are very empirical, we can see that just how much boids each implementation can take before the fps goes to very small levels. Fun fact, it took N = 2,750,000 to get the coherent implementation to the same fps as the scattered at 550,000.

![](images/naive-boid.png)

![](images/scattered-boid.png)

![](images/coherent-boid.png)

!!!ADD FRAMERATE CHANGE WITH INCREASING BLOCK SIZE!!!

### Questions
**For each implementation, how does changing the number of boids affect performance? Why do you think this is?**

ADD ANSWER HERE

**For each implementation, how does changing the block count and block size affect performance? Why do you think this is?**

ADD ANSWER HERE

**For the coherent uniform grid: did you experience any performance improvements with the more coherent uniform grid? Was this the outcome you expected? Why or why not?**

ADD ANSWER HERE

**Did changing cell width and checking 27 vs 8 neighboring cells affect performance? Why or why not? Be careful: it is insufficient (and possibly incorrect) to say that 27-cell is slower simply because there are more cells to check!**



ADD HERE



Expand Down
Binary file added images/coherent-baseline.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/coherent-boids.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/comparison-baseline.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/naive-baseline.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/naive-boids.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/scattered-baseline.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/scattered-boids.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#define FIXED_FLOAT(x) std::fixed <<std::setprecision(2)<<(x)

// LOOK-1.2 - change this to adjust particle count in the simulation
const int N_FOR_VIS = 10000; // max it out at 3,000,000
const int N_FOR_VIS = 50000; // max it out at 3,000,000
const float DT = 0.2f;

static long numberOfSteps = 0;
Expand Down

0 comments on commit 7341deb

Please sign in to comment.