E3SM icon indicating copy to clipboard operation
E3SM copied to clipboard

PR 5721 broke homme build with kokkos built externally

Open oksanaguba opened this issue 2 years ago • 7 comments

i think PR #5721 broke our capability in standalone homme to supply kokkos via E3SM_KOKKOS_PATH. I inserted some kludges like

if("${E3SM_KOKKOS_PATH}" STREQUAL "")
IF (HOMME_USE_KOKKOS AND HOMME_STANDALONE)
  # Add ekat's cmake/pkg_build folder to cmake path
  set (EKAT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../externals/ekat)
  set (EKAT_CMAKE_PATH ${EKAT_SOURCE_DIR}/cmake)
  list(APPEND CMAKE_MODULE_PATH
       ${EKAT_CMAKE_PATH}
       ${EKAT_CMAKE_PATH}/pkg_build
  )
  include (EkatBuildKokkos)
  BuildKokkos()
ENDIF ()
ELSE ()
  IF (${HOMME_USE_KOKKOS})
  INCLUDE(Kokkos)
  ENDIF ()
ENDIF ()

and

  if("${E3SM_KOKKOS_PATH}" STREQUAL "")
    target_link_libraries(${target_name} kokkos)
  else()
    link_to_kokkos(${target_name})
  endif()

and brought back file cmake/Kokkos.cmake . Not sure this is how @bartgol thinks it should be fixed.

oksanaguba avatar Sep 30 '23 18:09 oksanaguba

I'll take a look.

bartgol avatar Oct 02 '23 15:10 bartgol

Ah, you're right. I think this is part of a bigger issue: allow Ekat to use pre-built tpls. It's on my todo list, I will bump it up and try to get to it this week.

bartgol avatar Oct 02 '23 17:10 bartgol

My temp fixes work for now, so, maybe you do not need to make it a priority. why are my fixes (or something along that, maybe, with E3SM_KOKKOS_PATH being renamed into HOMME_KOKKOS_PATH) not good for this, why do you need to get ekat into it?

oksanaguba avatar Oct 02 '23 17:10 oksanaguba

The reason to get ekat was to avoid code duplication, and having to maintain two sets of config files. If you think it's best, feel free to bring back homme standalone system (as you did, meaning only if HOMME_STANDALONE is TRUE).

bartgol avatar Oct 02 '23 17:10 bartgol

Orthogonal comment (i.e., neutral w.r.t. the specific issue described above): One way to bring in a different Kokkos, including for standalone Homme and with the benefit of some level of provenance, is to make EKAT's Kokkos submodule point to whatever version you want.

ambrad avatar Oct 02 '23 19:10 ambrad

thanks @ambrad and @bartgol , yes, pointing ekat may be the best solution, so we do not need to fix this in homme at all.

oksanaguba avatar Oct 02 '23 21:10 oksanaguba

Good point, I forgot about that possibility. I still think EKAT should use a pre-installed kokkos (if available, and if it matches required config options, such as the right device, and possibly version). So I will have to work on this.

bartgol avatar Oct 02 '23 22:10 bartgol