summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
Diffstat (limited to 'var')
-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):