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

Mismatch between GPU and CPU simulations "pyridineDensOverlap" example #284

Open
andr3ac opened this issue Jun 6, 2024 · 2 comments
Open
Assignees

Comments

@andr3ac
Copy link

andr3ac commented Jun 6, 2024

I ran the "pyridineDensOverlap" example with the GPU and CPU versions (https://github.com/Probe-Particle/ppafm/tree/main/examples/pyridineDensOverlap). Using the same input files and comparing the results, I noticed differences in the simulated images generated. For most simulations, there is a match; but some appear quite different (e.g., df_024.png or df_029.png). What are these differences due to? I expected much more similar results. Am I missing something? Thank you
df_024
df_024
df_029
df_029

@NikoOinonen
Copy link
Collaborator

The GPU version is using some faster approximations in various parts of the computation, which means that it's potentially less stable in some respects.

In this case it's a interpolation error that comes from resampling the charge density and Hartree potential to a coarser grid. If you set the grid density higher by putting pixPerAngstrome=14 (the original grid density) in the run_gpu.py script, then the rings should disappear, but this also makes the computation slower and requires significantly more memory.

I actually spotted this one before but forgot about it. We probably should fix this but I'm not sure how, because for example my laptop GPU runs out of memory if I set the grid density to that value.

@yakutovicha
Copy link
Collaborator

We agreed that @NikoOinonen will take on the task of adding documentation explaining the areas of applicability of different methods/approximations. After that, the issue can be closed.

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

No branches or pull requests

3 participants