-
Notifications
You must be signed in to change notification settings - Fork 64
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
Update iso c binding library, replace PR#490 #491
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.
Will need to update the fortran unit test model code to implement these as well, and we could probably replicate the stand alone test conditions in the ngen unit tests at that point.
Other than that this looks like a reasonable implementation to make the binding conformant with BMI 2.0.
@@ -56,7 +65,7 @@ void check_status(int* status, char* name){ | |||
} | |||
else{ | |||
printf("FAILURE\n"); | |||
exit(*status); | |||
//exit(*status); //temporarily disable so test can continue |
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.
Does this need to come back?
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.
If not commented out, the test exit from the first failure test, the rest of the code won't get run.
I like the idea of check_failure function. Well thought out.
…On Tue, Jan 24, 2023 at 9:12 AM Nels ***@***.***> wrote:
***@***.**** commented on this pull request.
Will need to update the fortran unit test model code to implement these as
well, and we could probably replicate the stand alone test conditions in
the ngen unit tests at that point.
Other than that this looks like a reasonable implementation to make the
binding conformant with BMI 2.0.
------------------------------
In extern/iso_c_fortran_bmi/test/test_iso_c.c
<#491 (comment)>:
> @@ -56,7 +65,7 @@ void check_status(int* status, char* name){
}
else{
printf("FAILURE\n");
- exit(*status);
+ //exit(*status); //temporarily disable so test can continue
Does this need to come back?
------------------------------
In extern/iso_c_fortran_bmi/test/test_iso_c.c
<#491 (comment)>:
> @@ -204,6 +213,45 @@ int main(int argc, char** argv)
printf("get_value_double INPUT_VAR_1: %f\n", value_d);
check_status(&status, "get_value_double");
+ value = -2;
+ int *value_ptr = &value;
+ status = get_value_ptr_int(&bmi_handle, "INPUT_VAR_3", value_ptr);
+ printf("get_value_ptr_int: %d\n", value_ptr);
+ //printf("get_value_ptr_int: %d\n", *value_ptr); //Can uncomment this line if "dest_ptr != c_null_ptr" in iso_c_bmi.f90
+ check_status(&status, "get_value_ptr_int");
Perhaps a new function is needed here to check for BMI_FAILURE as a
"correct" behaviour.
void check_failure(int* status, char* name) {
if( *status == BMI_FAILURE ){
printf("EXPECTED FAILURE\n");
}
else {
printf("FAILURE TO FAIL\n");
exit(-1);
}
}
then call this when you are expecting a failure.
—
Reply to this email directly, view it on GitHub
<#491 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACA4SRMCW2BETVU7GOXEQO3WT7WPHANCNFSM6AAAAAAUAZO6JY>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Will open an issue about to update the test_bmi_fortran unit test model, that can be done in a separate PR. |
Update ISO C Binding library functions to be compatible with new noah-owp-modular.
Additions
Removals
Changes
extern/iso_c_fortran_bmi/src/bmi.f90
extern/iso_c_fortran_bmi/src/iso_c_bmi.f90
extern/iso_c_fortran_bmi/test/test_iso_c.c
Testing
Unit tests
Run ngen test
Build and run test_iso_c.c
Screenshots
Notes
This PR replace PR#490
Todos
Checklist
Testing checklist (automated report can be put here)
Target Environment support