-
Notifications
You must be signed in to change notification settings - Fork 345
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
Add comparison operator for boxarray and distromap. Add hdf5 to dep.py #4173
Conversation
@@ -86,4 +86,9 @@ extern "C" { | |||
Box bx(IntVect(lo), IntVect(hi), ba->ixType()); | |||
return ba->intersects(bx); | |||
} | |||
|
|||
bool amrex_fi_boxarray_issame (const BoxArray& baa, const BoxArray& bab) |
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.
We should use const BoxArray*
instead of const BoxArray&
, because const &
is not part of C. We probably should also use int
on the C/C++ side and c_int
on the Fortran side, because Fortran logical
may not be compatible.
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.
That makes sense, I'll make those changes.
Could we add |
Sorry, I don't know what you mean by adding |
Something like
This will allow the users to write |
I see, thanks. I made those changes, and now in my fortran code, |
I am not sure what you are talking about. The fortran function should still return |
Ah, okay. I think I misunderstood what you were suggesting. I changed all the functions to return integers. I will push my changes though |
My suggestion is the bind(c) functions use |
The reason is I mentioned previously that Fortran logical may not be compatible with C/C++ bool. With gfotran,
produces But with g++, the sizeof |
That makes sense, thanks. I'm trying it now using logical for the fortran code, integer for the bind(c) code, and int for the c code. I think it's working, I just want to be sure before I push it |
Sorry, I couldn't get it to work right. Before the changes, the function would return true when it should have, but after the changes it returns false. I just pushed my changes |
Okay, I will try to fix it and ask you to test. |
That did it, thanks! I just pushed the changes |
We should also use |
Yes, that works |
Summary
Add
issame
function for boxarray and for distromap for the Fortran interface. Also add "hdf5" to dep.py to suppress warnings.Additional background
Checklist
The proposed changes: