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

Rust isn't actually doing any work? #6

Closed
ChrisJefferson opened this issue Feb 13, 2017 · 4 comments
Closed

Rust isn't actually doing any work? #6

ChrisJefferson opened this issue Feb 13, 2017 · 4 comments

Comments

@ChrisJefferson
Copy link

ChrisJefferson commented Feb 13, 2017

I'm not an expert on rust, but I added to the end: println!("{:?}",x); (to check the answer), to the end of main and now the runtime on my machine has gone from 11 seconds to more than 2 minutes. Still running.

@ChrisJefferson
Copy link
Author

Update: final output is 134 seconds, and also the output is [[NaN, NaN, NaN], [NaN, NaN, NaN]] (batman)

@Omegaice
Copy link

I modified all the tests to randomize the values of X, V, A and M and then at the end of the code printed out the first value of each. I get the following times:

Go: 288.13s
C: 169.73s
Fortran: 145.25s
Rust: 139.03s

Obviously this was a very quick modification and I am now adding some noise because the timing includes the initialization of the arrays rather than a memset.

To do this properly I would want the code to read in its initial data from the disk, calculate the time it takes to do the integration steps and then write out the results to a file.

@StefanKarpinski
Copy link

PR fixing this: #8

@marblestation
Copy link
Owner

Now all the codes print the final positions: 8b89e8d, 33c6945

On my machine:

C: 2m24.406s
Fortran: 2m47.544s
Rust: 2m7.585s
Go: 5m15.997s

There is still NaN since everything is initialised to zero and there is a division by zero. That's something to improve, not sure how it affects the execution time comparison.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants