server_scripts 0.1.3.1 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: e44877c4bad8e2b1d161e028d404d45a4c2c4845
4
- data.tar.gz: 12450d5d88136b4b1749ac675197635c190c447f
2
+ SHA256:
3
+ metadata.gz: 0fd30e55721d13278b7d47cd976a8bd047fbe33dd9ebcaf49503f40f3ed5825b
4
+ data.tar.gz: a322d390fba4a2c2d2b5b841b91006af9452ee52f53eaa20005643e30107dfd5
5
5
  SHA512:
6
- metadata.gz: c24fbebc870ae99c0f2360c4646c4d680e4019135843cd88e4dcc1d8c1a15b169f885800e3477f98bf30d3ca80cacbf612bc7685fe93c19c252793444ab8e9ec
7
- data.tar.gz: fe97dd7017e06e283f753d76d7f9e0d319d22b1804b09d79e24d11a4d6ff5585e4e1c334fcc1435b93893618f38db8ab1db2cc0c88d571c68270bb9b7e185aca
6
+ metadata.gz: 9dcf94781e9d5ceb4497dceeeaba15dcc07825ed69cac0212787d2e1c6413945fbe1c042791f4a4061d42c545b3868ddbd4eb069c4886bbe77595f1842716d36
7
+ data.tar.gz: 99ce228f943d2bd3718e015003577b807918b2ff783ecbbe15a5ab5876cee5346672d59f231dee2de98139a9bf4890b01effa2edf1ce321e00be3b334bd50f07
data/README.md CHANGED
@@ -162,3 +162,19 @@ puts parser.total_overhead_time
162
162
  puts parser.time(event: :total_time, proc_id: 0, worker_id: 4)
163
163
  puts parser.proc_time event: :exec_time, proc_id: 2
164
164
  ```
165
+
166
+ ## CUBEX profiles
167
+
168
+ Parse data from profiles generated by scorep in `.cubex` file format.
169
+
170
+ ### Usage for getting performance metrics
171
+
172
+ Use the `Parser::Cubex` class and provide it with a folder name. The folder should contain a `profile.cubex` file
173
+ that will be parsed for the output. Then use the `parse` method for obtaining various perf counters for any event:
174
+
175
+ ``` ruby
176
+ parser = Parser::Cubex.new("test/artifacts/cubex")
177
+ puts parser.parse(counter: "PAPI_L3_TCM", event: "gemv")
178
+ ```
179
+
180
+
File without changes
@@ -1,3 +1,4 @@
1
1
  require 'server_scripts/parser/starpu_profile'
2
2
  require 'server_scripts/parser/itac'
3
3
  require 'server_scripts/parser/vtune'
4
+ require 'server_scripts/parser/cubex'
@@ -0,0 +1,42 @@
1
+ module ServerScripts
2
+ module Parser
3
+ class Cubex
4
+ # Supply the folder name of the cubex file. There should be a profile.cubex file
5
+ # inside this folder.
6
+ def initialize(fname)
7
+ ['cube_stat', 'cube_info'].each do |cmd|
8
+ raise RuntimeError, "Must have #{cmd} installed." unless File.which(cmd)
9
+ end
10
+ @fname = "#{fname}/profile.cubex"
11
+ raise RuntimeError, "#{@fname} does not exist!" unless File.exists?(@fname)
12
+ end
13
+
14
+ # Get the call tree of the file as a string.
15
+ def call_tree
16
+ `cube_info #{@fname}`
17
+ end
18
+
19
+ # Read the call tree and get the value for the given metric. Will return nil
20
+ # if the said metric does not exist for the given event.
21
+ def parse metric: , event:
22
+ tree = `cube_info -m #{metric} #{@fname}`
23
+ tree.each_line do |line|
24
+ if /\s+#{event}\s+/.match(line)
25
+ wo_space = line.gsub(" ", "")
26
+ value = (/\|(\d+\.?\d+?)\|/.match(wo_space)[1]).to_f
27
+ return value
28
+ end
29
+ end
30
+
31
+ nil
32
+ end
33
+
34
+ # Return an array of all the metrics available for the given cubex file.
35
+ def all_metrics
36
+ output = `cube_info #{@fname} -l`
37
+ output.split("\n")
38
+ end
39
+ end # class Cubex
40
+ end # module Parser
41
+ end # module ServerScripts
42
+
@@ -1,3 +1,3 @@
1
1
  module ServerScripts
2
- VERSION = "0.1.3.1"
2
+ VERSION = "0.1.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: server_scripts
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3.1
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sameer Deshmukh
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-03-08 00:00:00.000000000 Z
11
+ date: 2020-04-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ptools
@@ -96,6 +96,7 @@ files:
96
96
  - lib/server_scripts/memory_monitor.rb
97
97
  - lib/server_scripts/node_type.rb
98
98
  - lib/server_scripts/parser.rb
99
+ - lib/server_scripts/parser/cubex.rb
99
100
  - lib/server_scripts/parser/itac.rb
100
101
  - lib/server_scripts/parser/starpu_profile.rb
101
102
  - lib/server_scripts/parser/vtune.rb
@@ -125,8 +126,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
125
126
  - !ruby/object:Gem::Version
126
127
  version: '0'
127
128
  requirements: []
128
- rubyforge_project:
129
- rubygems_version: 2.6.14
129
+ rubygems_version: 3.1.2
130
130
  signing_key:
131
131
  specification_version: 4
132
132
  summary: Easily write scripts for submitted jobs to various machines.