Skip to content
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

AmrLevel Tutorial & SP: Fortran Types in Memorypool #1183

Open
ax3l opened this issue Jul 23, 2020 · 0 comments
Open

AmrLevel Tutorial & SP: Fortran Types in Memorypool #1183

ax3l opened this issue Jul 23, 2020 · 0 comments

Comments

@ax3l
Copy link
Member

ax3l commented Jul 23, 2020

The AmrLevel tutorial is hard-coded in double precision, which means it fails to build against AMReX with single-precision support since the memory pool bindings in Fortran only expose single or double precision routines.

Example reproducer with CMake (but not specific to CMake):

cmake .. -DENABLE_TUTORIALS=ON -DENABLE_DP=OFF
make tutorials VERBOSE=ON

(Seen with both GCC 7.5 and Clang 6.0 on my Ubuntu 18.04.)

amrex/Tutorials/Amr/Advection_AmrLevel/Source/Src_3d/slope_3d.f90:146:72:     call bl_allocate(dsgn, lo(1), hi(1), lo(2), hi(2), lo(3)-1, hi(3)+1)
                                                                        1
Error: There is no specific subroutine for the generic 'bl_allocate' at (1)

The solution is probably to expose bindings to SP and DP in the Fortran memory pool interfaces, independent of the build type. (In the practical case, a user might use SP by default and has some selected helper functionality in DP for numerical reasons.)

Refs.:

cc @WeiqunZhang @mic84

@ax3l ax3l changed the title AmrLevel Fortran Tutorial & SP: Exposed Functions in Memorypool AmrLevel Tutorial & SP: Fortran Types in Memorypool Jul 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant