coderunner 0.17.2 → 0.17.3

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: 2b0abf9dd6e6a60db107f9cb90b1ec2a01da16f3
4
- data.tar.gz: 3b748ca1afafeed0d546b6b95701190959291599
3
+ metadata.gz: 554e5c730407b32651cda8ce43cd5453fad35132
4
+ data.tar.gz: f34ed6190f5f242e748ecfbf24270ae60b92b9a0
5
5
  SHA512:
6
- metadata.gz: 49075a788f4bffdf23202df136f2319f298674991d8b8b899b9de6ebaeb6ebb3bcc15fe9833ec0f59bf3089532bd60b0458c37bd5b7475b8f49eee1bbb8dd197
7
- data.tar.gz: ebe2c25bd99beda5fa353abcbb3e1ede19ff7a27cf2e6aa89dc4487f0eab095a19760ad8e66d75bb04a3de0f84c79837730f2571035924e7bf7bb1e5dc5fe651
6
+ metadata.gz: a1692edb1e21f67c49f4a720e52e2d7b1bf4738f41a9263d61714eec25c35b804ec8a9552d38f312e6400394dc804cfe5832d4ae5edad69501e740a1ca2c1a1d
7
+ data.tar.gz: 67e773d77563e726b2d0f0f13573532c6a707d37ad76cce08c6ed9bec1ee7850e9783bc6943a9a49be35da6f4144c04eec2ee4828604b2fa99d0994ed492ba71
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.17.2
1
+ 0.17.3
@@ -2,17 +2,17 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: coderunner 0.17.2 ruby lib
5
+ # stub: coderunner 0.17.3 ruby lib
6
6
  # stub: ext/extconf.rb
7
7
 
8
8
  Gem::Specification.new do |s|
9
9
  s.name = "coderunner"
10
- s.version = "0.17.2"
10
+ s.version = "0.17.3"
11
11
 
12
12
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
13
13
  s.require_paths = ["lib"]
14
14
  s.authors = ["Edmund Highcock"]
15
- s.date = "2015-09-04"
15
+ s.date = "2015-09-09"
16
16
  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."
17
17
  s.email = "edmundhighcock@sourceforge.net"
18
18
  s.executables = ["coderunner", "coderunnerrepo"]
@@ -99,7 +99,7 @@ Gem::Specification.new do |s|
99
99
  s.licenses = ["GPLv3"]
100
100
  s.required_ruby_version = Gem::Requirement.new(">= 1.9.1")
101
101
  s.rubyforge_project = "coderunner"
102
- s.rubygems_version = "2.2.2"
102
+ s.rubygems_version = "2.4.8"
103
103
  s.summary = "A framework for the automated running and analysis of simulations."
104
104
 
105
105
  if s.respond_to? :specification_version then
@@ -34,14 +34,8 @@ EOF
34
34
  "aprun -n #{ppn*nodes}"
35
35
  end
36
36
  def get_run_status(job_no, current_status)
37
- if ((prefix = ENV['CODE_RUNNER_LAUNCHER']).size > 0 rescue false)
38
- if current_status =~ Regexp.new(job_no.to_s)
39
- @running = true
40
- return :Running
41
- else
42
- @running = false
43
- return :Unknown
44
- end
37
+ if use_launcher
38
+ return :Unknown
45
39
  end
46
40
  line = current_status.split(/\n/).grep(Regexp.new(job_no.to_s))[0]
47
41
  unless line
@@ -1,5 +1,7 @@
1
1
  class CodeRunner
2
+ require SCRIPT_FOLDER + '/system_modules/launcher.rb'
2
3
  module Moab
4
+ include Launcher
3
5
 
4
6
  #def self.configure_environment
5
7
  #eputs "Configuring Hector"
@@ -13,9 +15,8 @@ module Moab
13
15
  #end
14
16
 
15
17
  def queue_status
16
- if ((prefix = ENV['CODE_RUNNER_LAUNCHER']).size > 0 rescue false)
17
- %x[cat #{CodeRunner.launcher_directory}/queue_status.txt | grep sh] +
18
- %x[cat #{CodeRunner.launcher_directory}/queue_status2.txt | grep sh]
18
+ if use_launcher
19
+ queue_status_launcher
19
20
  else
20
21
  %x[qstat | grep $USER]
21
22
  end
@@ -25,22 +26,22 @@ module Moab
25
26
  "aprun -n #{nprocstot} -N #{ppn}"
26
27
  end
27
28
 
28
- def nodes
29
- nodes, ppn = @nprocs.split(/:/)[0].split(/x/)
30
- nodes.to_i
31
- end
29
+ def nodes
30
+ nodes, _ppn = @nprocs.split(/:/)[0].split(/x/)
31
+ nodes.to_i
32
+ end
32
33
  def ppn
33
- nodes, ppn = @nprocs.split(/:/)[0].split(/x/)
34
+ _nodes, ppn = @nprocs.split(/:/)[0].split(/x/)
34
35
  ppn.to_i
35
36
  end
36
37
  def nprocstot
37
38
 
38
39
  #nodes, ppn = @nprocs.split(/x/)
39
- nprocstot = nodes.to_i * ppn.to_i
40
+ _nprocstot = nodes.to_i * ppn.to_i
40
41
  end
41
42
  def run_command
42
43
  # "qsub #{batch_script_file}"
43
- if (ENV['CODE_RUNNER_LAUNCHER'].size > 0 rescue false)
44
+ if use_launcher
44
45
  return %[#{code_run_environment}
45
46
  #{mpi_prog} #{executable_location}/#{executable_name} #{parameter_string} > #{output_file} 2> #{error_file}]
46
47
  else
@@ -49,17 +50,11 @@ module Moab
49
50
  end
50
51
 
51
52
  def execute
52
- if ((prefix = ENV['CODE_RUNNER_LAUNCHER']).size > 0 rescue false)
53
- launch_id = "#{Time.now.to_i}#{$$}"
54
- fname = "#{CodeRunner.launcher_directory}/#{launch_id}"
55
- File.open(fname + '.start', 'w'){|file| file.print "cd #{Dir.pwd};", run_command, "\n"}
56
- sleep 2 until FileTest.exist? fname + '.pid'
57
- pid = File.read(fname + '.pid').to_i
58
- FileUtils.rm fname + '.pid'
59
- return pid
53
+ if use_launcher
54
+ return execute_launcher
60
55
  else
61
56
  File.open(batch_script_file, 'w'){|file| file.puts batch_script + run_command + "\n"}
62
- pid = %x[qsub #{batch_script_file}].to_i
57
+ _pid = %x[qsub #{batch_script_file}].to_i
63
58
  end
64
59
  end
65
60
 
@@ -109,59 +104,42 @@ EOF
109
104
  end
110
105
 
111
106
  def cancel_job
112
- if ((prefix = ENV['CODE_RUNNER_LAUNCHER']).size > 0 rescue false)
113
- fname = CodeRunner.launcher_directory + "/#{$$}.stop"
114
- File.open(fname, 'w'){|file| file.puts "\n"}
115
- else
116
- `qdel #{@job_no}`
117
- end
107
+ use_launcher ? cancel_job_launcher : `qdel #{@job_no}`
118
108
  end
119
109
 
120
110
  def error_file
121
- if (ENV['CODE_RUNNER_LAUNCHER'].size > 0 rescue false)
122
- return "#{executable_name}.#{job_identifier}.e"
123
- else
124
- return "#{executable_name}.#{job_identifier}.e#@job_no"
125
- end
111
+ use_launcher ? error_file_launcher :
112
+ "#{executable_name}.#{job_identifier}.e#@job_no"
126
113
  end
127
114
 
128
115
  def output_file
129
- if (ENV['CODE_RUNNER_LAUNCHER'].size > 0 rescue false)
130
- return "#{executable_name}.#{job_identifier}.o"
131
- else
132
- return "#{executable_name}.#{job_identifier}.o#@job_no"
133
- end
116
+ use_launcher ? output_file_launcher :
117
+ "#{executable_name}.#{job_identifier}.o#@job_no"
134
118
  end
135
119
 
136
- def get_run_status(job_no, current_status)
137
- if ((prefix = ENV['CODE_RUNNER_LAUNCHER']).size > 0 rescue false)
138
- if current_status =~ Regexp.new(job_no.to_s)
139
- @running = true
140
- return :Running
141
- else
142
- @running = false
143
- return :Unknown
144
- end
145
- end
146
- line = current_status.split(/\n/).grep(Regexp.new(job_no.to_s))[0]
147
- unless line
148
- return :Unknown
149
- else
150
- if line =~ /\sQ\s/
151
- return :Queueing
152
- elsif line =~ /\sR\s/
153
- return :Running
154
- elsif line =~ /\sH\s/
155
- return :Queueing
156
- elsif line =~ /\sC\s/
157
- @running=false
158
- return :Unknown
159
- else
160
- ep 'line', line
161
- raise 'Could not get run status'
162
- end
163
- end
164
- end
120
+ def get_run_status(job_no, current_status)
121
+ if use_launcher
122
+ return :Unknown
123
+ end
124
+ line = current_status.split(/\n/).grep(Regexp.new(job_no.to_s))[0]
125
+ unless line
126
+ return :Unknown
127
+ else
128
+ if line =~ /\sQ\s/
129
+ return :Queueing
130
+ elsif line =~ /\sR\s/
131
+ return :Running
132
+ elsif line =~ /\sH\s/
133
+ return :Queueing
134
+ elsif line =~ /\sC\s/
135
+ @running=false
136
+ return :Unknown
137
+ else
138
+ ep 'line', line
139
+ raise 'Could not get run status'
140
+ end
141
+ end
142
+ end
165
143
 
166
- end
144
+ end
167
145
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: coderunner
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.17.2
4
+ version: 0.17.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Edmund Highcock
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-09-04 00:00:00.000000000 Z
11
+ date: 2015-09-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: graphkit
@@ -286,7 +286,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
286
286
  version: '0'
287
287
  requirements: []
288
288
  rubyforge_project: coderunner
289
- rubygems_version: 2.2.2
289
+ rubygems_version: 2.4.8
290
290
  signing_key:
291
291
  specification_version: 4
292
292
  summary: A framework for the automated running and analysis of simulations.