Skip to content

Commit

Permalink
Merge pull request #110 from radical-cybertools/fix/dependency
Browse files Browse the repository at this point in the history
radical.pilot is a dependency to be included
  • Loading branch information
andre-merzky authored Jan 30, 2020
2 parents 4f5242d + d48aeaf commit 14b9581
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 7 deletions.
7 changes: 6 additions & 1 deletion bin/radical-analytics-check
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,12 @@ if __name__ == '__main__':
found_events = set()
all_events = dict()

import radical.pilot as rp
try:
import radical.pilot as rp
except:
print('%s requires radical.pilot, please install it.' % sys.argv[0])
sys.exit(1)

rp_path = os.path.dirname(rp.__file__)
ev_path = '%s/../../../../../share/radical.pilot/events.md' % rp_path

Expand Down
9 changes: 9 additions & 0 deletions bin/radical-analytics-inspect
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@
# FIXME: use metric definitions from RP (include colors and labels)
# FIXME: use common plotter in src/ra/plotter.py (move from bin/ra-plot)

python -c 'import radical.pilot' > /dev/null 2>&1
if ! test "$?" = 0
then
echo
echo "$0 requires radical.pilot, please install it."
echo
exit 1
fi

ARGS=$*
bin="$( cd "$(dirname "$0")" ; pwd -P )"

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ def run (self) :
'package_data' : {'': ['*.txt', '*.sh', '*.json', '*.gz', '*.c',
'*.md', 'VERSION', 'SDIST', sdist_name]},
# 'setup_requires' : ['pytest-runner'],
'install_requires' : ['radical.utils>=0.90',
'install_requires' : ['radical.utils>=1.0',
'matplotlib<=3.0',
'psutil',
'pandas',
Expand Down
2 changes: 0 additions & 2 deletions src/radical/analytics/experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,6 @@ def utilization(self, metrics):
# obtain resources provisions and consumptions for all sessions
for session in self._sessions:

import radical.pilot as rp

sid = session.uid
p, c, sa, sr, i = session.utilization(metrics)

Expand Down
20 changes: 17 additions & 3 deletions src/radical/analytics/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,13 @@ def _walkdir(path, profiles=[]):

elif stype == 'radical.pilot':

import radical.pilot.utils as rpu
try:
import radical.pilot.utils as rpu
except:
raise RuntimeError('radical.analytics requires the '
'radical.pilot module to analyze this '
'session - please install it.')

self._profile, accuracy, hostmap \
= rpu.get_session_profile (sid=sid, src=self._src)
self._description = rpu.get_session_description(sid=sid, src=self._src)
Expand All @@ -105,7 +111,12 @@ def _walkdir(path, profiles=[]):

elif stype == 'radical.entk':

import radical.entk.utils as reu
try:
import radical.etk.utils as reu
except:
raise RuntimeError('radical.analytics requires the '
'radical.entk module to analyze this '
'session - please install it.')

self._profile, accuracy, hostmap \
= reu.get_session_profile (sid=sid, src=self._src)
Expand Down Expand Up @@ -955,7 +966,10 @@ def rate(self, state=None, event=None, time=None, sampling=None,
#
def utilization(self, metrics):

assert(self._stype == 'radical.pilot')
if self._stype != 'radical.pilot':
raise ValueError('session utilization is only available on '
'radical.pilot sessions')

import radical.pilot as rp

provided = rp.utils.get_provided_resources(self)
Expand Down

0 comments on commit 14b9581

Please sign in to comment.