• =?UTF-8?Q?Eliminate_variable_values_=E2=80=8B=E2=80=8Bor_functions_that

    From hongyi.zhao@gmail.com@21:1/5 to All on Wed Dec 29 06:32:24 2021
    On Ubuntu 20.04.3 LTS, I installed the following intel oneapi toolkits:

    https://registrationcenter-download.intel.com/akdlm/irc_nas/18445/l_BaseKit_p_2022.1.1.119_offline.sh
    https://registrationcenter-download.intel.com/akdlm/irc_nas/18438/l_HPCKit_p_2022.1.1.97_offline.sh

    At the same time, I use Lmod [1] to generate the corresponding environment module file as follows:

    =============
    werner@X10DAi-00:/opt/intel/oneapi$ sh_to_modulefile setvars.sh setenv("ACL_BOARD_VENDOR_PATH","/opt/Intel/OpenCLFPGA/oneAPI/Boards") setenv("ADVISOR_2022_DIR","/opt/intel/oneapi/advisor/2022.0.0") setenv("APM","/opt/intel/oneapi/advisor/2022.0.0/perfmodels") setenv("CCL_CONFIGURATION","cpu_gpu_dpcpp") setenv("CCL_ROOT","/opt/intel/oneapi/ccl/2021.5.0") setenv("CLASSPATH","/opt/intel/oneapi/mpi/2021.5.0//lib/mpi.jar:/opt/intel/oneapi/dal/2021.5.1/lib/onedal.jar")
    setenv("CLCK_ROOT","/opt/intel/oneapi/clck/2021.5.0") setenv("CMAKE_PREFIX_PATH","/opt/intel/oneapi/vpl/2022.0.0:/opt/intel/oneapi/tbb/2021.5.0/env/..:/opt/intel/oneapi/dal/2021.5.1:/opt/intel/oneapi/compiler/2022.0.1/linux/IntelDPCPP")
    setenv("CMPLR_ROOT","/opt/intel/oneapi/compiler/2022.0.1") setenv("CONDA_DEFAULT_ENV","intelpython-python3.9") setenv("CONDA_EXE","/opt/intel/oneapi/intelpython/latest/bin/conda") setenv("CONDA_PREFIX","/opt/intel/oneapi/intelpython/latest") setenv("CONDA_PROMPT_MODIFIER","(intelpython-python3.9) ") setenv("CONDA_PYTHON_EXE","/opt/intel/oneapi/intelpython/latest/bin/python") setenv("CONDA_SHLVL","1") setenv("CPATH","/opt/intel/oneapi/vpl/2022.0.0/include:/opt/intel/oneapi/tbb/2021.5.0/env/../include:/opt/intel/oneapi/mpi/2021.5.0//include:/opt/intel/oneapi/mkl/2022.0.1/include:/opt/intel/oneapi/ippcp/2021.5.0/include:/opt/intel/oneapi/ipp/2021.5.1/
    include:/opt/intel/oneapi/dpl/2021.6.0/linux/include:/opt/intel/oneapi/dpcpp-ct/2022.0.0/include:/opt/intel/oneapi/dnnl/2022.0.1/cpu_dpcpp_gpu_dpcpp/lib:/opt/intel/oneapi/dev-utilities/2021.5.1/include:/opt/intel/oneapi/dal/2021.5.1/include:/opt/intel/
    oneapi/ccl/2021.5.0/include/cpu_gpu_dpcpp") setenv("CPLUS_INCLUDE_PATH","/opt/intel/oneapi/clck/2021.5.0/include") setenv("DAALROOT","/opt/intel/oneapi/dal/2021.5.1") setenv("DALROOT","/opt/intel/oneapi/dal/2021.5.1") setenv("DAL_MAJOR_BINARY","1")
    setenv("DAL_MINOR_BINARY","1") setenv("DNNLROOT","/opt/intel/oneapi/dnnl/2022.0.1/cpu_dpcpp_gpu_dpcpp") setenv("DPCT_BUNDLE_ROOT","/opt/intel/oneapi/dpcpp-ct/2022.0.0") setenv("DPL_ROOT","/opt/intel/oneapi/dpl/2021.6.0") setenv("FI_PROVIDER_PATH","/opt/intel/oneapi/mpi/2021.5.0//libfabric/lib/prov:/usr/lib64/libfabric")
    setenv("FPGA_VARS_ARGS","") setenv("FPGA_VARS_DIR","/opt/intel/oneapi/compiler/2022.0.1/linux/lib/oclfpga") setenv("GDB_INFO","/opt/intel/oneapi/debugger/2021.5.0/documentation/info/") prepend_path("INFOPATH","/opt/intel/oneapi/debugger/2021.5.0/gdb/intel64/lib") setenv("INSPECTOR_2022_DIR","/opt/intel/oneapi/inspector/2022.0.0") setenv("INTELFPGAOCLSDKROOT","/opt/intel/oneapi/compiler/2022.0.1/linux/lib/oclfpga")
    setenv("INTEL_LICENSE_FILE","/opt/intel/licenses:/home/werner/intel/licenses:/opt/intel/oneapi/clck/2021.5.0/licensing:/opt/intel/licenses:/home/werner/intel/licenses:/Users/Shared/Library/Application Support/Intel/Licenses")
    setenv("INTEL_PYTHONHOME","/opt/intel/oneapi/debugger/2021.5.0/dep") setenv("IPPCP_TARGET_ARCH","intel64") setenv("IPPCRYPTOROOT","/opt/intel/oneapi/ippcp/2021.5.0") setenv("IPPROOT","/opt/intel/oneapi/ipp/2021.5.1") setenv("IPP_TARGET_ARCH","intel64") setenv("I_MPI_ROOT","/opt/intel/oneapi/mpi/2021.5.0") prepend_path("LD_LIBRARY_PATH","/opt/intel/oneapi/compiler/2022.0.1/linux/compiler/lib/intel64_lin")
    prepend_path("LD_LIBRARY_PATH","/opt/intel/oneapi/compiler/2022.0.1/linux/lib/oclfpga/host/linux64/lib")
    prepend_path("LD_LIBRARY_PATH","/opt/intel/oneapi/compiler/2022.0.1/linux/lib/x64")
    prepend_path("LD_LIBRARY_PATH","/opt/intel/oneapi/compiler/2022.0.1/linux/lib") prepend_path("LD_LIBRARY_PATH","/opt/intel/oneapi/dal/2021.5.1/lib/intel64") prepend_path("LD_LIBRARY_PATH","/opt/intel/oneapi/debugger/2021.5.0/dep/lib") prepend_path("LD_LIBRARY_PATH","/opt/intel/oneapi/debugger/2021.5.0/libipt/intel64/lib")
    prepend_path("LD_LIBRARY_PATH","/opt/intel/oneapi/debugger/2021.5.0/gdb/intel64/lib")
    prepend_path("LD_LIBRARY_PATH","/opt/intel/oneapi/dnnl/2022.0.1/cpu_dpcpp_gpu_dpcpp/lib")
    prepend_path("LD_LIBRARY_PATH","/opt/intel/oneapi/ipp/2021.5.1/lib/intel64") prepend_path("LD_LIBRARY_PATH","/opt/intel/oneapi/ippcp/2021.5.0/lib/intel64") prepend_path("LD_LIBRARY_PATH","/opt/intel/oneapi/itac/2021.5.0/slib") prepend_path("LD_LIBRARY_PATH","/opt/intel/oneapi/mkl/2022.0.1/lib/intel64") prepend_path("LD_LIBRARY_PATH","/opt/intel/oneapi/mpi/2021.5.0/lib") prepend_path("LD_LIBRARY_PATH","/opt/intel/oneapi/mpi/2021.5.0/lib/release") prepend_path("LD_LIBRARY_PATH","/opt/intel/oneapi/mpi/2021.5.0/libfabric/lib") prepend_path("LD_LIBRARY_PATH","/opt/intel/oneapi/tbb/2021.5.0/env/../lib/intel64/gcc4.8")
    prepend_path("LD_LIBRARY_PATH","/opt/intel/oneapi/vpl/2022.0.0/lib") setenv("LIBRARY_PATH","/opt/intel/oneapi/vpl/2022.0.0/lib:/opt/intel/oneapi/tbb/2021.5.0/env/../lib/intel64/gcc4.8:/opt/intel/oneapi/mpi/2021.5.0//libfabric/lib:/opt/intel/oneapi/mpi/2021.5.0//lib/release:/opt/intel/oneapi/mpi/2021.5.0//lib:/opt/intel/
    oneapi/mkl/2022.0.1/lib/intel64:/opt/intel/oneapi/ippcp/2021.5.0/lib/intel64:/opt/intel/oneapi/ipp/2021.5.1/lib/intel64:/opt/intel/oneapi/dnnl/2022.0.1/cpu_dpcpp_gpu_dpcpp/lib:/opt/intel/oneapi/dal/2021.5.1/lib/intel64:/opt/intel/oneapi/compiler/2022.0.1/
    linux/compiler/lib/intel64_lin:/opt/intel/oneapi/compiler/2022.0.1/linux/lib:/opt/intel/oneapi/clck/2021.5.0/lib/intel64:/opt/intel/oneapi/ccl/2021.5.0/lib/cpu_gpu_dpcpp")
    prepend_path("MANPATH","/opt/intel/oneapi/clck/2021.5.0/man") prepend_path("MANPATH","/opt/intel/oneapi/compiler/2022.0.1/documentation/en/man/common")
    prepend_path("MANPATH","/opt/intel/oneapi/debugger/2021.5.0/documentation/man") prepend_path("MANPATH","/opt/intel/oneapi/itac/2021.5.0/man") prepend_path("MANPATH","/opt/intel/oneapi/mpi/2021.5.0/man") setenv("MKLROOT","/opt/intel/oneapi/mkl/2022.0.1") setenv("NLSPATH","/opt/intel/oneapi/mkl/2022.0.1/lib/intel64/locale/%l_%t/%N:/opt/intel/oneapi/compiler/2022.0.1/linux/compiler/lib/intel64_lin/locale/%l_%t/%N")
    setenv("OCL_ICD_FILENAMES","libintelocl_emu.so:libalteracl.so:/opt/intel/oneapi/compiler/2022.0.1/linux/lib/x64/libintelocl.so")
    setenv("ONEAPI_ROOT","/opt/intel/oneapi") prepend_path("PATH","/opt/intel/oneapi/advisor/2022.0.0/bin64") prepend_path("PATH","/opt/intel/oneapi/clck/2021.5.0/bin/intel64") prepend_path("PATH","/opt/intel/oneapi/compiler/2022.0.1/linux/bin") prepend_path("PATH","/opt/intel/oneapi/compiler/2022.0.1/linux/bin/intel64") prepend_path("PATH","/opt/intel/oneapi/compiler/2022.0.1/linux/lib/oclfpga/bin")
    prepend_path("PATH","/opt/intel/oneapi/debugger/2021.5.0/gdb/intel64/bin") prepend_path("PATH","/opt/intel/oneapi/dev-utilities/2021.5.1/bin") prepend_path("PATH","/opt/intel/oneapi/dpcpp-ct/2022.0.0/bin") prepend_path("PATH","/opt/intel/oneapi/inspector/2022.0.0/bin64") prepend_path("PATH","/opt/intel/oneapi/intelpython/latest/condabin") prepend_path("PATH","/opt/intel/oneapi/intelpython/latest/bin") prepend_path("PATH","/opt/intel/oneapi/itac/2021.5.0/bin") prepend_path("PATH","/opt/intel/oneapi/mkl/2022.0.1/bin/intel64") prepend_path("PATH","/opt/intel/oneapi/mpi/2021.5.0/bin") prepend_path("PATH","/opt/intel/oneapi/mpi/2021.5.0/libfabric/bin") prepend_path("PATH","/opt/intel/oneapi/vpl/2022.0.0/bin") prepend_path("PATH","/opt/intel/oneapi/vtune/2022.0.0/bin64") setenv("PKG_CONFIG_PATH","/opt/intel/oneapi/vtune/2022.0.0/include/pkgconfig/lib64:/opt/intel/oneapi/vpl/2022.0.0/lib/pkgconfig:/opt/intel/oneapi/tbb/2021.5.0/env/../lib/pkgconfig:/opt/intel/oneapi/mpi/2021.5.0/lib/pkgconfig:/opt/intel/oneapi/mkl/2022.0.
    1/lib/pkgconfig:/opt/intel/oneapi/ippcp/2021.5.0/lib/pkgconfig:/opt/intel/oneapi/inspector/2022.0.0/include/pkgconfig/lib64:/opt/intel/oneapi/dpl/2021.6.0/lib/pkgconfig:/opt/intel/oneapi/dnnl/2022.0.1/cpu_dpcpp_gpu_dpcpp/../lib/pkgconfig:/opt/intel/
    oneapi/dal/2021.5.1/lib/pkgconfig:/opt/intel/oneapi/compiler/2022.0.1/lib/pkgconfig:/opt/intel/oneapi/ccl/2021.5.0/lib/pkgconfig:/opt/intel/oneapi/advisor/2022.0.0/include/pkgconfig/lib64:")
    setenv("PYTHONPATH","/opt/intel/oneapi/advisor/2022.0.0/pythonapi") setenv("SETVARS_COMPLETED","1") setenv("TBBROOT","/opt/intel/oneapi/tbb/2021.5.0/env/..") setenv("VTUNE_PROFILER_2022_DIR","/opt/intel/oneapi/vtune/2022.0.0") setenv("VT_ADD_LIBS","-ldwarf -lelf -lvtunwind -lm -lpthread") setenv("VT_LIB_DIR","/opt/intel/oneapi/itac/2021.5.0/lib") setenv("VT_MPI","impi4")
    setenv("VT_ROOT","/opt/intel/oneapi/itac/2021.5.0") setenv("VT_SLIB_DIR","/opt/intel/oneapi/itac/2021.5.0/slib") setenv("_CE_CONDA","")
    setenv("_CE_M","")
    set_shell_function("__add_sys_prefix_to_path"," \
    if [ -n \"${_CE_CONDA}\" ] && [ -n \"${WINDIR+x}\" ]; then\
    SYSP=$(\\dirname \"${CONDA_EXE}\");\
    else\
    SYSP=$(\\dirname \"${CONDA_EXE}\");\
    SYSP=$(\\dirname \"${SYSP}\");\
    fi;\
    if [ -n \"${WINDIR+x}\" ]; then\
    PATH=\"${SYSP}/bin:${PATH}\";\
    PATH=\"${SYSP}/Scripts:${PATH}\";\
    PATH=\"${SYSP}/Library/bin:${PATH}\";\
    PATH=\"${SYSP}/Library/usr/bin:${PATH}\";\
    PATH=\"${SYSP}/Library/mingw-w64/bin:${PATH}\";\
    PATH=\"${SYSP}:${PATH}\";\
    else\
    PATH=\"${SYSP}/bin:${PATH}\";\
    fi;\
    \\export PATH\
    ","")
    set_shell_function("__conda_activate"," \
    if [ -n \"${CONDA_PS1_BACKUP:+x}\" ]; then\
    PS1=\"$CONDA_PS1_BACKUP\";\
    \\unset CONDA_PS1_BACKUP;\
    fi;\
    \\local ask_conda;\
    ask_conda=\"$(PS1=\"${PS1:-}\" __conda_exe shell.posix \"$@\")\" || \\return;\
    \\eval \"$ask_conda\";\
    __conda_hashr\
    ","")
    set_shell_function("__conda_exe"," \
    ( __add_sys_prefix_to_path;\
    \"$CONDA_EXE\" $_CE_M $_CE_CONDA \"$@\" )\
    ","")
    set_shell_function("__conda_hashr"," \
    if [ -n \"${ZSH_VERSION:+x}\" ]; then\
    \\rehash;\
    else\
    if [ -n \"${POSH_VERSION:+x}\" ]; then\
    :;\
    else\
    \\hash -r;\
    fi;\
    fi\
    ","")
    set_shell_function("__conda_reactivate"," \
    \\local ask_conda;\
    ask_conda=\"$(PS1=\"${PS1:-}\" __conda_exe shell.posix reactivate)\" || \\return;\
    \\eval \"$ask_conda\";\
    __conda_hashr\
    ","")
    set_shell_function("_setvars_get_proc_name"," \
    if [ -n \"${ZSH_VERSION:-}\" ]; then\
    script=\"$(ps -p \"$$\" -o comm=)\";\
    else\
    script=\"$1\";\
    while [ -L \"$script\" ]; do\
    script=\"$(readlink \"$script\")\";\
    done;\
    fi;\
    basename -- \"$script\"\
    ","")
    set_shell_function("_vars_get_proc_name"," \
    if [ -n \"${ZSH_VERSION:-}\" ]; then\
    script=\"$(ps -p \"$$\" -o comm=)\";\
    else\
    script=\"$1\";\
    while [ -L \"$script\" ]; do\
    script=\"$(readlink \"$script\")\";\
    done;\
    fi;\
    basename -- \"$script\"\
    ","")
    set_shell_function("conda"," \
    \\local cmd=\"${1-__missing__}\";\
    case \"$cmd\" in \
    activate | deactivate)\
    __conda_activate \"$@\"\
    ;;\
    install | update | upgrade | remove | uninstall)\
    __conda_exe \"$@\" || \\return;\
    __conda_reactivate\
    ;;\
    *)\
    __conda_exe \"$@\"\
    ;;\
    esac\
    ","")
    set_shell_function("dnnl_check_local_env"," \
    __dnnl_this_dir_name=$(basename -- \"${__dnnl_this_dir_path}\");\
    echo \"$(dnnl_match_configuration \"$__dnnl_this_dir_name\")\"\
    ","")
    set_shell_function("dnnl_env_vars_main"," \
    __dnnl_configuration=;\
    for param in \"$@\";\
    do\
    __tmp_dnnl_configuration=\"${param##--dnnl-configuration=}\";\
    [ \"${param}\" = \"--dnnl-configuration=${__tmp_dnnl_configuration}\" ] && __dnnl_configuration=${__tmp_dnnl_configuration};\
    done;\
    if [ -n \"$__dnnl_configuration\" ]; then\
    if [ -z \"$(dnnl_match_configuration \"$__dnnl_configuration\")\" ]; then\
    echo \"@@@ --dnnl-configuration=$__dnnl_configuration is not valid\";\
    echo \"@@@ use the default one: $__dnnl_def_configuration\";\
    __dnnl_configuration=$__dnnl_def_configuration;\
    fi;\
    else\
    __dnnl_configuration=$__dnnl_def_configuration;\
    fi;\
    dnnl_base_dir=$(get_script_path \"$__dnnl_this_dir_path\");\
    dnnl_set_env_vars \"$dnnl_base_dir/$__dnnl_configuration\"\
    ","")
    set_shell_function("dnnl_match_configuration"," \
    echo \"$__dnnl_known_configurations\" | tr ' ' '\\n' | while read -r item; do\
    [ \"$1\" = \"$item\" ] && echo \"$item\" && return;\
    done;\
    echo \"\"\
    ","")
    set_shell_function("dnnl_set_env_vars"," \
    export DNNLROOT=\"$1\";\
    if [ -n \"${LD_LIBRARY_PATH:-}\" ]; then\
    export LD_LIBRARY_PATH=$DNNLROOT/lib:$LD_LIBRARY_PATH;\
    else\
    export LD_LIBRARY_PATH=$DNNLROOT/lib;\
    fi;\
    if [ -n \"${LIBRARY_PATH:-}\" ]; then\
    export LIBRARY_PATH=$DNNLROOT/lib:$LIBRARY_PATH;\
    else\
    export LIBRARY_PATH=$DNNLROOT/lib;\
    fi;\
    if [ -n \"${CPATH:-}\" ]; then\
    export CPATH=$DNNLROOT/lib:$CPATH;\
    else\
    export CPATH=$DNNLROOT/lib;\
    fi;\
    if [ -n \"${PKG_CONFIG_PATH:-}\" ]; then\
    export PKG_CONFIG_PATH=$DNNLROOT/../lib/pkgconfig:$PKG_CONFIG_PATH;\
    else\
    export PKG_CONFIG_PATH=$DNNLROOT/../lib/pkgconfig;\
    fi\
    ","")
    set_shell_function("get_product_dir"," \
    script=\"$1\";\
    while [ -L \"$script\" ]; do\
    script_dir=\"$( dirname \"$script\" )\";\
    script_dir=\"$( cd \"$script_dir\" && pwd -P )\";\
    script=\"$(readlink \"$script\" )\";\
    if [ ${script} != '/*' ]; then\
    script=\"$script_dir/$script\";\
    fi;\
    done;\
    script_dir=\"$( dirname \"$script\" )\";\
    script_dir=\"$( cd \"$script_dir\" && pwd -P )\";\
    script_dir=\"$( dirname \"$script_dir\" )\";\
    echo \"$script_dir\"\
    ","")
    set_shell_function("get_script_path"," \
    ( script=\"$1\";\
    while [ -L \"$script\" ]; do\
    script_dir=$(command dirname -- \"$script\");\
    script_dir=$(cd \"$script_dir\" && command pwd -P);\
    script=\"$(readlink \"$script\")\";\
    case $script in \
    /*)\
    \
    ;;\
    *)\
    script=\"$script_dir/$script\"\
    ;;\
    esac;\
    done;\
    script_dir=$(command dirname -- \"$script\");\
    script_dir=$(cd \"$script_dir\" && command pwd -P);\
    printf \"%s\" \"$script_dir\" )\
    ","")
    set_shell_function("icdadd"," \
    if [ -z \"${OCL_ICD_FILENAMES+x}\" ]; then\
    export OCL_ICD_FILENAMES=\"$1\";\
    else\
    case \":$OCL_ICD_FILENAMES:\" in \
    *\":$1:\"*)\
    \
    ;;\
    *)\
    export OCL_ICD_FILENAMES=\"$1:$OCL_ICD_FILENAMES\"\
    ;;\
    esac;\
    fi\
    ","")
    set_shell_function("mkl_help"," \
    __mkl_help=1;\
    echo \"\";\
    echo \"oneAPI MKL vars.sh syntax:\";\
    echo \" source $__mkl_tmp_SCRIPT_NAME [<arch>] [<MKL_interface>] [mod]\";\
    echo \"\";\
    echo \" <arch> (optional) - oneAPI MKL architecture: \";\
    echo \" ia32 : Setup for IA-32 architecture\";\
    echo \" intel64 : Setup for Intel(R) 64 architecture (default)\";\
    echo \"\";\
    echo \" <MKL_interface> (optional) - oneAPI MKL programming interface for intel64\";\
    echo \" Not applicable without \\\"mod\\\"\";\
    echo \" lp64 : 4 bytes integer (default)\";\
    echo \" ilp64 : 8 bytes integer\";\
    echo \"\";\
    echo \" mod (optional) - set path to oneAPI MKL F95 modules\";\
    echo \"\";\
    echo \"If the arguments to the sourced script are ignored (consult docs for\";\
    echo \"your shell) the alternative way to specify target is environment\";\
    echo \"variables COMPILERVARS_ARCHITECTURE or MKLVARS_ARCHITECTURE to pass\";\
    echo \"<arch> to the script, MKLVARS_INTERFACE to pass <MKL_interface> and\";\
    echo \"MKLVARS_MOD to pass \\\"mod\\\"\";\
    echo \"\"\
    ","")
    set_shell_function("prep_for_eval"," \
    echo \"$1\" | awk 'NF' | sed -e \"s/^/'/g\" -e \"s/$/' \\\\\\/g\" -e '$s/\\\\$//'\
    ","")
    set_shell_function("prep_for_exit"," \
    script_return_code=$1;\
    unset -v SETVARS_CALL || true;\
    unset -v SETVARS_ARGS || true;\
    unset -v SETVARS_VARS_PATH || true;\
    if [ \"$script_return_code\" = \"\" ]; then\
    script_return_code=255;\
    fi;\
    if [ \"$script_return_code\" -eq 0 ]; then\
    SETVARS_COMPLETED=1;\
    export SETVARS_COMPLETED;\
    fi;\
    return $script_return_code\
    ","")
    set_shell_function("prepend_manpath"," \
    ( path_to_add=\"$1\";\
    path_is_now=\"$2\";\
    if [ \"\" = \"${path_is_now}\" ]; then\
    printf \"%s\" \"${path_to_add}:\";\
    else\
    printf \"%s\" \"${path_to_add}:${path_is_now}\";\
    fi )\
    ","")
    set_shell_function("prepend_path"," \
    ( path_to_add=\"$1\";\
    path_is_now=\"$2\";\
    if [ \"\" = \"${path_is_now}\" ]; then\
    printf \"%s\" \"${path_to_add}\";\
    else\
    printf \"%s\" \"${path_to_add}:${path_is_now}\";\
    fi )\
    ","")
    set_shell_function("print_help"," \
    echo \"\";\
    echo \"Usage: vars.sh [-i_mpi_ofi_internal[=0|1]] [-i_mpi_library_kind[=debug|debug_mt|release|release_mt]]\";\
    echo \"\";\
    echo \"-i_mpi_ofi_internal specifies whether to use libfabric from the Intel(R) MPI Library.\";\
    echo \"\";\
    echo \"If the arguments to the sourced script are ignored (consult docs\";\
    echo \"for your shell) the alternative way to specify target is environment\";\
    echo \"variable I_MPI_LIBRARY_KIND to pass\";\
    echo \"-i_mpi_library_kind to the script.\";\
    echo \"Use variable I_MPI_OFI_LIBRARY_INTERNAL to pass -i_mpi_ofi_internal setting.\";\
    echo \"\"\
    ","")
    set_shell_function("save_args"," \
    for arg in \"$@\";\
    do\
    printf \"%s\\n\" \"$arg\" | sed -e \"s/'/'\\\\\\\\''/g\" -e \"1s/^/'/\" -e \"\\$s/\\$/' \\\\\\\\/\";\
    done;\
    echo \" \"\
    ","")
    set_shell_function("show_help"," \
    printf 'ERROR: This script must be sourced\\n';\
    printf 'Usage:\\n';\
    printf '\\tsource %q\\n' \"$1\";\
    printf '\\tor\\n';\
    printf '\\t. %q\\n' \"$1\";\
    exit 2\
    ","")
    set_shell_function("usage"," \
    printf \"%s\\n\" \"ERROR: This script must be sourced.\";\
    printf \"%s\\n\" \"Usage: source $1\";\
    exit 255\
    ","")
    =============

    But I want to eliminate variable values ​​or functions that contain "python" or "conda" keywords from the above Lua modulefile. I mean, if the "python" or "conda" keywords is included in the variable's name, then remove the whole variable; if the
    they only appear in value part of a variable, then remove the correponding entry from the variable's value list, say, following ones should be removed totally:

    setenv("CONDA_SHLVL","1") setenv("CONDA_EXE","/opt/intel/oneapi/intelpython/latest/bin/conda")

    And the following ones should one remove the correponding entry from the variable's value list:

    prepend_path("PATH","/opt/intel/oneapi/intelpython/latest/bin:/opt/intel/oneapi/someother/latest/bin")

    i.e., changed to the following one:

    prepend_path("PATH","/opt/intel/oneapi/someother/latest/bin")

    OTOH, for all the functions, if "python" or "conda" keywords appear in the function body/name, then remove them totally.

    Is there any trick to do this job?

    [1] https://lmod.readthedocs.io/en/latest/

    Regards,
    HZ

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)