Class: ServerScripts::Parser::StarpuProfile
- Inherits:
-
Object
- Object
- ServerScripts::Parser::StarpuProfile
- Defined in:
- lib/server_scripts/parser/starpu_profile.rb
Instance Attribute Summary collapse
-
#time_hash ⇒ Object
readonly
Returns the value of attribute time_hash.
Instance Method Summary collapse
-
#initialize(regex) ⇒ StarpuProfile
constructor
Specify the regex that will allow finding the profile files for the given starpu processes.
- #proc_time(event:, proc_id:) ⇒ Object
- #time(event:, proc_id:, worker_id:) ⇒ Object
- #total_exec_time ⇒ Object
- #total_overhead_time ⇒ Object
- #total_sleep_time ⇒ Object
- #total_time ⇒ Object
Constructor Details
#initialize(regex) ⇒ StarpuProfile
Specify the regex that will allow finding the profile files for the given starpu processes. Each process will output one file.
Usage:
parser = Parser::StarpuProfile.new("4_proc_profile_1_*.starpu_profile")
parser.total_time
12 13 14 15 16 |
# File 'lib/server_scripts/parser/starpu_profile.rb', line 12 def initialize regex @regex = regex @time_hash = {} extract_data_from_profiles end |
Instance Attribute Details
#time_hash ⇒ Object (readonly)
Returns the value of attribute time_hash.
5 6 7 |
# File 'lib/server_scripts/parser/starpu_profile.rb', line 5 def time_hash @time_hash end |
Instance Method Details
#proc_time(event:, proc_id:) ⇒ Object
34 35 36 37 38 39 40 41 |
# File 'lib/server_scripts/parser/starpu_profile.rb', line 34 def proc_time event:, proc_id: time = 0.0 @time_hash[proc_id].each_value do |thread_info| time += thread_info[event] end time end |
#time(event:, proc_id:, worker_id:) ⇒ Object
43 44 45 |
# File 'lib/server_scripts/parser/starpu_profile.rb', line 43 def time event:, proc_id:, worker_id: @time_hash[proc_id][worker_id][event] end |
#total_exec_time ⇒ Object
22 23 24 |
# File 'lib/server_scripts/parser/starpu_profile.rb', line 22 def total_exec_time extract_from_time_hash :exec_time end |
#total_overhead_time ⇒ Object
30 31 32 |
# File 'lib/server_scripts/parser/starpu_profile.rb', line 30 def total_overhead_time extract_from_time_hash :overhead_time end |
#total_sleep_time ⇒ Object
26 27 28 |
# File 'lib/server_scripts/parser/starpu_profile.rb', line 26 def total_sleep_time extract_from_time_hash :sleep_time end |
#total_time ⇒ Object
18 19 20 |
# File 'lib/server_scripts/parser/starpu_profile.rb', line 18 def total_time extract_from_time_hash :total_time end |