forked from radical-experiments/deepdriveMD
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reorganize repo and prepare analysis
- Loading branch information
Showing
1,040 changed files
with
476 additions
and
0 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
#!/usr/bin/env python | ||
|
||
import sys | ||
import radical.utils as ru | ||
import radical.pilot as rp | ||
import radical.analytics as ra | ||
|
||
|
||
# ------------------------------------------------------------------------------ | ||
# | ||
if __name__ == '__main__': | ||
if len(sys.argv) < 2: | ||
print "\n\tusage: %s <session>\n" % sys.argv[0] | ||
sys.exit(1) | ||
|
||
src = sys.argv[1] | ||
stype = 'radical.pilot' | ||
|
||
session = ra.Session(src, stype) | ||
units = session.filter(etype='unit', inplace=False) | ||
unit_0 = units.get()[0] | ||
|
||
print 'session: %s' % session.uid | ||
print 'units: %d' % len(units.get()) | ||
|
||
# collect all events for some unit which relate to prte | ||
nevents = list() | ||
for e in unit_0.events: | ||
if 'prte' in e[1]: | ||
nevents.append(e) | ||
|
||
# for that sample unit, print the events and timestamps (ordered) | ||
print 'PRTE events for unit %s' % unit_0.uid | ||
for e in nevents: | ||
if 'prte' in e[1]: | ||
print '%14.7f : %s' % (e[0], e[1]) | ||
|
||
# for all event pairs (neighbors), compute the duration for (a) the sample | ||
# unit, and (b) the full session | ||
print 'PRTE durations for unit %s and session' % unit_0.uid | ||
idx = 0 | ||
while idx < len(nevents) - 1: | ||
|
||
this = nevents[idx ][1] | ||
that = nevents[idx + 1][1] | ||
duru = unit_0.duration( | ||
event=[{ru.STATE:rp.AGENT_EXECUTING, ru.EVENT:this}, | ||
{ru.STATE:rp.AGENT_EXECUTING, ru.EVENT:that}]) | ||
durs = units.duration( | ||
event=[{ru.STATE:rp.AGENT_EXECUTING, ru.EVENT:this}, | ||
{ru.STATE:rp.AGENT_EXECUTING, ru.EVENT:that}]) | ||
print '%3d: %-30s to %-30s = %14.7f [%14.7f]' \ | ||
% (idx, this, that, duru, durs) | ||
idx += 1 | ||
|
||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
#!/usr/bin/env python | ||
|
||
import sys | ||
|
||
import radical.utils as ru | ||
import radical.pilot as rp | ||
import radical.analytics as ra | ||
|
||
|
||
# ------------------------------------------------------------------------------ | ||
# | ||
if __name__ == '__main__': | ||
|
||
if len(sys.argv) < 2: | ||
print "\n\tusage: %s <session> [...]\n" % sys.argv[0] | ||
sys.exit(1) | ||
|
||
session_csv = open('sessions_prte.csv', 'w') | ||
unit_csv = open('units_prte.csv', 'w') | ||
|
||
prte_events = list() | ||
|
||
for src in sys.argv[1:]: | ||
|
||
stype = 'radical.pilot' | ||
session = ra.Session(src, stype) | ||
units = session.filter(etype='unit', inplace=False) | ||
unit_0 = units.get()[0] | ||
|
||
print 'session: %s' % session.uid | ||
print 'units: %d' % len(units.get()) | ||
|
||
# collect all events for some unit which relate to prte - if we don't | ||
# have them yet | ||
if not prte_events: | ||
for e in unit_0.events: | ||
if 'prte' in e[1]: | ||
prte_events.append(e[1]) | ||
idx = 0 | ||
s_row = ['sid'] | ||
u_row = ['uid', 'sid'] | ||
while idx < len(prte_events) - 1: | ||
|
||
this = prte_events[idx] | ||
that = prte_events[idx + 1] | ||
u_row.append('%s_to_%s' % (this, that)) | ||
s_row.append('%s_to_%s' % (this, that)) | ||
idx += 1 | ||
unit_csv.write('%s\n' % ','.join(u_row)) | ||
session_csv.write('%s\n' % ','.join(s_row)) | ||
|
||
# for all event pairs (neighbors), compute the duration for (a) the | ||
# sample unit, and (b) the full session | ||
idx = 0 | ||
s_row = [session.uid] | ||
while idx < len(prte_events) - 1: | ||
|
||
this = prte_events[idx] | ||
that = prte_events[idx + 1] | ||
duru = unit_0.duration( | ||
event=[{ru.STATE: rp.AGENT_EXECUTING, ru.EVENT: this}, | ||
{ru.STATE: rp.AGENT_EXECUTING, ru.EVENT: that}]) | ||
dur = units.duration( | ||
event=[{ru.STATE: rp.AGENT_EXECUTING, ru.EVENT: this}, | ||
{ru.STATE: rp.AGENT_EXECUTING, ru.EVENT: that}]) | ||
|
||
s_row.append('%.5f' % dur) | ||
idx += 1 | ||
print '%3d: %-30s to %-30s = %14.7f [%14.7f]' \ | ||
% (idx, this, that, duru, dur) | ||
|
||
session_csv.write('%s\n' % ','.join(s_row)) | ||
|
||
for unit in units.get(): | ||
u_row = [unit.uid, session.uid] | ||
idx = 0 | ||
s_row = [session.uid] | ||
while idx < len(prte_events) - 1: | ||
|
||
this = prte_events[idx] | ||
that = prte_events[idx + 1] | ||
dur = unit_0.duration( | ||
event=[{ru.STATE: rp.AGENT_EXECUTING, ru.EVENT: this}, | ||
{ru.STATE: rp.AGENT_EXECUTING, ru.EVENT: that}]) | ||
u_row.append('%.5f' % dur) | ||
idx += 1 | ||
|
||
unit_csv.write('%s\n' % ','.join(u_row)) | ||
|
||
session_csv.close() | ||
unit_csv.close() |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.