-
Notifications
You must be signed in to change notification settings - Fork 116
GPU support for the black oil fluid system #4669
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
GPU support for the black oil fluid system #4669
Conversation
|
jenkins build this serial rocm hipify please |
|
jenkins build this serial rocm hipify please |
|
Jenkins build this opm-simulators=6385 serial rocm hipify please |
|
Jenkins build this opm-simulators=6385 serial rocm hipify please |
2 similar comments
|
Jenkins build this opm-simulators=6385 serial rocm hipify please |
|
Jenkins build this opm-simulators=6385 serial rocm hipify please |
|
Jenkins build this opm-simulators=6385 serial rocm hipify please |
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.
Partially reviewed only, stopping here to get feedback before continuing.
b103af0 to
9c003b5
Compare
|
Jenkins build this opm-simulators=6385 serial rocm hipify please |
2 similar comments
|
Jenkins build this opm-simulators=6385 serial rocm hipify please |
|
Jenkins build this opm-simulators=6385 serial rocm hipify please |
| */ | ||
| #if HAVE_CUDA | ||
| #if USE_HIP | ||
| #include <opm/simulators/linalg/gpuistl_hip/GpuVector.hpp> |
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.
As this pattern becomes more prevalent with the new PRs we should prioritize more either unifying these paths in cmake (i do not know how to do this), or maybe introduce a macro that handles this logic for us. Not necessary for this PR.
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 agree, for now at least, this file isolates it pretty well though, in the sense that one only has to include this file and not worry about it outside of this file.
|
|
||
| } // namespace Opm | ||
|
|
||
| #endif // OPM_NULL_OIL_PVT_HPP No newline at end of file |
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.
missing endline
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.
Fixed
| * Used when oil phase is not active or not supported. | ||
| */ | ||
| template <class Scalar> | ||
| class NullOilPvt |
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.
The NullOilPvt is needed because we do not support Oil for now in the GPU-variant but still need to have some object with the oil interface?
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.
Exactly. The big change was that we removed pointers from the BOFS, meaning we could no longer simply put the OilPvt-pointer to null.
| #include <opm/simulators/linalg/gpuistl_hip/GpuBuffer.hpp> | ||
| #include <opm/simulators/linalg/gpuistl_hip/GpuView.hpp> | ||
| #include <opm/simulators/linalg/gpuistl_hip/gpu_smart_pointer.hpp> | ||
| #else // USE_HIP |
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.
USE_HIP i guess annotates what the #if is based on, but it looks a bit misleading when it marks the start of the case where we are primarily interested i fact that USE_HIP is false and that HAVE_CUDA is true.
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.
Fixed
4697233 to
ee20570
Compare
|
Jenkins build this opm-simulators=6385 serial rocm hipify please |
| bool _enableVaporizedOil_, | ||
| bool _enableVaporizedWater_, | ||
| bool _enableDiffusion_, | ||
| Storage<std::array<Scalar, 3>> _referenceDensity_, |
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 propose taking an rvalue ref argument here, and using std::move on line 221, similar for the other data.
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.
Apart from this, I have no further requests.
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.
Fixed.
|
Jenkins build this opm-simulators=6385 serial rocm hipify please |
1 similar comment
|
Jenkins build this opm-simulators=6385 serial rocm hipify please |
|
Jenkins build this opm-simulators=6385 serial rocm hipify please |
1 similar comment
|
Jenkins build this opm-simulators=6385 serial rocm hipify please |
|
Both this and the downstream PR have been reviewed and revised, all is green, merging. |
This is a resurrection of PR #4504 with some slight modifications. Making it draft as of now.
This PR adds the needed
copy_to_gpuandmake_viewfunctions for the BlackOilFluidSystem. To keep the mental cost low for the newly added functions, a slight refactor has been done to the lower levelcopy_to_gpuandmake_viewfunctions for the multiplexer, PVTs and CO2 tables in that they no longer receive the storage classes as template arguments, but deduce them themselves.This change is possible since we are using the newly introduced header file
gpuistl_if_available.hppwhich will include the gpu-ISTL headers (or the core of them, meaning the buffer, vector, view and smart_pointer) ifHAVE_CUDA=1.