Skip to content

Commit c3a8cde

Browse files
committed
Update README
1 parent b94aa1f commit c3a8cde

File tree

1 file changed

+16
-59
lines changed

1 file changed

+16
-59
lines changed

README.md

Lines changed: 16 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,25 @@
11
# partdiff++
22

3-
This is a C++ port of `partdiff`, a program for calculation of partial
4-
differential equations that was originally written in C.
3+
This is a C++ port of [`partdiff`](https://github.com/parcio/partdiff).
54

65
## Related Work
76

8-
The original `partdiff` was written by Prof. Dr. Thomas Ludwig and
9-
Andreas C. Schmidt and is also available here:
7+
## Usage
108

11-
* https://wr.informatik.uni-hamburg.de/teaching/wintersemester_2020_2021/hochleistungsrechnen
12-
* https://parcio.ovgu.de/Teaching/Winter+2020_2021/Parallele+Programmierung.html
9+
Since `partdiff++` uses some C++20 (`std::format`, `std::numbers`) and C++23 (`std::print`, 3d-`operator[]`) features, you need a reasonably recent C++ compiler. I tested it with `g++14 14.2.0`.
1310

14-
See https://github.com/mblesel/rust_partdiff for a Rust implementation. 🙂
15-
16-
## Building and Testing
17-
18-
`partdiff++` uses C++20 features (at the moment just `std::numbers`).
19-
Therefore, to build it, you need a compiler that supports C++20.
20-
I tested it with `g++ 10.2.0`.
21-
22-
I am currently also relying on the [{fmt} library](https://github.com/fmtlib/fmt)
23-
which implements the [C++20 std::format library](https://en.cppreference.com/w/cpp/utility/format)
24-
which is sadly not supported by compilers at the time of writing.
25-
Running `make` will automatically both clone and build `{fmt}` (there is no need
26-
to manually update the git submodule), this will take a moment.
27-
I will try to switch to `std::format` as soon as it becomes available.
28-
29-
You can build and test `partdiff++` by running `make`.
30-
This will…
31-
* build `partdiff`
32-
* beautify `partdiff++`' source code with `clang-format`
33-
* build `partdiff++` in [legacy mode](#legacy-mode)
34-
* check whether the resulting matrix of `partdiff{,++}` in `{batch,interactive}` mode is correct
35-
* check whether the help screens of `partdiff{,++}` are identical
36-
* check whether the outputs of `partdiff{,++}` in {batch,interactive} mode are identical (this ignores the line with the calculation time, because that can vary a lot, but you can check for yourself that the format is correct)
37-
* check whether `partdiff++` is leak-free
38-
39-
## Legacy Mode
40-
41-
`partdiff` is mostly in English, but two methods (`displayStatistics` and `allocateMemory`)
42-
are in German.
43-
44-
`partdiff++` offers a full English translation which is enabled by default, but,
45-
to retain comparability between `partdiff`'s and `partdiff++`' output, you can also
46-
compile `partdiff++` in legacy mode to keep the German parts among a few other details:
47-
```bash
48-
$ make partdiffpp
49-
```
50-
To compile `partdiff++` in normal mode:
51-
```bash
52-
$ cd pde++
53-
$ make clean
11+
```shell
12+
$ git clone https://github.com/felsenhower/partdiffpp.git
13+
$ cd partdiffpp
5414
$ make
15+
$ ./partdiff 1 2 100 1 2 100
5516
```
5617

18+
## Testing
19+
20+
This project uses [partdiff_tester](https://github.com/parcio/partdiff_tester) via CI to ensure that the output matches the reference implementation.
21+
It passes the correctness tests with `--strictness=4` (exact match) and with `--valgrind` (i.e. it has no memory leaks).
22+
5723
## Performance
5824

5925
`partdiff++` is a bit faster than `partdiff`.
@@ -70,7 +36,7 @@ and `partdiff++`' runtime is `(715.90 ± 0.82) s`,
7036
which makes `partdiff++` `(7.36 ± 0.5) %` faster.
7137

7238
This is probably to a large part because of the custom Matrix / Tensor
73-
implementation that uses an overloaded `operator()` for element access, so we
39+
implementation that uses an overloaded `operator[]` for element access, so we
7440
can save a bit of pointer arithmetic and do the index computation directly.
7541

7642
However,
@@ -83,8 +49,9 @@ the runtime projected onto 0 iterations is also smaller for `partdiff++`.
8349

8450
This means, that `partdiff++`' startup time is also smaller which is a bit
8551
surprising, considering that I did not care for performance in the startup
86-
code at all and used many sophisticated but expensive techniques. However,
87-
I am using the `{fmt}` library for printing which claims to be faster than `printf`.
52+
code at all and used many sophisticated but expensive techniques.
53+
However, it is claimed that the new C++ string printing (`std::print`) is faster
54+
than `printf`.
8855
Maybe a bit of modern C++ compiler magic is involved as well.
8956

9057
#### Figure 1: [1,1024] iterations
@@ -98,13 +65,3 @@ Maybe a bit of modern C++ compiler magic is involved as well.
9865
#### Figure 3: [1,8] iterations with best-fit line
9966

10067
[![pde vs pde++, 1:8 iterations](benchmark/pde_vs_pdepp_iter/Runtimes%20[1%2C8].png)](benchmark/pde_vs_pdepp_iter/Runtimes%20[1%2C8].pdf)
101-
102-
## Coding Style
103-
104-
This is not just a minimal port that makes `partdiff` work with a C++ compiler.
105-
`partdiff++` is written in modern C++20 and uses no C headers.
106-
107-
I tried to keep most identifier names intact, but I converted all identifiers to
108-
the standard `snake_case` of the standard library and changed a few details.
109-
110-
The comments have been removed for now, but will return at some point.

0 commit comments

Comments
 (0)