Skip to content

Commit

Permalink
add readme
Browse files Browse the repository at this point in the history
  • Loading branch information
CS123n committed May 29, 2022
1 parent b9947a5 commit a082040
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 90 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
*.pyc
test
5 changes: 3 additions & 2 deletions input/func.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import torch as th

def origin_func(x, y):
return - 2 * th.exp(x + y) #* (th.sin(x) * th.sin(y) - th.cos(x) * th.cos(y))
# return - 2 * th.exp(x + y) * (th.cos(x) * th.cos(y) - th.sin(x) * th.sin(y))
return - 2 * th.exp(x + y) * th.cos(x + y)

def target_func(x, y):
return th.exp(x + y) #* th.cos(x) * th.sin(y)
return th.exp(x + y) * th.cos(x) * th.sin(y)
1 change: 1 addition & 0 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
if rank == 0:
print(u.view(w, w)[:8, :8])


# if rank == 3:
# print(u.view(w, w)[0:8, 0:8])

Expand Down
18 changes: 18 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# MultiGrid Method

Hi, everyone! This repo provides a parallel version of 2-D multigrid method based on Pytorch.

Install necessary python packages:
```bash
pip install -r requirements.txt
```

Run single node version:
```bash
python main.py -n 64 -p 1
```

Run multi-node version:
```bash
torchrun --nproc_per_node 4 main.py -n 64 -p 2
```
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
torch>=1.10.0
35 changes: 0 additions & 35 deletions test/smooth.py

This file was deleted.

33 changes: 0 additions & 33 deletions test/test.py

This file was deleted.

20 changes: 0 additions & 20 deletions test/test1.py

This file was deleted.

0 comments on commit a082040

Please sign in to comment.