-
Notifications
You must be signed in to change notification settings - Fork 110
Function to write gauge fields to disk #1607
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
Conversation
|
Thanks for the PR, Leon, this looks good to me and is a good contribution. I had an idea to simplify this which should be a relatively quick copy+paste job. You could create a null CPU field at the start of the function, and then within the I think this should all "just work", but let me know what you think. |
|
@weinbe2 I have revised and retested. Let me know what you think. I think it is indeed better now with the logic for each case easier to follow and more self-contained/local. |
|
Thanks @leonhostetler , this is exactly what I was picturing. I left one comment on the code for a trivial change. Otherwise, I'll do a cursory due-diligence build (I expect no surprises) and give an approve once the change is in. |
lib/interface_quda.cpp
Outdated
| GaugeField cudaGauge(cuda_param); | ||
| copyExtendedGauge(cudaGauge, *gaugeSmeared, QUDA_CUDA_FIELD_LOCATION); | ||
| cpuGauge.copy(cudaGauge); | ||
| break; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this break; needs to be below the closing } on the following line, if anything as a "best practice". The case QUDA_SMEARED_LINKS: block will always hit the break; in this case so it should be legal, but it still feels a bit too weird to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I see what you mean. I have made the change.
weinbe2
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great. Thanks @leonhostetler
Adds a function
writeGaugeQudatolib/interface_quda.cpp. This function is similar tosaveGaugeQudabut writes the gauge field to disk instead of just copying it to host.The motivation for this is a desire to be able to write a gradient flowed gauge field (i.e.
gaugeSmeared) to disk after usingperformWFlowQudaorperformGFlowQuda, without going through the rigamarole of allocating space from MILC, copying the flowed field back to MILC, and then writing it to disk. This will also allow us to write the fat and long links to disk, which is something we've been working on as well.