Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Project 1: Zhen Ren #20

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 57 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,62 @@
**University of Pennsylvania, CIS 5650: GPU Programming and Architecture,
Project 1 - Flocking**

* (TODO) YOUR NAME HERE
* (TODO) [LinkedIn](), [personal website](), [twitter](), etc.
* Tested on: (TODO) Windows 22, i7-2222 @ 2.22GHz 22GB, GTX 222 222MB (Moore 2222 Lab)
* Zhen Ren
* https://www.linkedin.com/in/zhen-ren-837089208/
* Tested on: Windows 11, i9-13900H @ 2.60 GHz 16GB, RTX 4070 Laptop 8GB (Self laptop)

### (TODO: Your README)
### Screenshots
Two results are captures using coherent method with 10000 particles.
![](./images/result1.png)
![](./images/result2.png)

Include screenshots, analysis, etc. (Remember, this is public, so don't put
anything here that you don't want to share with the world.)
GIF:
![](./images/result1.gif)
![](./images/result.gif)

### Performance Analysis
#### 1. Performance with increasing # of boids, no visualization

| Boids # | Brute force | Scattered Grid | Coherent Grid |
| ---------- | -------------------- | ----------------------- | ---------------------- |
| 5000 | 1038 | 1439 | 1333 |
| 10000 | 579 | 1406 | 1315 |
| 20000 | 317 | 1313 | 1320 |
| 50000 | 68 | 912 | 1235 |
| 100000 | 19 | 511 | 1240 |
| 200000 | 4.9 | 260 | 845 |
| 500000 | 0.8 | 55 | 385 |

![](./images/perf1.png)

#### 2. Performance with different block size, no visualization (50000 boids)
![](./images/perf2.png)

#### 3. Performance w/ and w/o visualization
![](./images/perf3.png)

### Questions:

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

Increasing the number of boids will generally lowering FPS. This is because more boids will need more threads to simulate them and involves more neighbors for each particle.

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

As for this assignment, I didn't see much difference in FPS when increasing block size. I think it is because the memory pressure is relatively small and 50k boids

**3.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?**

The performance imporvement with coherent grid is obvious when # of boids is large. This is expected since with larger # of boids, the cache miss rate will be higher in scattered grid and coherent grid can help resolves this issue with only an extra shuffle cost.

**4.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!**

![](./images/perf4.png)

It would affect performance and usually better when boids number is large. I think it is because smaller grid size provides more fine grained spatial division. Although more grid is searched with single grid width, less boids is calcuted and the neighbor hit rate is usually higher. Therefore, when more boids is simulated, single grid width will perform better.
Binary file added images/perf1.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/perf2.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/perf3.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/perf4.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/performance.xlsx
Binary file not shown.
Binary file added images/result.gif
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/result1.gif
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/result1.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/result2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading