Skip to content

Commit

Permalink
Merge pull request #15 from eth-cscs/deploy/reframe-2.6.1
Browse files Browse the repository at this point in the history
Reframe 2.6.1 public release
  • Loading branch information
vkarak authored Sep 25, 2017
2 parents 0ca1823 + 982c9fb commit 6e8fcb1
Show file tree
Hide file tree
Showing 48 changed files with 1,690 additions and 1,445 deletions.
7 changes: 7 additions & 0 deletions ci-scripts/ci-runner.bash
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,13 @@ if [ $CI_EXITCODE -eq 0 ]; then
swap_files reframe/settings.public.py reframe/settings.py
fi

# FIXME: Temporary workaround for the PE upgrade on Daint
if [[ $(hostname) == daint* ]]; then
# Do not test modfied tests on Daint
exit $CI_EXITCODE
fi


# Find modified or added user checks
userchecks=( $(git log --name-status --oneline --no-merges -1 | \
grep -e '^[AM][[:space:]]*checks/.*\.py$' | \
Expand Down
5 changes: 3 additions & 2 deletions reframe/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,12 @@
stderr=subprocess.PIPE,
universal_newlines=True)
if re.search('Unknown shell type', _completed.stderr, re.MULTILINE):
sys.stderr.write('Python is not supported by this modules framework.\n')
sys.stderr.write(
'Python is not supported by this modules framework.\n')
sys.exit(1)

except OSError:
# modulecmd was not found
sys.stderr.write("Could not run modulecmd. Tried `%s' and failed.\n" % \
sys.stderr.write("Could not run modulecmd. Tried `%s' and failed.\n" %
MODULECMD_PYTHON)
sys.exit(1)
59 changes: 59 additions & 0 deletions reframe/core/debug.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
#
# Internal debug utilities for the framework
#

import builtins
import threading

# Current indentation levels per thread
_depth = {}


def _gettid():
tid = threading.get_ident()
_depth.setdefault(tid, 0)
return tid


def _increase_indent():
tid = _gettid()
_depth[tid] += 1
return _depth[tid]


def _decrease_indent():
tid = _gettid()
_depth[tid] -= 1
return _depth[tid]


def repr(obj, indent=4, max_depth=2):
"""Return a generic representation string for object `obj`.
Keyword arguments:
indent -- indentation width
max_depth -- maximum depth for expanding nested objects
"""
if not hasattr(obj, '__dict__'):
# Delegate to the builtin repr() for builtin types
return builtins.repr(obj)

tid = _gettid()
indent_width = _increase_indent() * indent

# Attribute representation
if _depth[tid] == max_depth:
attr_list = ['...']
else:
attr_list = ['%s%s=%r' % (indent_width * ' ', attr, val)
for attr, val in sorted(obj.__dict__.items())]

repr_fmt = '%(module_name)s.%(class_name)s(%(attr_repr)s)@0x%(addr)x'
ret = repr_fmt % {
'module_name': obj.__module__,
'class_name': obj.__class__.__name__,
'attr_repr': ',\n'.join(attr_list),
'addr': id(obj)
}
_decrease_indent()
return ret
Loading

0 comments on commit 6e8fcb1

Please sign in to comment.