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

Is this N/3 correct? #1886

Open
alecjacobson opened this issue May 19, 2024 · 10 comments
Open

Is this N/3 correct? #1886

alecjacobson opened this issue May 19, 2024 · 10 comments

Comments

@alecjacobson
Copy link

for (size_t j = 0; j < N/3; j ++) {

N seems to be the number of 3D nodes. So that pos and x are arrays of length 3*N.

This N/3 seems to mean that only first ⅓ of the springs are considered.

@alecjacobson
Copy link
Author

And if it's changed to N then it seems the i*3+4 etc. need a %(N*3) to wrap around the circle of springs.

@wsmoses
Copy link
Member

wsmoses commented May 19, 2024 via email

@wsmoses
Copy link
Member

wsmoses commented May 19, 2024

I'm not sure about the % . I need to double check what this test is validating for, but the wrap around in the actual benchmarks is done via the todense to create the actual double pointers (and accessing them will implicitly wrap around)

@wsmoses
Copy link
Member

wsmoses commented May 19, 2024 via email

@alecjacobson
Copy link
Author

Thanks. @martinjm97 do you mind adding me as a collaborator on that repo so I can copy the benchmark for our comparison?

@martinjm97
Copy link
Collaborator

Sorry, I just saw this. I've added you to the repo.

@wsmoses
Copy link
Member

wsmoses commented May 19, 2024

I don't think I have access to that repo, @deomaiidae if you can add me

@martinjm97
Copy link
Collaborator

@alecjacobson the code has a bug as you pointed out. Moreover, the benchmarking script calls the file at this location. However, when I ran the benchmarking script, I ran a version of the code that fixed this bug (and also printed out how much time the benchmark took to run). I've made a PR of the code I ran: #1889.

@wsmoses
Copy link
Member

wsmoses commented May 19, 2024

Yeah that post sparse todense is the one I remember working with you on during benchmarking, so that looks right.

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

3 participants