From c85ce850a6c8c5a2a7f98a7409f1957ed66a9985 Mon Sep 17 00:00:00 2001 From: pauleaster <42950830+pauleaster@users.noreply.github.com> Date: Thu, 18 Nov 2021 12:46:57 +1100 Subject: [PATCH] Updated readme for release 0.1.0 --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 9d83bae..cb6cc68 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,9 @@ This is a rust port of the RNS code. If you want information on this rust port then you can contact me at [Paul Easter](mailto:paul.john.easter@gmail.com). The code structure, at this point in time, deliberately follows the original structure for the C code. The only difference is that XXX.c is now XXX.rs. However, some functions may have been moved. -So far this code achieves the same numerical result as the C code to around a fractional error of 1e-11, which I found really interesting. Though, as much as possible, I performed a literal translation from C to rust avoiding the temptation to optimise before confirming that the results were comparable. I did perform a couple of optimisations though. I profiled the rust code with flamegraph.rs and found that a significant amount of time was spent in the spin() function, specifically, f64::sin(). I found that a sin() loop was being executed for each run of spin() which generated fixed values each time. So I moved this out to the main() function and passed this data to spin() directly. Even without this optimisation, I found that the rust code was faster than the C code for the same data (when using the `cargo run --release` flag). After this optimisation, the rust code executed in 1.2 seconds and the c code in 2.4 seconds. +So far this code achieves the same numerical result as the C code to around a fractional error of 1e-11, which I found really interesting. Though, as much as possible, I performed a literal translation from C to rust avoiding the temptation to optimise before confirming that the results were comparable. I did perform a couple of optimisations though. I profiled the rust code with flamegraph.rs and found that a significant amount of time was spent in the spin() function, specifically, f64::sin(). I found that a sin() loop was being executed for each run of spin() which generated fixed values each time. So I moved this out to the main() function and passed this data to spin() directly. Even without this optimisation, I found that the rust code was faster than the C code for the same data (when using the `cargo run --release` flag). After this optimisation, the rust code executed in 1.2 seconds and the c code in 2.4 seconds. I have added in movies that show the running of both codes with the same data. The rust code also generates html files showing contour plots of various system parameters they can be found in the ./html folder. + +# Details of original C code The original C code along with the equation of state files were downloaded from http://www.gravity.phys.uwm.edu/rns/. The LS220 equation of state file was downloaded from https://core-gitlfs.tpi.uni-jena.de/eos/ls220. These equation of state files were used for testing.