modules:
  prefix_inspections:
    ./lib:
      - LD_LIBRARY_PATH
    ./lib64:
      - LD_LIBRARY_PATH
  default:
    enable: [lmod]
    lmod:
      hash_length: 0

      core_compilers:
        - gcc@11.2.1

      hierarchy:
        - mpi

      all:
        environment:
          set:
            "{name}_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
        autoload: run

      hide_implicits: true

      exclude:
        - 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:
#        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

      metis:
        suffixes:
          ~real64: sp

      molpro:
        template: modules/group_restricted.lua

      plumed:
        environment:
          set:
            PLUMED_KERNEL: "{prefix}/lib/libplumedKernel.so"
          unset:
          - PLUMED_ROOT

      quantum-espresso:
        suffixes:
          hdf5=parallel: hdf5

      scons:
        suffixes:
          '^python@:2.99': py2
          '^python@3:': py3

      ucx:
        environment:
          unset:
            - UCX_ROOT

      comsol:
        environment:
          prepend_path:
            MATLABPATH: "{prefix}/mli"

      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:
        environment:
          prepend_path:
            PATH: "/ssoft/spack/scripts/all/spark"

      abaqus:
        template: modules/group_restricted.lua

      adf:
        template: modules/group_restricted.lua

      ams:
        template: modules/group_restricted.lua

      crystal17:
        template: modules/group_restricted.lua

      vasp:
        template: modules/group_restricted.lua