Allow for KOKKOS_ARCH keyword in <build-name> string to be lower case and separated by '_'
Created by: bartlettroscoe
CC: @fryeguy52
Description
The SPARC convention for the KOKKOS_ARCH name in their build strings is to use lower-case letters like hsw
and knl
vs. HSW
and KNL
and to use underscores '_' to separate arguments. Currently, the ATDM Trilinos build-name parsing system described here only support upper-case and camel-case names like HSW
, KNL
, and Pascal60
and requires these to be preceded by a dash '-'. This is the last aspect of the currently ATDM Trilinos build name parsing system that does not match the preferences used by SPARC.
This story is to refactor the ATDM Trilinos parsing system (as implemented in cmake/std/atdm/utils/set_build_options.sh
) to allow both the current upper-case and camel-case names separated by dashes '-' and to allow lower-case names separated by underscores '_'.
Proposed Solution
The proposed solution is to write a bash function like
atdm_match_kokkos_arch_keyword <supported_kokkos_arc> <kokkos_arch_inout>
and then use it as:
ATDM_SUPPORTED_KOKKOS_ARCH_LIST=(
HSW
KNL
...
Pascal60
...
)
export ATDM_CONFIG_KOKKOS_ARCH=DEFAULT
for ATDM_SUPPPORTED_KOKKOS_ARCH in ${ATDM_SUPPORTED_KOKKOS_ARCH_LIST[@]} do ;
atdm_match_kokkos_arch_keyword ${ATDM_SUPPPORTED_KOKKOS_ARCH} ATDM_CONFIG_KOKKOS_ARCH
if [[ "${ATDM_CONFIG_KOKKOS_ARCH}" != "DEFAULT" ]] ; then
break
fi
done
The function atdm_match_kokkos_arch_keyword
would check for -<supported_kokkos_arc>
and _<supported_kokkos_arc>
and then lower case -<supported_kokkos_arc_lc>
and _<supported_kokkos_arc_lc>
. If any of those matched, then it would update the variable <kokkos_arch_inout>
to be <supported_kokkos_arc>
. Easy as pie.