-
Notifications
You must be signed in to change notification settings - Fork 369
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
Porting fortran files to cpp in Src/Extern/HYPRE #1049
Conversation
Thanks for the PR! There are two issues need to be fixed. First, this breaks PETSc because |
There are still some issues that I have to check |
Co-authored-by: WeiqunZhang <WeiqunZhang@lbl.gov>
Src/Extern/HYPRE/AMReX_Habec_2D_K.H
Outdated
namespace amrex { | ||
|
||
AMREX_FORCE_INLINE | ||
void amrex_hpacoef (Box const& box, |
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 2d version of amrex_hpacoef
is identical to the 3d version. Could we move them to a new file AMReX_Habec_K.H
? Maybe move the following block in AMReX_HypreABecLap.cpp
to AMReX_Habec_K.H
too?
#if (AMREX_SPACEDIM == 2)
#include <AMReX_Habec_2D_K.H>
#elif (AMREX_SPACEDIM == 3)
#include <AMReX_Habec_3D_K.H>
#endif
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.
sure!!
Currently it does not compile with |
Now it compiles with USE_CUDA=TRUE |
Src/Extern/HYPRE/AMReX_Habec_2D_K.H
Outdated
|
||
diag_arr(i,j,k) = 1.0/mat_tmpPtr[0]; | ||
|
||
for (int ic=0; ic<=5; ic++){ |
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.
Should this be 4
instead of 5
?
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.
ohh yeah, now it is fixed! Thanks.
Src/Extern/HYPRE/AMReX_Habec_2D_K.H
Outdated
AMREX_HOST_DEVICE_PARALLEL_FOR_3D (box, i, j, k, | ||
{ | ||
if (msk_arr(lo.x-1,j,k) > 0 && i==lo.x){ |
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.
AMREX_HOST_DEVICE_PARALLEL_FOR_3D (box, i, j, k, | |
{ | |
if (msk_arr(lo.x-1,j,k) > 0 && i==lo.x){ | |
Box tbx = box; | |
tbx.setSmall(0,lo.x).setBig(0,lo.x); // 0: x-direction | |
AMREX_HOST_DEVICE_PARALLEL_FOR_3D (tbx, i, j, k, | |
{ |
The looping is on a slice only. Could you fix in other place too including 3D?
Co-authored-by: WeiqunZhang <WeiqunZhang@lbl.gov>
I have replaced AMReX_HABEC_2D.F90 with AMReX_Habec_2D_K.H and AMReX_Habec_2D.cpp
I have replaced AMReX_HABEC_3D.F90 with AMReX_Habec_3D_K.H and AMReX_Habec_3D.cpp