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

TimeHistory cannot output scalar information #2289

Open
TotoGaz opened this issue Feb 9, 2023 · 6 comments
Open

TimeHistory cannot output scalar information #2289

TotoGaz opened this issue Feb 9, 2023 · 6 comments
Assignees
Labels
type: feature New feature or request

Comments

@TotoGaz
Copy link
Contributor

TotoGaz commented Feb 9, 2023

We'd like to output quantities like mean pressure in a reservoir, or the number of iterations in the loops.
Those are scalar quantities which are currently not supported.
This is a tool which would bring a lot of value to GEOSX's users.

Three examples can be used:

  • Computation of the well bhp (registered here) as a function of time.
  • Computation of linear iterations (registered here) as a function of time.
  • Computation of mean pressure (registered here) as a function of time.
    For this one, RegionStatistics surely needs to be adapted.
@TotoGaz TotoGaz added type: bug Something isn't working type: feature New feature or request and removed type: bug Something isn't working labels Feb 9, 2023
@TotoGaz TotoGaz self-assigned this Feb 10, 2023
@TotoGaz
Copy link
Contributor Author

TotoGaz commented Feb 16, 2023

With the current implementation, we end up in the function https://github.com/GEOSX/GEOSX/blob/develop/src/coreComponents/dataRepository/BufferOpsDevice.hpp#L154-L163
which does not allow the packing of scalar information.

On a CPU target (non GPU), implementing a quick and dirty packing function makes the TimeHistory/PackCollection process work: scalar information is written into the hdf5 output file.

This open some questions about the packing: is it legit to impose the onDevice flag or should the geosx fwk deal it for us? Should we ignore the flag if not relevant/possible?

@TotoGaz TotoGaz removed their assignment Feb 16, 2023
@untereiner
Copy link
Contributor

I a not quite understanding why scalar information can't be memcopied from gpu to cpu.
I found a work for HDF5 on a virtual File Driver for GPUDirect Storage: https://github.com/hpc-io/vfd-gds
Maybe a silly question but I am wondering changing the VFD depending on the target would not help to write to an HDF5 file... probably not for the pack/unpack operations...

@klevzoff
Copy link
Contributor

Scalar data doesn't live in the GPU memory space in the first place, because there is no good reason to bring it there. It's only ever updated on the host, and if a read-only value is needed in a kernel it is much more efficiently passed via kernel arguments (e.g. embedded in the closure object passed to RAJA).

We should just ignore the onDevice flag when it's not meaningful as a quick solution. A more general approach, as discussed, would be to query the last-modified memory space for each piece of data and dispatch to the appropriate packing function.

@wrtobin
Copy link
Collaborator

wrtobin commented Apr 4, 2023

WIP #2369.

This PR should resolve any scalar packing where the scalar resides on host using the legacy packing functions.

@paveltomin
Copy link
Contributor

knock knock

@paveltomin
Copy link
Contributor

who is there?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature New feature or request
Projects
None yet
Development

No branches or pull requests

7 participants