From d6fbf8ad57c874f67d86df6b4415c972a6b32240 Mon Sep 17 00:00:00 2001 From: Adam Moody Date: Mon, 8 Mar 2021 19:22:47 -0600 Subject: scr: require dtcmp, switch from /tmp to /dev/shm (#22073) --- var/spack/repos/builtin/packages/scr/package.py | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/var/spack/repos/builtin/packages/scr/package.py b/var/spack/repos/builtin/packages/scr/package.py index 6821f8c5ed..28513e5ce6 100644 --- a/var/spack/repos/builtin/packages/scr/package.py +++ b/var/spack/repos/builtin/packages/scr/package.py @@ -7,6 +7,9 @@ from spack import * import os +# to get system platform type +import sys + class Scr(CMakePackage): """SCR caches checkpoint data in storage on the compute nodes of a @@ -43,10 +46,15 @@ class Scr(CMakePackage): depends_on('filo', when="@3:") depends_on('spath', when="@3:") + # DTCMP is an optional dependency up until 3.x variant('dtcmp', default=True, description="Build with DTCMP. " "Necessary to enable user directory naming at runtime") - depends_on('dtcmp', when="+dtcmp") + depends_on('dtcmp', when="@:2.999 +dtcmp") + + # DTCMP is a required dependency with 3.x and later + conflicts('~dtcmp', when="@3:", msg=" DTCMP required for versions >=3") + depends_on('dtcmp', when="@3:") variant('libyogrt', default=True, description="Build SCR with libyogrt for get_time_remaining.") @@ -83,9 +91,13 @@ class Scr(CMakePackage): 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', + # The default cache and control directories should be placed in tmpfs if available. + # On Linux, /dev/shm is a common tmpfs location. Other platforms, like macOS, + # do not define a common tmpfs location, so /tmp is the next best option. + platform_tmp_default = '/dev/shm' if sys.platform == 'linux' else '/tmp' + variant('cache_base', default=platform_tmp_default, + description='Compile time default location for cache directory.') + variant('cntl_base', default=platform_tmp_default, description='Compile time default location for control directory.') def get_abs_path_rel_prefix(self, path): -- cgit v1.2.3-70-g09d2