diff --git a/env/merlin/HyQuas/packages/hyquas/__pycache__/package.cpython-36.pyc b/env/merlin/HyQuas/packages/hyquas/__pycache__/package.cpython-36.pyc new file mode 100644 index 0000000..04a4238 Binary files /dev/null and b/env/merlin/HyQuas/packages/hyquas/__pycache__/package.cpython-36.pyc differ diff --git a/env/merlin/HyQuas/packages/hyquas/package.py b/env/merlin/HyQuas/packages/hyquas/package.py new file mode 100644 index 0000000..fa208d7 --- /dev/null +++ b/env/merlin/HyQuas/packages/hyquas/package.py @@ -0,0 +1,63 @@ +# Copyright 2013-2022 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +# ---------------------------------------------------------------------------- +# If you submit this package back to Spack as a pull request, +# please first remove this boilerplate and all FIXME comments. +# +# This is a template package file for Spack. We've put "FIXME" +# next to all the things you'll want to change. Once you've handled +# them, you can save this file and test your package like this: +# +# spack install hyquas +# +# You can edit this file again by typing: +# +# spack edit hyquas +# +# See the Spack documentation for more information on packaging. +# ---------------------------------------------------------------------------- + +from spack.package import * + +class Hyquas(CMakePackage, CudaPackage): + """HyQuas is a Hybrid partitioner based Quantum circuit Simulation system on GPU, which supports both single-GPU, + single-node-multi-GPU, and multi-node-multi-GPU quantum circuit simulation.""" + + homepage = "https://github.com/thu-pacman/HyQuas#readme" + git = "https://github.com/thu-pacman/HyQuas.git" + + maintainers = ["germanne"] + + version('main', submodules=True) + + depends_on("cmake", type=('build')) + depends_on("mpi", type=('build','link', 'run')) + + for value in CudaPackage.cuda_arch_values: + depends_on("nccl@2.9.6-1+cuda cuda_arch={0}".format(value), type=('link', 'run'), when='cuda_arch={0}'.format(value)) + + variant("cuda", default=True, description="Build with CUDA") + + conflicts("~cuda", msg="HyQuas requires CUDA") + + build_directory = 'build' + + def setup_build_environment(self, env): + cuda_arch = self.spec.variants['cuda_arch'].value[0] + env.set('CUDA_NVCC_FLAGS', '-Xcompiler -fopenmp -std=c++14 -O2 -g -arch=compute_' + cuda_arch + '-code=sm_' + cuda_arch + '--ptxas-options=-v -lineinfo -keep') + env.set('GENCODE_FLAGS', '-gencode arch=compute_' + cuda_arch +',code=sm_' + cuda_arch) + # env.set("CUDA_HOME", self.spec['cuda'].prefix) + env.set("NCCL_ROOT", self.spec['nccl'].prefix) + + @run_before('cmake') + def build_cutt(self): + with working_dir('./third-party/cutt'): + make() + + def install(self, spec, prefix): + mkdir(prefix.bin) + with working_dir(self.build_directory): + install('main', prefix.bin) diff --git a/env/merlin/HyQuas/repo.yaml b/env/merlin/HyQuas/repo.yaml new file mode 100644 index 0000000..8108ffb --- /dev/null +++ b/env/merlin/HyQuas/repo.yaml @@ -0,0 +1,2 @@ +repo: + namespace: HiQsimulator \ No newline at end of file diff --git a/env/merlin/HyQuas/spack.yaml b/env/merlin/HyQuas/spack.yaml new file mode 100644 index 0000000..bed99a2 --- /dev/null +++ b/env/merlin/HyQuas/spack.yaml @@ -0,0 +1,21 @@ +spack: + concretizer: + unify: true + definitions: + - mpi_nvhpc: + - ^openmpi@4.1.4%nvhpc+cuda fabrics=ucx,knem,ofi,cma,hcoll schedulers=slurm +pmi + ^ucx%gcc@1.13.0 ^cuda@11.5.1 ^slurm@21-08-8-2 ^hwloc@2.7.1 ^knem@1.1.4 ^pmix@4.1.2 + include: + - sysconfigs/config.yaml + - sysconfigs/compilers.yaml + - sysconfigs/packages.yaml + repos: + - . + specs: + - hyquas@main%nvhpc+cuda cuda_arch=70 ^nccl%gcc ^openmpi@4.1.4%nvhpc+cuda fabrics=ucx,knem,ofi,cma,hcoll + schedulers=slurm +pmi ^ucx@1.13.0%gcc ^cuda@11.5.1 ^slurm@21-08-8-2 ^hwloc@2.7.1 + ^knem@1.1.4 ^pmix@4.1.2 + develop: + hyquas: + path: /data/user/germann_e/HyQuas + spec: hyquas@main%nvhpc+cuda cuda_arch=70 diff --git a/env/merlin/HyQuas/sysconfigs/compilers.yaml b/env/merlin/HyQuas/sysconfigs/compilers.yaml new file mode 100644 index 0000000..f0662b8 --- /dev/null +++ b/env/merlin/HyQuas/sysconfigs/compilers.yaml @@ -0,0 +1,93 @@ +--- +compilers: + - compiler: + environment: {} + extra_rpaths: [] + flags: {} + modules: [] + operating_system: rhel7 + paths: + cc: /opt/psi/Programming/intel/22.2/compiler/2022.1.0/linux/bin/icx + cxx: /opt/psi/Programming/intel/22.2/compiler/2022.1.0/linux/bin/dpcpp + f77: /opt/psi/Programming/intel/22.2/compiler/2022.1.0/linux/bin/ifx + fc: /opt/psi/Programming/intel/22.2/compiler/2022.1.0/linux/bin/ifx + spec: dpcpp@2022.1.0 + target: x86_64 + - compiler: + environment: {} + extra_rpaths: [] + flags: {} + modules: [] + operating_system: rhel7 + paths: + cc: /opt/psi/Programming/intel/22.2/compiler/2022.1.0/linux/bin/intel64/icc + cxx: /opt/psi/Programming/intel/22.2/compiler/2022.1.0/linux/bin/intel64/icpc + f77: /opt/psi/Programming/intel/22.2/compiler/2022.1.0/linux/bin/intel64/ifort + fc: /opt/psi/Programming/intel/22.2/compiler/2022.1.0/linux/bin/intel64/ifort + spec: intel@2021.6.0 + target: x86_64 + - compiler: + environment: {} + extra_rpaths: [] + flags: {} + modules: [] + operating_system: rhel7 + paths: + cc: /opt/psi/Programming/intel/22.2/compiler/2022.1.0/linux/bin/icx + cxx: /opt/psi/Programming/intel/22.2/compiler/2022.1.0/linux/bin/icpx + f77: /opt/psi/Programming/intel/22.2/compiler/2022.1.0/linux/bin/ifx + fc: /opt/psi/Programming/intel/22.2/compiler/2022.1.0/linux/bin/ifx + spec: oneapi@2022.1.0 + target: x86_64 + - compiler: + environment: {} + extra_rpaths: [] + flags: {} + modules: [] + operating_system: rhel7 + paths: + cc: /opt/psi/Programming/gcc/8.3.0/bin/gcc + cxx: /opt/psi/Programming/gcc/8.3.0/bin/g++ + f77: /opt/psi/Programming/gcc/8.3.0/bin/gfortran + fc: /opt/psi/Programming/gcc/8.3.0/bin/gfortran + spec: gcc@8.3.0 + target: x86_64 + - compiler: + environment: {} + extra_rpaths: [] + flags: {} + modules: [] + operating_system: rhel7 + paths: + cc: /opt/psi/Programming/gcc/12.1.0/bin/gcc + cxx: /opt/psi/Programming/gcc/12.1.0/bin/g++ + f77: /opt/psi/Programming/gcc/12.1.0/bin/gfortran + fc: /opt/psi/Programming/gcc/12.1.0/bin/gfortran + spec: gcc@12.1.0 + target: x86_64 + - compiler: + environment: {} + extra_rpaths: [] + flags: {} + modules: [] + operating_system: rhel7 + paths: + cc: /opt/psi/Programming/clang/12.0.0_rhel7/bin/clang + cxx: /opt/psi/Programming/clang/12.0.0_rhel7/bin/clang++ + f77: null + fc: null + spec: clang@12.0.0 + target: x86_64 + - compiler: + environment: {} + extra_rpaths: [] + flags: {} + modules: [] + operating_system: rhel7 + paths: + cc: /opt/psi/Programming/pgi/21.5/Linux_x86_64/21.5/compilers/bin/nvc + cxx: /opt/psi/Programming/pgi/21.5/Linux_x86_64/21.5/compilers/bin/nvc++ + f77: /opt/psi/Programming/pgi/21.5/Linux_x86_64/21.5/compilers/bin/nvfortran + fc: /opt/psi/Programming/pgi/21.5/Linux_x86_64/21.5/compilers/bin/nvfortran + spec: nvhpc@21.5 + target: x86_64 \ No newline at end of file diff --git a/env/merlin/HyQuas/sysconfigs/config.yaml b/env/merlin/HyQuas/sysconfigs/config.yaml new file mode 100644 index 0000000..15a402d --- /dev/null +++ b/env/merlin/HyQuas/sysconfigs/config.yaml @@ -0,0 +1,6 @@ +config: + build_stage: + - /data/user/$USER/spack/spack-stages + install_tree: + root: /data/user/$USER/spack/spack-install + source_cache: /data/user/$USER/spack/spack-source_cache \ No newline at end of file diff --git a/env/merlin/HyQuas/sysconfigs/packages.yaml b/env/merlin/HyQuas/sysconfigs/packages.yaml new file mode 100644 index 0000000..dc1f53e --- /dev/null +++ b/env/merlin/HyQuas/sysconfigs/packages.yaml @@ -0,0 +1,292 @@ +--- +packages: + all: + compiler: + - gcc@12.1.0 + target: + - haswell + providers: + pkgconfig: [pkg-config] + permissions: + read: user + write: user + binutils: + buildable: false + externals: + - prefix: /usr + spec: binutils@2.38 + bzip2: + buildable: false + externals: + - prefix: /usr + spec: bzip2@1.0.6 + cmake: + buildable: false + externals: + - prefix: /opt/psi/Programming/cmake/3.23.2 + spec: cmake@3.23.2 + cpio: + buildable: false + externals: + - prefix: /usr + spec: cpio@2.11 + curl: + buildable: false + externals: + - prefix: /usr + spec: curl@7.29.0 + cvs: + buildable: false + externals: + - prefix: /usr + spec: cvs@1.11.23 + diffutils: + buildable: false + externals: + - prefix: /usr + spec: diffutils@3.3 + doxygen: + buildable: false + externals: + - prefix: /usr + spec: doxygen@1.8.5 + expat: + buildable: false + externals: + - prefix: /usr + spec: expat@1.6.0 + file: + externals: + - prefix: /usr + spec: file@5.11 + findutils: + buildable: false + externals: + - prefix: /usr + spec: findutils@4.5.11 + flex: + buildable: false + externals: + - prefix: /usr + spec: flex@2.5.37+lex + # E.G: only available from already downloaded source, so I put it here + gams: + externals: + - prefix: /opt/psi/Tools/GAMS/31.1.1/gams31.1_linux_x64_64_sfx + spec: gams@31.1.1 + gawk: + buildable: false + externals: + - prefix: /usr + spec: gawk@4.0.2 + ghostscript: + buildable: false + externals: + - prefix: /usr + spec: ghostscript@9.25 + git: + buildable: false + externals: + - prefix: /usr + spec: git@1.8.3.1~tcltk + glew: + buildable: false + externals: + - prefix: /usr + spec: glew@1.10.0 + gmake: + buildable: false + externals: + - prefix: /usr + spec: gmake@3.82 + groff: + buildable: false + externals: + - prefix: /usr + spec: groff@1.22.2 + hcoll: + buildable: false + externals: + - prefix: /opt/mellanox/hcoll + spec: hcoll@3.9.1927 + fftw: + buildable: false + externals: + - prefix: /usr + spec: fftw@3.3.3 + intel-oneapi-mkl: + buildable: false + externals: + - prefix: /opt/psi/Programming/intel/22.2 + spec: intel-oneapi-mkl@2022.1.0 + intel-oneapi-mpi: + buildable: false + externals: + - prefix: /opt/psi/Programming/intel/22.2 + spec: intel-oneapi-mpi@2021.6.0 + libcroco: + buildable: false + externals: + - prefix: /usr + spec: libcroco@0.6.13 + libevent: + buildable: false + externals: + - prefix: /usr + spec: libevent@2.0 + libfabric: + buildable: false + externals: + - prefix: /usr + spec: libfabric@1.10.2 + libfuse: + buildable: false + externals: + - prefix: /usr + spec: libfuse@3.6.1 + libice: + buildable: false + externals: + - prefix: /usr + spec: libice@6.3.0 + libjpeg-turbo: + buildable: false + externals: + - prefix: /usr + spec: libjpeg-turbo@62.1.0 + libpthread: + buildable: false + externals: + - prefix: /usr + spec: libpthread@2.17 + libpthread-stubs: + buildable: false + externals: + - prefix: /usr + spec: libpthread-stubs@0.4 + libreadline: + buildable: false + externals: + - prefix: /usr + spec: libreadline@6.2 + libtiff: + buildable: false + externals: + - prefix: /usr + spec: libtiff@5.2.0 + libx11: + buildable: false + externals: + - prefix: /usr + spec: libx11@6.3.0 + libxext: + buildable: false + externals: + - prefix: /usr + spec: libxext@6.4.0 + libxft: + buildable: false + externals: + - prefix: /usr + spec: libxft@2.3.2 + libxpm: + buildable: false + externals: + - prefix: /usr + spec: libxpm@4.11.0 + libxt: + buildable: false + externals: + - prefix: /usr + spec: libxt@6.0.0 + m4: + buildable: false + externals: + - prefix: /usr + spec: m4@1.4.16 + # E.G: only available from already downloaded source, so I put it here + mxm: + buildable: false + externals: + - prefix: /opt/psi/System/mxm/3.6.3104 + spec: mxm@3.6.3104 + ncurses: + buildable: false + externals: + - prefix: /usr + spec: ncurses@5.9.20130511 + nlohmann-json: + buildable: false + externals: + - prefix: /usr + spec: nlohmann-json@3.10.5 + numactl: + buildable: false + externals: + - prefix: /usr + spec: numactl@2.0.14 + openssh: + buildable: false + externals: + - prefix: /usr + spec: openssh@7.4p1 + openssl: + buildable: false + externals: + - prefix: /usr + spec: openssl@1.0.2k-fips + pcre: + buildable: false + externals: + - prefix: /usr + spec: pcre@8.32 + pkg-config: + buildable: false + externals: + - prefix: /usr + spec: pkg-config@0.27.1 + rsync: + buildable: false + externals: + - prefix: /usr + spec: rsync@3.1.2 + ruby: + buildable: false + externals: + - prefix: /usr + spec: ruby@2.0.0p648 + sed: + buildable: false + externals: + - prefix: /usr + spec: sed@4.2.2 + sqlite: + buildable: false + externals: + - prefix: /usr + spec: sqlite@3.7.17 + subversion: + buildable: false + externals: + - prefix: /usr + spec: subversion@1.7.14 + tar: + buildable: false + externals: + - prefix: /usr + spec: tar@1.26 + texinfo: + buildable: false + externals: + - prefix: /usr + spec: texinfo@5.1 + xerces-c: + buildable: false + externals: + - prefix: /usr + spec: xerces-c@3.1 + xz: + buildable: false + externals: + - prefix: /usr + spec: xz@5.2.2 \ No newline at end of file