coderunner 0.13.13 → 0.13.14

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.13.13
1
+ 0.13.14
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.13.13"
8
+ s.version = "0.13.14"
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 = "2013-08-27"
12
+ s.date = "2013-08-28"
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"]
@@ -358,12 +358,14 @@ EOF
358
358
  Dir.entries(tl).grep(/(^.*)\.start/).each do |file|
359
359
  file =~ (/(^.*)\.start/)
360
360
  id = $1
361
- command = File.read tl + '/' + file
361
+ command = ""
362
+ command = File.read tl + '/' + file while command == ""
362
363
  pid = fork do
363
364
  processes.each do |wpid|
364
365
  # Make sure all previously submitted jobs have finished.
365
366
  sleep refresh.to_i while %x[ps -e -o pid,ppid].split("\n").grep(Regexp.new("^\\s*#{wpid}\\s+#{ppid}")).size > 0
366
367
  end
368
+ #p ["command", command]
367
369
  exec(command)
368
370
  end
369
371
  `cp #{tl}/queue_status.txt #{tl}/queue_status2.txt; ps > #{tl}/queue_status.txt`
@@ -1177,7 +1177,11 @@ def self.delete_old_variables(all_variables_in_source)
1177
1177
  end
1178
1178
  end
1179
1179
  if variables_to_delete.find{|namelist, var_array| var_array.size > 0}
1180
- delete_old = Feedback.get_boolean("These variables are no longer present in the #{rcp.code_long} source folder. Do you wish to delete them?")
1180
+ unless ENV['CR_NON_INTERACTIVE']
1181
+ delete_old = Feedback.get_boolean("These variables are no longer present in the #{rcp.code_long} source folder. Do you wish to delete them?")
1182
+ else
1183
+ delete_old = true
1184
+ end
1181
1185
  if delete_old
1182
1186
  variables_to_delete.each do |namelist, var_array|
1183
1187
  var_array.each do |var|
@@ -392,4 +392,14 @@
392
392
  :explanation=>
393
393
  "This variable must be a floating point number (an integer is also acceptable: it will be converted into a floating point number)."}],
394
394
  :type=>:Float,
395
+ :autoscanned_defaults=>[]},
396
+ :dummy_complex=>
397
+ {:should_include=>"true",
398
+ :description=>nil,
399
+ :help=>nil,
400
+ :code_name=>:dummy_complex,
401
+ :must_pass=>
402
+ [{:test=>"kind_of? Complex",
403
+ :explanation=>"This variable must be a complex number."}],
404
+ :type=>:Complex,
395
405
  :autoscanned_defaults=>[]}}
@@ -65,7 +65,17 @@
65
65
  :explanation=>
66
66
  "This variable must be a floating point number (an integer is also acceptable: it will be converted into a floating point number)."}],
67
67
  :type=>:Float,
68
- :autoscanned_defaults=>[1.0]}}},
68
+ :autoscanned_defaults=>[1.0]},
69
+ :dummy_complex=>
70
+ {:should_include=>"true",
71
+ :description=>nil,
72
+ :help=>nil,
73
+ :code_name=>:dummy_complex,
74
+ :must_pass=>
75
+ [{:test=>"kind_of? Complex",
76
+ :explanation=>"This variable must be a complex number."}],
77
+ :type=>:Complex,
78
+ :autoscanned_defaults=>[]}}},
69
79
  :parameters=>{:description=>"", :should_include=>"true", :variables=>{}},
70
80
  :kt_grids_knobs=>{:description=>"", :should_include=>"true", :variables=>{}},
71
81
  :kt_grids_single_parameters=>
data/test/cubecalc.in CHANGED
@@ -5,4 +5,5 @@
5
5
  depth = 3.9
6
6
  height = 8.2
7
7
  dummy_for_arrays = 1.0
8
+ dummy_complex = (0.5, 5.0)
8
9
  /
@@ -17,7 +17,7 @@ using namespace std;
17
17
 
18
18
 
19
19
 
20
- int FNR_DEBUG=0;
20
+ int FNR_DEBUG=1;
21
21
 
22
22
  void fnr_error_message(char * message, int exit)
23
23
  {
@@ -230,7 +230,7 @@ void fnr_match_variables(char * text, char ** variable_names, char ** variable_v
230
230
 
231
231
  /* Compile regular expression */
232
232
  /*reti = regcomp(&regex, "(^|\n)[[:space:]]*([_[:alnum:]]+)([[:blank:]]|=)[[:space:]]*=[[:space:]]*(\"([^\"]|\\\\|\\\")+\"|'([[^']|\\\\|\\')+'|[[:alnum:].+-]+)([[:blank:]\r\n]|!)", REG_EXTENDED|REG_NEWLINE);*/
233
- reti = regcomp(&regex, "(^|\n|\r)[[:space:]]*([_[:alnum:]()]+)([[:blank:]]+=|=)[[:blank:]]*(\"([^\"]|\\\\|\\\")+\"|'([^']|\\\\|\\')+'|[[:alnum:].+-]+)([[:blank:]\r\n]|!)", REG_EXTENDED|REG_NEWLINE);
233
+ reti = regcomp(&regex, "(^|\n|\r)[[:space:]]*([_[:alnum:]()]+)([[:blank:]]+=|=)[[:blank:]]*(\"([^\"]|\\\\|\\\")+\"|'([^']|\\\\|\\')+'|[[:alnum:].+-]+|[(][[:blank:]]*[[:alnum:].+-]+[[:blank:]]*,[[:blank:]]*[[:alnum:].+-]+[)])([[:blank:]\r\n]|!)", REG_EXTENDED|REG_NEWLINE);
234
234
  if( reti ){ fprintf(stderr, "Could not compile regex for matching namelist names and texts\n"); exit(1); }
235
235
  int i = 0;
236
236
 
@@ -45,6 +45,8 @@ class TestSubmission < Test::Unit::TestCase
45
45
  def test_status_loop
46
46
  unless ENV['SHORT_TEST']
47
47
  ENV['CODE_RUNNER_LAUNCHER'] = '42323490qw4q4432407Q2342U3'
48
+ #@mutex = Mutex.new
49
+ #@launcher_started =
48
50
  @thread = Thread.new{CodeRunner.start_launcher(0.5,10)}
49
51
  sleep 0.1 while not FileTest.exist?(CodeRunner.launcher_directory)
50
52
  CodeRunner.submit(Y: 'test/submission_results', C: 'cubecalc', m: 'sleep', X: Dir.pwd + '/test/submission_results/cubecalc', p: '{sleep_time: 2}')
@@ -389,7 +391,7 @@ class TestFortranNamelistC < Test::Unit::TestCase
389
391
  CodeRunner::Cubecalc::WithNamelist.make_new_defaults_file('cubecalctest', 'test/cubecalc.in')
390
392
  FileUtils.mv('cubecalctest_defaults.rb', CodeRunner::Cubecalc::WithNamelist.rcp.user_defaults_location + '/cubecalctest_defaults.rb')
391
393
  FileUtils.makedirs(tfolder)
392
- CodeRunner.submit(C: 'cubecalc', m: 'with_namelist', Y: tfolder, X: Dir.pwd + '/test/cubecalc_namelist', D: 'cubecalctest', p: '{dummy_for_arrays: [0.5, 0.6]}')
394
+ CodeRunner.submit(C: 'cubecalc', m: 'with_namelist', Y: tfolder, X: Dir.pwd + '/test/cubecalc_namelist', D: 'cubecalctest', p: '{dummy_for_arrays: [0.5, 0.6], dummy_complex: [Complex(0.4,0.5), Complex(1.3, 3.4)]}')
393
395
  CodeRunner.status(Y: tfolder)
394
396
  runner = CodeRunner.fetch_runner(Y: tfolder)
395
397
  assert_equal(86.35, runner.run_list[1].volume.round(2))
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.13.13
4
+ version: 0.13.14
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: 2013-08-27 00:00:00.000000000 Z
12
+ date: 2013-08-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: graphkit