modules:
  default:
    enable: [lmod]
    lmod:
      hash_length: 0
      core_compilers:
        - gcc@11.2.1
      hierarchy:
        - mpi
      all:
        environment:
          set:
            ${PACKAGE}_ROOT: ${PREFIX}
        suffixes:
          '+mpi': mpi
          '+openmp': openmp
          'threads=openmp': openmp
          '^fftw+openmp': openmp
          'hdf5=parallel': h5
          '+cuda': cuda
          '+double-gpu': double-gpu
          '+plumed': plumed
          '+unwind': unwind
          '+debug': dbg
          '+ilp64': int64
          '+int64': int64
          'version_suffix=jl': julia

      blacklist_implicits: true

      blacklist:
        - lmod

      gcc:
        environment:
          set:
            CC: ${PREFIX}/bin/gcc
            CXX: ${PREFIX}/bin/g++
            F77: ${PREFIX}/bin/gfortran
            FC: ${PREFIX}/bin/gfortran
            F90: ${PREFIX}/bin/gfortran
      cuda@12.4.0:
        environment:
          append_path:
            JULIA_LOAD_PATH: ":/ssoft/spack/external/julia/syrah.v1/cuda"

      openmpi:
        environment:
          set:
            SLURM_MPI_TYPE: pmix
            OMPI_MCA_btl_openib_warn_default_gid_prefix: '0'
          append_path:
            JULIA_LOAD_PATH: ":/ssoft/spack/external/julia/syrah.v1/mpi"
      openblas threads=pthreads:
        environment:
          set:
            OPENBLAS_NUM_THREADS: '1'
      hdf5~mpi+cxx:
        environment:
          set:
            HDF5_CC: h5cc
            HDF5_CXX: h5c++
            HDF5_FC: h5fc
      hdf5+mpi~cxx:
        environment:
          set:
            HDF5_CC: h5pcc
            HDF5_FC: h5pfc
      intel-oneapi-mpi:
        environment:
          set:
            I_MPI_PMI_LIBRARY: /usr/lib64/libpmi2.so
            I_MPI_EXTRA_FILESYSTEM: '0'
            SLURM_MPI_TYPE: pmi2
      julia:
        autoload: direct
      metis:
        suffixes:
          ~real64: sp
      molpro:
        template: modules/group_restricted.lua
      plumed:
        environment:
          set:
            PLUMED_KERNEL: ${PREFIX}/lib/libplumedKernel.so
          unset:
          - PLUMED_ROOT
      py-horovod:
        autoload: direct
      py-keras:
        autoload: direct
      py-tensorflow:
        autoload: direct
      py-theano:
        autoload: direct
      py-torch:
        autoload: direct
      py-torchvision:
        autoload: direct
      quantum-espresso:
        suffixes:
          hdf5=parallel: hdf5
      scala:
        autoload: direct
      scons:
        suffixes:
          '^python@:2.99': py2
          '^python@3:': py3

      abaqus:
        template: modules/group_restricted.lua
      adf:
        template: modules/group_restricted.lua
      ams:
        template: modules/group_restricted.lua
      comsol:
        environment:
          prepend_path:
            MATLABPATH: ${PREFIX}/mli
      crystal17:
        template: modules/group_restricted.lua
      fdtd:
        environment:
          prepend_path:
            PATH: ${PREFIX}/mpich2/nemesis/bin
            LD_LIBRARY_PATH: ${PREFIX}/mpich2/nemesis/lib
          set:
            SLURM_MPI_TYPE: pmi2
      gaussian:
        template: modules/group_restricted.lua
      spark:
        autoload: direct
        environment:
          prepend_path:
            PATH: /ssoft/spack/scripts/all/spark
      ucx:
        environment:
          unset:
            - UCX_ROOT
      vasp:
        template: modules/group_restricted.lua
