AMReX-Codes / amrex

AMReX: Software Framework for Block Structured AMR
https://amrex-codes.github.io/amrex
Other
530 stars 343 forks source link

BL_NO_FORT #671

Closed jrood-nrel closed 4 years ago

jrood-nrel commented 4 years ago

Hello. Is it possible to truly remove fortran from compilation in AMReX? I have tried using BL_NO_FORT=TRUE but it doesn't seem to exclude every fortran file and I have compilation errors with AMReX fortran use statements that still exist in AMReX code.

WeiqunZhang commented 4 years ago

Which code is this? We only made sure Src/Base works with BL_NO_FORT so that viz people can use it. Which directories under Src/ are you using?

jrood-nrel commented 4 years ago

This is for PeleC. We have removed all of our Fortran code, but we still need a Fortran compiler for AMReX. We include Base Amr Boundary AmrCore.

WeiqunZhang commented 4 years ago

There are a few things in AMReX we need to do to get rid of Fortran compiler requirement for PeleC. In Src/Base/ AMReX still uses a Fortran function for fill ghost cells in fillpatch when not using GPU. In AmrCore, some spatial interpolation routines have not been ported to C++/GPU. However I don't think PeleC uses them. So we can ifdef them out when BL_NO_FORT is TRUE. In Amr/, there is a first-order extrapolation routine there is still in Fortran. I don't think PeleC needs it. But it's used by IAMR/PeleLM. So we will port it to C++/GPU. I think that's all we need to do.

WeiqunZhang commented 4 years ago

Which version of PeleC? I want to test it.

WeiqunZhang commented 4 years ago

Anyway, could you give weiqun/bl_no_fort branch a try? You need to compile with BL_NO_FORT=TRUE.

jrood-nrel commented 4 years ago

We are working in this repo and branch which has no fortran. https://github.com/jrood-nrel/PeleG/tree/eb

WeiqunZhang commented 4 years ago

I tried in PeleG/RegTests/HIP. It seems to work. (Note that I just updated weiqun/bl_no_fort to avoid linking to gfortran.)

jrood-nrel commented 4 years ago

Thanks! I just tried that branch and it works as expected. It's not critical that we avoid Fortran in AMReX, but it's nice to not require any Fortran compiler when building now.

WeiqunZhang commented 4 years ago

OK. Great. I will merge this branch into development next week.

jrood-nrel commented 4 years ago

Sounds good!