lattice / quda

QUDA is a library for performing calculations in lattice QCD on GPUs.
https://lattice.github.io/quda
Other
286 stars 94 forks source link

loadCPUField segfaults with QUDA_ASQTAD_FAT_LINKS #52

Closed jpfoley closed 11 years ago

jpfoley commented 12 years ago

Not too troublesome, since you can get it to work by using QUDA_WILSON_LINKS instead. Still, it's inconsistent, and caused me a couple of hours of pain.

gshi commented 12 years ago

We probably need add QUDA_ASQTAD_SITE_LINKS, or other similar names, to indicate the normal links in staggered case.

maddyscientist commented 12 years ago

Has this issue been resolved? I recall that there was name changes a few months back with the link types, but I don't know how that affected this issue.

maddyscientist commented 12 years ago

I cannot reproduce this error using the tests. I have played with the HISQ force tests and the staggered dslash tests, but setting to QUDA_ASQTAD_FAT_LINKS does not cause any seg faults. This bug may already been fixed inadvertently.

Justin, how did you reproduce this error? If it can't be reproduced, then we should close this.

jpfoley commented 12 years ago

I was seeing this in the MILC interface. This may have been fixed in the meantime, but unbeknownst to me. I will check this tonight, and if it's fixed we can close it.

Justin.

On 08/08/2012 05:59 PM, mikeaclark wrote:

I cannot reproduce this error using the tests. I have played with the HISQ force tests and the staggered dslash tests, but setting to QUDA_ASQTAD_FAT_LINKS does not cause any seg faults. This bug may already been fixed inadvertently.

Justin, how did you reproduce this error? If it can't be reproduced, then we should close this.

— Reply to this email directly or view it on GitHub https://github.com/lattice/quda/issues/52#issuecomment-7601505.

jpfoley commented 11 years ago

Okay, I finally able to recreate the problem, and I see what's going on. This problem only pops up in the single-gpu interface code. Anyway, I was calling loadCPUField with QUDA_MILC_GAUGE_ORDER. This worked if I had QUDA_WILSON_LINKS. but failed with QUDA_ASQTAD_FATLINKS. I now see the problem is in lines 72 and 73 of cuda_gauge_field.cpp. Basically, if type == QUDA_ASQTAD_FAT_LINKS, fat_link_max, which is needed for half precision, is calculated. However, this calculation assumes QUDA_QDP_GAUGE_ORDER, hence the segmentation fault. Note that I am not actually using half precision but fat_link_max is calculated regardless. If type != QUDA_ASQTAD_FAT_LINKS, fat_link_max is not calculated and there is no requirement that the field use QUDA_QDP_GAUGER_ORDER. It's trivial to make this code more general and to make it so fat_link_max is only calculated if it is actually needed. I'll make the necessary changes to the code.