server_scripts 0.0.4 → 0.0.5

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
2
  SHA1:
3
- metadata.gz: 3f6a19bd7c183dbd3178bfe83a2a803e3c4bafcd
4
- data.tar.gz: 1d725ee40b7d3a06714a28ceda3655430bd5371a
3
+ metadata.gz: 49c64405f9a8b3a97c13db36fad927e3e3f3353a
4
+ data.tar.gz: 795ee015600d00c84752634fbdb0bc56c5325d4f
5
5
  SHA512:
6
- metadata.gz: 37f1d0df18a769dc754f65e19c943c1fb9ca31d0960a0a99877425dc1eb8fba7c8b3086d571f4bc662e0545796ee6130db97e0913ceba076e8f8b76b1668109b
7
- data.tar.gz: 44ef29d242a7e261e5a32eebd3037d58d378455d251d22c0e8f4c4b7870194551b0fcb03806ce376ad19ebd743a339d5a5995d3d0fa1d14fdc7e18d5b369f587
6
+ metadata.gz: 5f361a20a9bd64803525ec921662a99c03ed91ba290e9c499ecf6872a709da26bb602d742919f227537925787fbad5e39f44889626bb6b8cdf3652bbde230b05
7
+ data.tar.gz: 7b4b5ffe44d28777b75b8a669eff5f3180f9bcd860ec6a652716a930f7e87b55fce64713e21048db5e0dc63739816795fb52b9533182b8a6ba523789a4c6a001
@@ -2,6 +2,7 @@
2
2
  require 'server_scripts/node_type'
3
3
  require 'server_scripts/executor'
4
4
  require 'server_scripts/computer'
5
+ require 'server_scripts/parser'
5
6
  require 'server_scripts/version'
6
7
 
7
8
  module ServerScripts
@@ -126,22 +127,6 @@ module ServerScripts
126
127
  end
127
128
  end
128
129
  end
129
-
130
- class Parser
131
- class ITAC
132
- attr_reader :ideal_trace_file, :real_trace_file
133
-
134
- def initialize itac_file
135
- @itac_file = itac_file
136
- @ideal_trace_file = nil
137
- @real_trace_file = nil
138
- end
139
-
140
- def generate_ideal_trace!
141
-
142
- end
143
- end # class ITAC
144
- end # module Parser
145
130
  end # module ServerScripts
146
131
 
147
132
 
@@ -0,0 +1,2 @@
1
+ require 'server_scripts/parser/starpu_profile'
2
+ require 'server_scripts/parser/itac'
@@ -0,0 +1,17 @@
1
+ module ServerScripts
2
+ module Parser
3
+ class ITAC
4
+ attr_reader :ideal_trace_file, :real_trace_file
5
+
6
+ def initialize itac_file
7
+ @itac_file = itac_file
8
+ @ideal_trace_file = nil
9
+ @real_trace_file = nil
10
+ end
11
+
12
+ def generate_ideal_trace!
13
+
14
+ end
15
+ end # class ITAC
16
+ end
17
+ end
@@ -0,0 +1,48 @@
1
+ module ServerScripts
2
+ module Parser
3
+ class StarpuProfile
4
+ attr_reader :total_time
5
+ attr_reader :total_exec_time
6
+ attr_reader :total_sleep_time
7
+ attr_reader :total_overhead_time
8
+
9
+ def initialize regex
10
+ @regex = regex
11
+ @total_time = 0.0
12
+ @total_exec_time = 0.0
13
+ @total_sleep_time = 0.0
14
+ @total_overhead_time = 0.0
15
+
16
+ extract_data_from_profiles
17
+ end
18
+
19
+ private
20
+
21
+ def extract_data_from_profiles
22
+ Dir.glob(@regex) do |fname|
23
+ output = File.read(fname).split("\n")
24
+
25
+ output.each do |line|
26
+ match_data = line.match(/total\:\s+(\d+)\.\d+\sms\sexecuting\:\s(\d+).\d+\sms\ssleeping\:\s(\d+).\d+\sms\soverhead\s(\d+).\d+\sms/)
27
+
28
+ if match_data
29
+ exec_time = match_data[2].to_i
30
+
31
+ if exec_time != 0
32
+ @total_time += match_data[1].to_f
33
+ @total_exec_time += exec_time.to_f
34
+ @total_sleep_time += match_data[3].to_f
35
+ @total_overhead_time += match_data[4].to_f
36
+ end
37
+ end
38
+ end
39
+ end
40
+
41
+ @total_time /= 1e3
42
+ @total_exec_time /= 1e3
43
+ @total_sleep_time /= 1e3
44
+ @total_overhead_time /= 1e3
45
+ end
46
+ end
47
+ end
48
+ end # module StarpuProfile
@@ -1,3 +1,3 @@
1
1
  module ServerScripts
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: server_scripts
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sameer Deshmukh
@@ -76,6 +76,9 @@ files:
76
76
  - lib/server_scripts/executor/valgrind.rb
77
77
  - lib/server_scripts/executor/vanilla.rb
78
78
  - lib/server_scripts/node_type.rb
79
+ - lib/server_scripts/parser.rb
80
+ - lib/server_scripts/parser/itac.rb
81
+ - lib/server_scripts/parser/starpu_profile.rb
79
82
  - lib/server_scripts/version.rb
80
83
  - server_scripts.gemspec
81
84
  homepage: https://github.com/v0dro/server-scripts