summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Moody <moody20@llnl.gov>2021-03-08 19:22:47 -0600
committerGitHub <noreply@github.com>2021-03-08 17:22:47 -0800
commitd6fbf8ad57c874f67d86df6b4415c972a6b32240 (patch)
tree105d58312bb940c359a2b7d221229351edd0f7fa
parent8395df6b5b64fac9828eedcba8973aed4845c035 (diff)
downloadspack-d6fbf8ad57c874f67d86df6b4415c972a6b32240.tar.gz
spack-d6fbf8ad57c874f67d86df6b4415c972a6b32240.tar.bz2
spack-d6fbf8ad57c874f67d86df6b4415c972a6b32240.tar.xz
spack-d6fbf8ad57c874f67d86df6b4415c972a6b32240.zip
scr: require dtcmp, switch from /tmp to /dev/shm (#22073)
-rw-r--r--var/spack/repos/builtin/packages/scr/package.py20
1 files 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="<SCR> 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):