diff options
Diffstat (limited to 'var/spack/repos/builtin/packages/hiop/package.py')
-rw-r--r-- | var/spack/repos/builtin/packages/hiop/package.py | 114 |
1 files changed, 67 insertions, 47 deletions
diff --git a/var/spack/repos/builtin/packages/hiop/package.py b/var/spack/repos/builtin/packages/hiop/package.py index e15aedb8e6..1b29d8b3ac 100644 --- a/var/spack/repos/builtin/packages/hiop/package.py +++ b/var/spack/repos/builtin/packages/hiop/package.py @@ -5,8 +5,6 @@ import os -import llnl.util.tty as tty - from spack.package import * @@ -25,6 +23,15 @@ class Hiop(CMakePackage, CudaPackage, ROCmPackage): # Most recent tagged snapshot is the preferred version when profiling. version( + "1.1.0", tag="v1.1.0", commit="7ccfa86a71fdb670ae690199ac676f3c1365799a", submodules=True + ) + version( + "1.0.3", tag="v1.0.3", commit="6161396d9b562c39e7e6fe686ab46a2ec7927482", submodules=True + ) + version( + "1.0.2", tag="v1.0.2", commit="2378fde5cc371047227c396ddaaf58b6453f928c", submodules=True + ) + version( "1.0.1", tag="v1.0.1", commit="c5e156c6f27d046f590dc35114980e3f9c573ca6", submodules=True ) version( @@ -49,10 +56,10 @@ class Hiop(CMakePackage, CudaPackage, ROCmPackage): version("0.5.0", tag="v0.5.0", commit="a39da8025037c7c8ae2eb31234eb80cc73bec2af") version("0.4.6", tag="v0.4.6", commit="b72d163d52c9225c3196ceb2baebdc7cf09a69de") version("0.4.5", tag="v0.4.5", commit="c353580456c4776c50811b97cf8ff802dc27b90c") - version("0.4.4", tag="v0.4.4", commit="e858eefa6b914f5c87c3717bbce811931ea69386") + version("0.4.4", tag="v0.4.4", commit="4e3faa9963e83cd7f2a388bfcc1e402dc86fc81d") version("0.4.3", tag="v0.4.3", commit="c0394af4d84ebb84b7d2b95283ad65ffd84e0d45") version("0.4.2", tag="v0.4.2", commit="3fcb788d223eec24c0241680070c4a9a5ec71ef3") - version("0.4.1", tag="v0.4.1", commit="3f269560f76d5a89bcbd1d3c4f9f0e5acaa6fd64") + version("0.4.1", tag="v0.4.1", commit="281adb5fb335642446e0804a2669b97d8ef62998") version("0.4", tag="v0.4", commit="91d21085a1149eacdb27cd738d4a74a7e412fcff") version("0.3.99.3", tag="v0.3.99.3", commit="bed1dbef260e53a9d139ccfb77d2e83a98aab216") version("0.3.99.2", tag="v0.3.99.2", commit="9eb026768bc5e0a2c1293d0487cc39913001ae19") @@ -66,10 +73,14 @@ class Hiop(CMakePackage, CudaPackage, ROCmPackage): version("master", branch="master") version("develop", branch="develop") + depends_on("c", type="build") # generated + depends_on("cxx", type="build") # generated + depends_on("fortran", type="build") # generated + variant("jsrun", default=False, description="Enable/Disable jsrun command for testing") variant("shared", default=False, description="Enable/Disable shared libraries") variant("mpi", default=True, description="Enable/Disable MPI") - variant("raja", default=False, description="Enable/Disable RAJA") + variant("raja", default=False, when="@0.3.99:", description="Enable/Disable RAJA") variant("kron", default=False, description="Enable/Disable Kron reduction") variant("sparse", default=False, description="Enable/Disable Sparse linear algebra") variant( @@ -118,7 +129,11 @@ class Hiop(CMakePackage, CudaPackage, ROCmPackage): # 1.0.2 fixes bug with cuda 12 compatibility # hiop@0.6.0 requires cusolver API in cuda@11 depends_on("cuda@11:11.9", when="@0.6.0:1.0.1+cuda") - depends_on("cuda@11:", when="@develop:+cuda") + # Version v0.7.0 of HiOp is the earliest version that uses + # cusparseSpGEMMreuse_workEstimation + # which appears for the first time in the cuSPARSE version shipped with + # CUDA 11.3.1, at least according to the CUDA online documentation. + depends_on("cuda@11.3.1:", when="@0.7:+cuda") # Before hiop@0.6.0 only cuda requirement was magma depends_on("cuda", when="@:0.5.4+cuda") @@ -128,9 +143,11 @@ class Hiop(CMakePackage, CudaPackage, ROCmPackage): # RAJA > 0.14 and Umpire > 6.0 require c++ std 14 # We are working on supporting newer Umpire/RAJA versions - depends_on("raja@0.14.0:0.14", when="@0.5.0:+raja") - depends_on("umpire@6.0.0:6", when="@0.5.0:+raja") - depends_on("camp@0.2.3:0.2", when="@0.5.0:+raja") + depends_on("raja@0.14", when="@0.5:+raja") + depends_on("raja@:0.13", when="@0.3.99:0.4+raja") + depends_on("umpire@6", when="@0.5:+raja") + depends_on("umpire@:5", when="@0.3.99:0.4+raja") + depends_on("camp@0.2.3:0.2", when="@0.3.99:+raja") # This is no longer a requirement in RAJA > 0.14 depends_on("umpire+cuda~shared", when="+raja+cuda ^raja@:0.14") @@ -141,7 +158,12 @@ class Hiop(CMakePackage, CudaPackage, ROCmPackage): msg="umpire+cuda exports device code and requires static libs", ) + # We rely on RAJA / Umpire utilities when supporting CUDA backend + conflicts("~raja", when="+cuda", msg="RAJA is required for CUDA support") + conflicts("~raja", when="+rocm", msg="RAJA is required for ROCm support") + depends_on("hip", when="+rocm") + depends_on("hiprand", when="+rocm") depends_on("hipblas", when="+rocm") depends_on("hipsparse", when="+rocm") @@ -159,7 +181,7 @@ class Hiop(CMakePackage, CudaPackage, ROCmPackage): args = [] spec = self.spec - use_gpu = "+cuda" in spec or "+rocm" in spec + use_gpu = spec.satisfies("+cuda") or spec.satisfies("+rocm") if use_gpu: args.extend( @@ -189,7 +211,7 @@ class Hiop(CMakePackage, CudaPackage, ROCmPackage): self.define_from_variant("HIOP_USE_COINHSL", "sparse"), self.define_from_variant("HIOP_TEST_WITH_BSUB", "jsrun"), self.define_from_variant("HIOP_USE_GINKGO", "ginkgo"), - self.define_from_variant("HIOP_USE_CUSOLVER_LU", "cusolver_lu"), + self.define_from_variant("HIOP_USE_RESOLVE", "cusolver_lu"), ] ) @@ -199,7 +221,7 @@ class Hiop(CMakePackage, CudaPackage, ROCmPackage): # args.append( # self.define('HIOP_CTEST_LAUNCH_COMMAND', 'srun -t 10:00')) - if "+mpi" in spec: + if spec.satisfies("+mpi"): args.extend( [ self.define("MPI_HOME", spec["mpi"].prefix), @@ -218,7 +240,7 @@ class Hiop(CMakePackage, CudaPackage, ROCmPackage): # self.define('MPI_Fortran_LINK_FLAGS', # '-L/path/to/libfabric/lib64/ -lfabric')) - if "+cuda" in spec: + if spec.satisfies("+cuda"): cuda_arch_list = spec.variants["cuda_arch"].value if cuda_arch_list[0] != "none": args.append(self.define("CMAKE_CUDA_ARCHITECTURES", cuda_arch_list)) @@ -231,7 +253,7 @@ class Hiop(CMakePackage, CudaPackage, ROCmPackage): # args.append( # self.define('HIP_CLANG_INCLUDE_PATH', # '/opt/rocm-X.Y.Z/llvm/lib/clang/14.0.0/include/')) - if "+rocm" in spec: + if spec.satisfies("+rocm"): args.append(self.define("CMAKE_CXX_COMPILER", spec["hip"].hipcc)) rocm_arch_list = spec.variants["amdgpu_target"].value @@ -239,7 +261,7 @@ class Hiop(CMakePackage, CudaPackage, ROCmPackage): args.append(self.define("GPU_TARGETS", rocm_arch_list)) args.append(self.define("AMDGPU_TARGETS", rocm_arch_list)) - if "+kron" in spec: + if spec.satisfies("+kron"): args.append(self.define("HIOP_UMFPACK_DIR", spec["suite-sparse"].prefix)) # Unconditionally disable strumpack, even when +sparse. This may be @@ -247,7 +269,7 @@ class Hiop(CMakePackage, CudaPackage, ROCmPackage): # fully supported in spack at the moment. args.append(self.define("HIOP_USE_STRUMPACK", False)) - if "+sparse" in spec: + if spec.satisfies("+sparse"): args.append(self.define("HIOP_COINHSL_DIR", spec["coinhsl"].prefix)) return args @@ -257,37 +279,35 @@ class Hiop(CMakePackage, CudaPackage, ROCmPackage): # # export SPACK_USER_CACHE_PATH=/tmp/spack # export SPACK_DISABLE_LOCAL_CONFIG=true - def test(self): - if not self.spec.satisfies("@develop") or not os.path.isdir(self.prefix.bin): - tty.info("Skipping: checks not installed in bin for v{0}".format(self.version)) - return - - tests = [ - ["NlpMdsEx1.exe", "400", "100", "0", "-selfcheck"], - ["NlpMdsEx1.exe", "400", "100", "1", "-selfcheck"], - ["NlpMdsEx1.exe", "400", "100", "0", "-empty_sp_row", "-selfcheck"], + + def run_hiop(self, raja): + if raja: + exName = "NlpMdsEx1Raja.exe" + else: + exName = "NlpMdsEx1.exe" + + exe = os.path.join(self.prefix.bin, exName) + if not os.path.exists(exe): + raise SkipTest(f"{exName} does not exist in version {self.version}") + + options = [ + ["400", "100", "0", "-selfcheck"], + ["400", "100", "1", "-selfcheck"], + ["400", "100", "0", "-empty_sp_row", "-selfcheck"], ] - if "+raja" in self.spec: - tests.extend( - [ - ["NlpMdsEx1Raja.exe", "400", "100", "0", "-selfcheck"], - ["NlpMdsEx1Raja.exe", "400", "100", "1", "-selfcheck"], - ["NlpMdsEx1Raja.exe", "400", "100", "0", "-empty_sp_row", "-selfcheck"], - ] - ) + exe = which(exe) - for i, test in enumerate(tests): - exe = os.path.join(self.prefix.bin, test[0]) - args = test[1:] - reason = 'test {0}: "{1}"'.format(i, " ".join(test)) - self.run_test( - exe, - args, - [], - 0, - installed=False, - purpose=reason, - skip_missing=True, - work_dir=self.prefix.bin, - ) + for i, args in enumerate(options): + with test_part(self, f"test_{exName}_{i+1}", purpose=" ".join(args)): + exe(*args) + + def test_NlpMdsEx1(self): + """Test NlpMdsEx1""" + self.run_hiop(False) + + def test_NlpMdsEx1Raja(self): + """Test NlpMdsEx1 with +raja""" + if "+raja" not in self.spec: + raise SkipTest("Package must be installed with +raja") + self.run_hiop(True) |