radical-cybertools / radical.analytics

Analytics for RADICAL-Cybertools
Other
1 stars 1 forks source link

Unable to retrieve pilot events #65

Closed jdakka closed 4 years ago

jdakka commented 6 years ago

I was looking for the following events:

PILOT_DURATIONS = {
        'p_total'     : [{STATE: None,            EVENT: 'bootstrap_1_start'},
                         {STATE: None,            EVENT: 'bootstrap_1_stop' }],

        'p_boot'      : [{STATE: None,            EVENT: 'bootstrap_1_start'},
                         {STATE: None,            EVENT: 'sync_rel'         }],
        'p_setup_1'   : [{STATE: None,            EVENT: 'sync_rel'         },
                         {STATE: None,            EVENT: 'orte_dvm_start'   }],
        'p_orte'      : [{STATE: None,            EVENT: 'orte_dvm_start'   },
                         {STATE: None,            EVENT: 'orte_dvm_ok'      }],
        'p_setup_2'   : [{STATE: None,            EVENT: 'orte_dvm_ok'      },
                         {STATE: PMGR_ACTIVE,     EVENT: 'state'            }],
        'p_uexec'     : [{STATE: PMGR_ACTIVE,     EVENT: 'state'            },
                         {STATE: None,            EVENT: 'cmd'              }],
        'p_term'      : [{STATE: None,            EVENT: 'cmd'              },
                         {STATE: None,            EVENT: 'bootstrap_1_stop' }]}

I am able to see these events in the pilot.0000/* agent files. However when I run my notebook and try

pilots = session.filter(etype='pilot', inplace=False)
for pilot in pilots.get():
    print pilot.events

I do not see the events that I need. All I can retrieve are the STATES.

Running notebook with radical-stack:

radical.analytics    : v0.45.2-101-g8358b08@devel
radical.pilot        : 0.47-v0.46.2-192-gd75dd20c@devel
radical.utils        : 0.47-v0.46-78-g4d51f71@devel
saga                 : 0.47-v0.46-10-g49ae961b@devel

Running application with RCT master

rp.session.two.jdakka.017529.0001.zip

andre-merzky commented 6 years ago

the following seems to work for me out of the box:

test.py:

#!/usr/bin/env python

import sys
import pprint

import radical.analytics as ra

session = ra.Session(sys.argv[1], 'radical.pilot')
pilots = session.filter(etype='pilot', inplace=False)

for pilot in pilots.get():
    pprint.pprint(pilot.events)

with:

$ tar zxvf rp.session.two.jdakka.017529.0001.zip
$ virtualenv ve
$ source ve/bin/activate
(ve) $ pip install radical.pilot radical.analytics
(ve) $ python test.py rp.session.two.jdakka.017529.0001

Can you give this a try, please?

jdakka commented 6 years ago

I tried with the events that I mentioned earlier i.e. bootstrap_1_start:

for pilot in pilots.get():
    for event in pilot.events:
        assert 'bootstrap_1_start' in event

I get this error:

Traceback (most recent call last):
  File "test.py", line 13, in <module>
    assert 'bootstrap_1_start' in event   
AssertionError

however if you look inside pilot.0000/bootstrap.prof you will see:

0.0083,bootstrap_1_start,bootstrap_1,MainThread,pilot.0000,PMGR_ACTIVE_PENDING, ... 2193.5819,bootstrap_1_stop,bootstrap_1,MainThread,pilot.0000,PMGR_ACTIVE_PENDING,

andre-merzky commented 6 years ago

Your loop above will check that all events have a bootstrap_1_start field - which will fail. You probably want:

found = False
for pilot in pilots.get():
    for event in pilot.events:
        if 'bootstrap_1_start' in event:
            found = True
            break
assert(found)

But I get your point - that event is missing indeed. Am I reading this correct though that with this stack, the pilot.events set is not empty anymore?

andre-merzky commented 6 years ago

This has been resolved via radical-cybertools/radical.utils@5656c60be