-
Notifications
You must be signed in to change notification settings - Fork 9
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
Field resize #6
Field resize #6
Conversation
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.
Looks good to me. I'd be curious if the advanced OO pattern (abstract deferred procedures) are supported on device with NVHPC? We don't depend on device-safety though, so not a showstopper.
The rest are minor nitpicks, so otherwise GTG from me.
@@ -52,6 +52,8 @@ CONTAINS | |||
PROCEDURE :: SYNC_DEVICE_RDONLY => ${ftn}$_SYNC_DEVICE_RDONLY | |||
PROCEDURE :: COPY_OBJECT => ${ftn}$_COPY_OBJECT | |||
PROCEDURE :: WIPE_OBJECT => ${ftn}$_WIPE_OBJECT | |||
PROCEDURE(GET_DIMS), DEFERRED :: GET_DIMS |
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 cool, but pretty advanced OO usage. Is this device-safe? Has this been checked? Not a showstopper for me, as we don't use FIELD objects on device yet; I was just curious how far NVHPC supports this.
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.
It's not possible to use the deferred method on the device, but I think it's not possible to use any type-bound method on the device anyway. Those methods are meant to be used on the host, in preparation of the compute kernels executing on the device. That being said, it is just a limitation of the openacc implementation, it would make sense to be able to call some methods on the device, like get_dims for instance.
tests/resize_wrapper.F90
Outdated
REAL(KIND=JPRB) :: D(5,5) | ||
|
||
CALL FIELD_NEW(W, DATA=D) | ||
CALL FIELD_RESIZE(W, UBOUNDS=[100,100]) |
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.
[just nitpicking] I take it the by marking this in the ABOR1_TEST_FILES failure gets checked? It could be helpful to make the exact place in code where that's supposed to happen.
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.
Added a comment to show the line calling abor1
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.
Thanks for adding this very useful feature @dareg! Could you please update the copyright headers for the new files? Other than that, looks good from my side 👍
tests/resize_owner.F90
Outdated
! distributed under the License is distributed on an "AS IS" BASIS, | ||
! WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
! See the License for the specific language governing permissions and | ||
! limitations under the License. |
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 license header here is missing that one extra sentence we need for ECMWF. @dareg could you please add that in? Same for the other two new files.
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.
Updated the headers to match the other headers.
Please wait before merging, I need to add a test for get_dims. |
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.
Thanks for addressing the comments @dareg! G2G from my side.
Add the ability to resize an existing field owner variable.