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

Bug fixes for GPU-aware Put and Get #3090

Merged
merged 9 commits into from
Mar 8, 2022

Conversation

anagainaru
Copy link
Contributor

Bug fixes include:

  • Add the GPU logic in the new NdCopy function that broke the Get code for the BP5 engine (removed all the unused functions)
  • Change the default memory space to Detect when CUDA is enabled and fixed the bugs caused by this
  • Added examples for BP5 and BP4 using GPU buffers (and removed the generic one that was only testing one engine)

@@ -1248,7 +1251,8 @@ void BP5Deserializer::FinalizeGets(std::vector<ReadRequest> Requests)

helper::NdCopy(IncomingData, inStart, inCount, true, true,
(char *)Req.Data, outStart, outCount, true,
true, ElementSize);
true, ElementSize, Dims(), Dims(), Dims(),
Dims(), false, Req.MemSpace);
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@eisenhauer This is the only part I don't like from my fix (having to spell out the default arguments), but I honestly didn't know how to make it better without breaking other parts of the code.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@anagainaru If you want to avoid this, add MemSpace in the argument list after ElementSize rather than at the end. (ElementSize is itself a new argument, introduced a few weeks ago when NdCopy got un-templated. (The only way that templates were employed was in "sizeof(T)" and it was judged not worth having a dozen instances of the same code that differed only in that one constant, so ElementSize was made a parameter and the templating removed. But yes, the default args meant that the new parameter was best introduced before all the args with default values...)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@anagainaru If you want to avoid this, add MemSpace in the argument list after ElementSize rather than at the end. (ElementSize is itself a new argument, introduced a few weeks ago when NdCopy got un-templated. (The only way that templates were employed was in "sizeof(T)" and it was judged not worth having a dozen instances of the same code that differed only in that one constant, so ElementSize was made a parameter and the templating removed. But yes, the default args meant that the new parameter was best introduced before all the args with default values...)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not move MemSpace up to the first optional parameter? Or simply make it a compulsory parameter? Even the current looking is fine. I don't see a big problem. The ultimate goal is probably to support memory selections under all circumstances anyway, in which case the empty Dims parameters will have to be replaced with something meaningful.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok I'll leave it like this for now and will figure out a better solution when we add more backends

@chuckatkins chuckatkins added this to the ADIOS v2.8.0 milestone Mar 5, 2022
@chuckatkins chuckatkins changed the base branch from master to release_28 March 5, 2022 09:00
@chuckatkins chuckatkins changed the base branch from release_28 to master March 5, 2022 09:08
@chuckatkins chuckatkins changed the base branch from master to release_28 March 5, 2022 09:08
Copy link
Member

@eisenhauer eisenhauer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other than the suggestion about relocating the MemSpace parameter, this looks good...

@anagainaru
Copy link
Contributor Author

anagainaru commented Mar 5, 2022

Other than the suggestion about relocating the MemSpace parameter, this looks good...

Later edit: I think your suggestion is good, I will try it

@anagainaru anagainaru merged commit b505402 into ornladios:release_28 Mar 8, 2022
chuckatkins pushed a commit that referenced this pull request Mar 8, 2022
Bug fixes for GPU-aware Put and Get
@anagainaru anagainaru deleted the cuda-doc branch December 27, 2022 23:35
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

Successfully merging this pull request may close these issues.

4 participants