spirit-code / spirit

Atomistic Spin Simulation Framework
http://spirit-code.github.io
MIT License
117 stars 52 forks source link

Weird results caused by using CUDA #596

Closed zangyuzhe closed 3 years ago

zangyuzhe commented 3 years ago

Hi,

I found some weird results caused by using CUDA. Log file, cfg file, initial state and final state are attached.

I can’t relax a skyrmion even under 100T external field with the attached cfg file. When using CUDA, some spins in the centre are pinned and can’t be flipped. But this doesn’t happen if I use pip version of spirit.

Can anyone help me sort this out?

Many thanks, Yuzhe

System information:

skyrmion_state FInal_state Log_2021-05-09_11-04-41.txt input_modified.cfg.txt 2021-05-09_11-05-42_Image-00_Spins-final.ovf.txt

GPMueller commented 3 years ago

There might be an issue with the multi-atom basis, this looks like a bug. With the CUDA version it can always be due to the lack of precision (the CUDA backend is limited to single precision float). However, your log indicates that the pairs were correctly identified,

2021-05-09 11:04:41  [ PARAM ] [IO  ] [--] [--]  Done reading 50 spin pairs from file "input/input_modified.cfg", giving 10 exchange and 10 DM (symmetry-reduced) pairs.

(at least I get the same on my machine).

I suspect that these stripes will appear throughout the whole system if you start from a random configuration? It might be an issue with the dipolar interactions, please try switching them off (ddi_method none) and see if the issue persists. If not, we seem to have a bug in the cuFFT implementation of the DDI.

zangyuzhe commented 3 years ago

I have done a quick test which started from a random configuration. This is the result with DDI. WIth_DDI

This is the result without DDI. Without_DDI

GPMueller commented 3 years ago

Looks to me like the bugfix from commit 3e46c0daee624abf042117ae87a779ff6e979704 was not applied to the CUDA backend, leading to indexing errors when using a multi-atom basis.

MSallermann commented 3 years ago

Dear @zangyuzhe, thank you for pointing out these issues! There were indeed several bugs in the cuda backend with regard to multi-atom bases. I have pushed fixes to the develop branch 382cac3c7e9176db707512afbdbaa1e189b9384b. According to my checks, the issues you encountered should be fixed now. Please let us know if you find more problems!

zangyuzhe commented 3 years ago

Dear @MSallermann , I will run some test simulation today. If there is any problem, I will let u know.

GPMueller commented 3 years ago

Dear @zangyuzhe, is your problem solved so we could close this issue?

zangyuzhe commented 3 years ago

Dear @GPMueller , thank you for ur help. Problem has been resolved.