coderunner 0.11.20 → 0.11.21

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.11.20
1
+ 0.11.21
data/coderunner.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "coderunner"
8
- s.version = "0.11.20"
8
+ s.version = "0.11.21"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Edmund Highcock"]
12
- s.date = "2012-12-13"
12
+ s.date = "2012-12-18"
13
13
  s.description = "CodeRunner is a framework for the automated running and analysis of simulations. It automatically generates any necessary input files, organises the output data and analyses it. Because it is a modular system, it can easily be customised to work with any system and any simulation code. One of its greatest strengths is that it is independent of any one simulation code; thus it can easily plot and compare the data from different codes."
14
14
  s.email = "edmundhighcock@sourceforge.net"
15
15
  s.executables = ["coderunner"]
@@ -47,6 +47,7 @@ Gem::Specification.new do |s|
47
47
  "lib/coderunner/merged_code_runner.rb",
48
48
  "lib/coderunner/remote_code_runner.rb",
49
49
  "lib/coderunner/run.rb",
50
+ "lib/coderunner/system_modules/blue_joule.rb",
50
51
  "lib/coderunner/system_modules/franklin.rb",
51
52
  "lib/coderunner/system_modules/generic_linux.rb",
52
53
  "lib/coderunner/system_modules/genericlinux_testsystem.rb",
@@ -54,6 +55,7 @@ Gem::Specification.new do |s|
54
55
  "lib/coderunner/system_modules/helios.rb",
55
56
  "lib/coderunner/system_modules/iridis.rb",
56
57
  "lib/coderunner/system_modules/juropa.rb",
58
+ "lib/coderunner/system_modules/load_leveler.rb",
57
59
  "lib/coderunner/system_modules/macosx.rb",
58
60
  "lib/coderunner/system_modules/moab.rb",
59
61
  "lib/coderunner/system_modules/new_hydra.rb",
@@ -75,7 +77,7 @@ Gem::Specification.new do |s|
75
77
  s.require_paths = ["lib"]
76
78
  s.required_ruby_version = Gem::Requirement.new(">= 1.9.1")
77
79
  s.rubyforge_project = "coderunner"
78
- s.rubygems_version = "1.8.24"
80
+ s.rubygems_version = "1.8.23"
79
81
  s.summary = "A framework for the automated running and analysis of simulations."
80
82
 
81
83
  if s.respond_to? :specification_version then
@@ -140,7 +140,7 @@ class CodeRunner
140
140
 
141
141
  # These are the only permitted values for the run instance variable <tt>@status</tt>.
142
142
 
143
- PERMITTED_STATI = [:Unknown, :Complete, :Incomplete, :NotStarted, :Failed, :Queueing, :Running]
143
+ PERMITTED_STATI = [:Unknown, :Complete, :Incomplete, :NotStarted, :Failed, :Queueing, :Running, :Held]
144
144
 
145
145
 
146
146
  include Log
@@ -0,0 +1,12 @@
1
+
2
+ class CodeRunner
3
+ module BlueJoule
4
+
5
+ require SCRIPT_FOLDER + '/system_modules/load_leveler.rb'
6
+ include LoadLeveler
7
+ def max_ppn
8
+ 16
9
+ end
10
+ end
11
+ end
12
+
@@ -0,0 +1,150 @@
1
+ class CodeRunner
2
+ module LoadLeveler
3
+
4
+
5
+
6
+ def queue_status
7
+ if ((prefix = ENV['CODE_RUNNER_LAUNCHER']).size > 0 rescue false)
8
+ %x[cat #{ENV['HOME']}/.coderunner_to_launch_#{prefix}/queue_status.txt] +
9
+ %x[cat #{ENV['HOME']}/.coderunner_to_launch_#{prefix}/queue_status2.txt]
10
+ else
11
+ %x[llq -W | grep $USER].gsub(/^bglogin\d\./, '')
12
+ end
13
+ end
14
+
15
+ #def mpi_prog
16
+ #"aprun -n #{nprocstot} -N #{ppn}"
17
+ #end
18
+
19
+ def nodes
20
+ nodes, ppn = @nprocs.split(/x/)
21
+ nodes
22
+ end
23
+ def ppn
24
+ nodes, ppn = @nprocs.split(/x/)
25
+ ppn
26
+ end
27
+ def nprocstot
28
+ nodes, ppn = @nprocs.split(/x/)
29
+ nprocstot = nodes.to_i * ppn.to_i
30
+ end
31
+ def run_command
32
+ # "qsub #{batch_script_file}"
33
+ if (ENV['CODE_RUNNER_LAUNCHER'].size > 0 rescue false)
34
+ return %[mpiexec -np #{@nprocs} #{executable_location}/#{executable_name} #{parameter_string} > #{output_file} 2> #{error_file}]
35
+ else
36
+ #nodes, ppn = @nprocs.split(/x/)
37
+ #nprocstot = nodes.to_i * ppn.to_i
38
+ "runjob --env-all --exe #{executable_location}/#{executable_name} --np #{nprocstot} --ranks-per-node #{ppn} --args \"#{parameter_string}\""
39
+ end
40
+ end
41
+
42
+ def execute
43
+ if ((prefix = ENV['CODE_RUNNER_LAUNCHER']).size > 0 rescue false)
44
+ launch_id = "#{Time.now.to_i}#{$$}"
45
+ fname = ENV['HOME'] + "/.coderunner_to_launch_#{prefix}/#{launch_id}"
46
+ File.open(fname + '.start', 'w'){|file| file.puts "cd #{Dir.pwd};#{run_command}"}
47
+ sleep 1 until FileTest.exist? fname + '.pid'
48
+ pid = File.read(fname + '.pid').to_i
49
+ FileUtils.rm fname + '.pid'
50
+ return pid
51
+ else
52
+ File.open(batch_script_file, 'w'){|file| file.puts batch_script + "\n" + run_command + "\n"}
53
+ %x[llsubmit #{batch_script_file}].to_i
54
+ return nil
55
+ end
56
+ end
57
+
58
+ def batch_script_file
59
+ "#{executable_name}_#{job_identifier}.sh"
60
+ end
61
+
62
+ def max_ppn
63
+ raise "Please define max_ppn for your system"
64
+ end
65
+
66
+ def batch_script
67
+
68
+ nodes, ppn = @nprocs.split(/x/)
69
+ eputs "Warning: You must use 128 nodes or greater on a BlueGene Q: This may fail." if nodes.to_i < 128
70
+ eputs "Warning: Underuse of nodes (#{ppn} cores per node instead of #{max_ppn})" if ppn.to_i < max_ppn
71
+ eputs "Warning: processes per node excedes cores per node: #{max_ppn}" if ppn.to_i > max_ppn
72
+ ppn ||= max_ppn
73
+ if @wall_mins
74
+ ep @wall_mins
75
+ hours = (@wall_mins / 60).floor
76
+ mins = @wall_mins.to_i % 60
77
+ secs = ((@wall_mins - @wall_mins.to_i) * 60).to_i
78
+ eputs "Allotted wall time is " + sprintf("%02d:%02d:%02d", hours, mins, secs)
79
+ else
80
+ raise "Error: no wall clock time specified."
81
+ end
82
+
83
+ return <<EOF
84
+ #!/bin/bash
85
+
86
+ ## job requirements for load leveler
87
+ ######################################################################
88
+ \#@bg_size=#{nodes}
89
+ \#@job_type=bluegene
90
+ \#@class=prod
91
+ \#@executable=#{batch_script_file}
92
+ \#@environment=COPY_ALL
93
+ \#@output=#{executable_name}.#{job_identifier}.$(jobid).output.txt
94
+ \#@error=#{executable_name}.#{job_identifier}.$(jobid).error.txt
95
+ \#@wall_clock_limit=#{sprintf("%02d:%02d:%02d", hours, mins, secs)}
96
+ \#@notification=complete
97
+ \#@queue
98
+
99
+ ## commands to be executed
100
+ ######################################################################
101
+ ## This is any custom configuration required for the code:
102
+ #{code_run_environment}
103
+ printenv
104
+ echo "Submitting #{nodes}x#{ppn} job on #{CodeRunner::SYS} for project (#@project)..."
105
+
106
+
107
+ EOF
108
+
109
+ end
110
+
111
+ def cancel_job
112
+ if ((prefix = ENV['CODE_RUNNER_LAUNCHER']).size > 0 rescue false)
113
+ fname = ENV['HOME'] + "/.coderunner_to_launch_#{prefix}/#{$$}.stop"
114
+ File.open(fname, 'w'){|file| file.puts "\n"}
115
+ else
116
+ `llcancel #{@job_no}`
117
+ end
118
+ end
119
+
120
+ def error_file
121
+ return "#{executable_name}.#{job_identifier}.#@job_no.error.txt"
122
+ end
123
+
124
+ def output_file
125
+ return "#{executable_name}.#{job_identifier}.#@job_no.output.txt"
126
+ end
127
+
128
+ def get_run_status(job_no, current_status)
129
+ if ((prefix = ENV['CODE_RUNNER_LAUNCHER']).size > 0 rescue false)
130
+ return :Unknown
131
+ end
132
+ line = current_status.split(/\n/).grep(Regexp.new(job_no.to_s))[0]
133
+ unless line
134
+ return :Unknown
135
+ else
136
+ if line =~ /\sS|H\s/
137
+ return :Held
138
+ elsif line =~ /\sI\s/
139
+ return :Queueing
140
+ elsif line =~ /\sR\s/
141
+ return :Running
142
+ else
143
+ ep 'line', line
144
+ raise 'Could not get run status'
145
+ end
146
+ end
147
+ end
148
+
149
+ end
150
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: coderunner
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.20
4
+ version: 0.11.21
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-12-13 00:00:00.000000000 Z
12
+ date: 2012-12-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: graphkit
@@ -214,6 +214,7 @@ files:
214
214
  - lib/coderunner/merged_code_runner.rb
215
215
  - lib/coderunner/remote_code_runner.rb
216
216
  - lib/coderunner/run.rb
217
+ - lib/coderunner/system_modules/blue_joule.rb
217
218
  - lib/coderunner/system_modules/franklin.rb
218
219
  - lib/coderunner/system_modules/generic_linux.rb
219
220
  - lib/coderunner/system_modules/genericlinux_testsystem.rb
@@ -221,6 +222,7 @@ files:
221
222
  - lib/coderunner/system_modules/helios.rb
222
223
  - lib/coderunner/system_modules/iridis.rb
223
224
  - lib/coderunner/system_modules/juropa.rb
225
+ - lib/coderunner/system_modules/load_leveler.rb
224
226
  - lib/coderunner/system_modules/macosx.rb
225
227
  - lib/coderunner/system_modules/moab.rb
226
228
  - lib/coderunner/system_modules/new_hydra.rb
@@ -257,7 +259,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
257
259
  version: '0'
258
260
  requirements: []
259
261
  rubyforge_project: coderunner
260
- rubygems_version: 1.8.24
262
+ rubygems_version: 1.8.23
261
263
  signing_key:
262
264
  specification_version: 3
263
265
  summary: A framework for the automated running and analysis of simulations.