From bb4692fdb6c2ac915098c3f51d2ba574d5641f15 Mon Sep 17 00:00:00 2001 From: Elsa Gonsiorowski Date: Thu, 3 Aug 2017 16:52:52 -0700 Subject: SCR CMake package (#3916) * SCR CMake package * Fix dtcmp variant description and set pdsh deptypes to build/run * added variants for system config file location * add variants for several scr cmake options * Added more variants for compile time options * Added libyogrt and made corrosponding changes to scr package. * Cleanup yogrt package now that Ive verified it works * Added description for libyogrt * upper case async api names * Make use of mv variants * fix pdsh package for scr * added IBM BBAPI as async option * update pdsh and scr to use static pdsh modules --- .../repos/builtin/packages/libyogrt/package.py | 38 +++++++ var/spack/repos/builtin/packages/pdsh/package.py | 12 ++ var/spack/repos/builtin/packages/scr/package.py | 125 ++++++++++++++++++--- 3 files changed, 162 insertions(+), 13 deletions(-) create mode 100644 var/spack/repos/builtin/packages/libyogrt/package.py diff --git a/var/spack/repos/builtin/packages/libyogrt/package.py b/var/spack/repos/builtin/packages/libyogrt/package.py new file mode 100644 index 0000000000..1ad98ebaa0 --- /dev/null +++ b/var/spack/repos/builtin/packages/libyogrt/package.py @@ -0,0 +1,38 @@ +############################################################################## +# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC. +# Produced at the Lawrence Livermore National Laboratory. +# +# This file is part of Spack. +# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. +# LLNL-CODE-647188 +# +# For details, see https://github.com/llnl/spack +# Please also see the LICENSE file for our notice and the LGPL. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License (as +# published by the Free Software Foundation) version 2.1, February 1999. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and +# conditions of the GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +############################################################################## +from spack import * + + +class Libyogrt(AutotoolsPackage): + """Your One Get Remaining Time Library.""" + + homepage = "https://github.com/LLNL/libyogrt" + url = "https://github.com/LLNL/libyogrt/archive/1.20-6.tar.gz" + + version('1.20-6', '478f27512842cc5f2b74a0c22b851f60') + version('1.20-5', 'd0fa6526fcd1f56ddb3d93f602ec72f7') + version('1.20-4', '092bea10de22c505ce92aa07001decbb') + version('1.20-3', 'd0507717009a5f8e2009e3b63594738f') + version('1.20-2', '780bda03268324f6b5f72631fff6e6cb') diff --git a/var/spack/repos/builtin/packages/pdsh/package.py b/var/spack/repos/builtin/packages/pdsh/package.py index 3d0d265409..06457ba38c 100644 --- a/var/spack/repos/builtin/packages/pdsh/package.py +++ b/var/spack/repos/builtin/packages/pdsh/package.py @@ -34,3 +34,15 @@ class Pdsh(AutotoolsPackage): url = "https://github.com/grondo/pdsh/archive/pdsh-2.31.tar.gz" version('2.31', 'cab34b0ca78f3cf596fd648b265223ed') + + variant('ssh', default=True, description="Build with ssh module") + + variant('static_modules', default=True, description="Build with static modules") + + def configure_args(self): + args = [] + if '+ssh' in self.spec: + args.append('--with-ssh') + if '+static_modules' in self.spec: + args.append('--enable-static-modules') + return args diff --git a/var/spack/repos/builtin/packages/scr/package.py b/var/spack/repos/builtin/packages/scr/package.py index f8fe72f110..1ab117721c 100644 --- a/var/spack/repos/builtin/packages/scr/package.py +++ b/var/spack/repos/builtin/packages/scr/package.py @@ -24,24 +24,123 @@ ############################################################################## from spack import * +import os +import shutil -class Scr(Package): + +class Scr(CMakePackage): """SCR caches checkpoint data in storage on the compute nodes of a Linux cluster to provide a fast, scalable checkpoint/restart capability for MPI codes""" - homepage = "https://computation.llnl.gov/project/scr/" + homepage = "http://computation.llnl.gov/projects/scalable-checkpoint-restart-for-mpi" + + # NOTE: scr-v1.1.8 is built with autotools and is not properly build here. + # scr-v1.1.8 will be deprecated with the upcoming release of v1.2.0 + # url = "https://github.com/LLNL/scr/releases/download/v1.1.8/scr-1.1.8.tar.gz" + # version('1.1.8', '6a0f11ad18e27fcfc00a271ff587b06e') + + version('master', git='https://github.com/llnl/scr.git', branch='master') + + depends_on('pdsh+static_modules', type=('build', 'run')) + depends_on('zlib') + depends_on('mpi') + + variant('dtcmp', default=True, + description="Build with DTCMP. " + "Necessary to enable user directory naming at runtime") + depends_on('dtcmp', when="+dtcmp") + + variant('libyogrt', default=True, + description="Build SCR with libyogrt for get_time_remaining.") + depends_on('libyogrt', when="+libyogrt") + + # MySQL not yet in spack + # variant('mysql', default=True, decription="MySQL database for logging") + # depends_on('mysql', when="+mysql") + + variant('scr_config', default='scr.conf', + description='Location for SCR to find its system config file. ' + 'May be either absolute or relative to the install prefix') + variant('copy_config', default=None, + description='Location from which to copy SCR system config file. ' + 'Must be an absolute path.') + + variant('fortran', default=True, + description="Build SCR with fortran bindings") + + variant('resource_manager', default='SLURM', + values=('SLURM', 'APRUN', 'PMIX', 'LSF', 'NONE'), + multi=False, + description="Resource manager for which to configure SCR.") + + variant('async_api', default='NONE', + values=('NONE', 'CRAY_DW', 'IBM_BBAPI', 'INTEL_CPPR'), + multi=False, + description="Asynchronous data transfer API to use with SCR.") + + variant('file_lock', default='FLOCK', + values=('FLOCK', 'FNCTL', 'NONE'), + multi=False, + description='File locking style for SCR.') + + variant('cache_base', default='/tmp', + description='Compile time default location for checkpoint cache.') + variant('cntl_base', default='/tmp', + description='Compile time default location for control directory.') + + def get_abs_path_rel_prefix(self, path): + # Return path if absolute, otherwise prepend prefix + if os.path.isabs(path): + return path + else: + return join_path(self.spec.prefix, path) + + def cmake_args(self): + spec = self.spec + args = [] + + args.append('-DENABLE_FORTRAN={0}'.format('+fortran' in spec)) + + conf_path = self.get_abs_path_rel_prefix( + self.spec.variants['scr_config'].value) + args.append('-DCMAKE_SCR_CONFIG_FILE={0}'.format(conf_path)) + + # We uppercase the values for these to avoid unnecessary user error. + args.append('-DSCR_RESOURCE_MANAGER={0}'.format( + spec.variants['resource_manager'].value.upper())) + + args.append('-DSCR_ASYNC_API={0}'.format( + spec.variants['async_api'].value.upper())) + + args.append('-DSCR_FILE_LOCK={0}'.format( + spec.variants['file_lock'].value.upper())) + + args.append('-DSCR_CACHE_BASE={0}'.format( + spec.variants['cache_base'].value)) + + args.append('-DSCR_CNTL_BASE={0}'.format( + spec.variants['cntl_base'].value)) + + args.append('-DWITH_PDSH_PREFIX={0}'.format(spec['pdsh'].prefix)) + + if "+dtcmp" in spec: + args.append('-DWITH_DTCMP_PREFIX={0}'.format(spec['dtcmp'].prefix)) + + if "+libyogrt" in spec: + args.append('-DWITH_YOGRT_PREFIX={0}'.format( + spec['libyogrt'].prefix)) - depends_on("mpi") -# depends_on("dtcmp") + # if "+mysql" in spec: + # args.append('-DWITH_MYSQL_PREFIX={0}'.format( + # spec['mysql'].prefix)) - version('1.1-7', 'a5930e9ab27d1b7049447c2fd7734ebd', - url='http://downloads.sourceforge.net/project/scalablecr/releases/scr-1.1-7.tar.gz') - version('1.1.8', '6a0f11ad18e27fcfc00a271ff587b06e', - url='https://github.com/hpc/scr/releases/download/v1.1.8/scr-1.1.8.tar.gz') + return args - def install(self, spec, prefix): - configure("--prefix=" + prefix, - "--with-scr-config-file=" + prefix + "/etc/scr.conf") - make() - make("install") + @run_after('install') + def copy_config(self): + spec = self.spec + if spec.variants['copy_config'].value: + dest_path = self.get_abs_path_rel_prefix( + spec.variants['scr_config'].value) + shutil.copyfile(spec.variants['copy_config'].value, dest_path) -- cgit v1.2.3-60-g2f50