coderunner 0.11.22 → 0.11.23

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.22
1
+ 0.11.23
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "coderunner"
8
- s.version = "0.11.22"
8
+ s.version = "0.11.23"
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-30"
12
+ s.date = "2013-03-01"
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"]
@@ -1201,16 +1201,25 @@ Conditions contain a single = sign: #{conditions}
1201
1201
  #|| ""
1202
1202
  # qstat = qstat=~/\S/ ? qstat : nil
1203
1203
  job_no = nil
1204
- 5.times do # job_no may not appear instantly
1204
+ if self.respond_to? :queue_wait_attempts
1205
+ ntimes = queue_wait_attempts
1206
+ else
1207
+ ntimes = 5
1208
+ end
1209
+ eputs 'Waiting for job to appear in the queue...'
1210
+ ntimes.times do |i| # job_no may not appear instantly
1205
1211
  # eputs queue_status
1206
- new_job_nos = queue_status.scan(/^\s*(\d+)/).map{|match| match[0].to_i}
1207
- job_no = (new_job_nos-old_job_nos).sort[0]
1212
+ new_job_nos = queue_status.scan(/^\s*(\d+)/).map{|match| match[0].to_i}
1213
+ job_no = (new_job_nos-old_job_nos).sort[0]
1208
1214
  # eputs "job_no", job_no
1209
- break if job_no
1210
- sleep 0.2
1211
- qstat = queue_status
1215
+ break if job_no
1216
+ sleep 0.2
1217
+ qstat = queue_status
1218
+ if i == ntimes
1219
+ eputs 'Timeout... perhaps increase queue_wait_attempts in the system module?'
1212
1220
  end
1213
- job_no ||= -1 # some functions don't work if job_no couldn't be found, but most are ok
1221
+ end
1222
+ job_no ||= -1 # some functions don't work if job_no couldn't be found, but most are ok
1214
1223
  end
1215
1224
 
1216
1225
  private :get_new_job_no
@@ -146,5 +146,11 @@ def get_run_status(job_no, current_status)
146
146
  end
147
147
  end
148
148
 
149
+ # It takes a long time for the job to appear in the queue
150
+ # Each attempt to wait for it to appear takes 0.2 seconds
151
+ # Here we therefore wait 40 seconds!
152
+ def queue_wait_attempts
153
+ 200
154
+ end
149
155
  end
150
156
  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.22
4
+ version: 0.11.23
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-30 00:00:00.000000000 Z
12
+ date: 2013-03-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: graphkit