coderunner 0.11.21 → 0.11.22
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/coderunner.gemspec +2 -2
- data/lib/coderunner/run.rb +12 -1
- data/lib/coderunner/system_modules/moab.rb +22 -8
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.11.
|
1
|
+
0.11.22
|
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.
|
8
|
+
s.version = "0.11.22"
|
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-
|
12
|
+
s.date = "2012-12-30"
|
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"]
|
data/lib/coderunner/run.rb
CHANGED
@@ -684,7 +684,7 @@ def info_file
|
|
684
684
|
|
685
685
|
|
686
686
|
# Actual Command:
|
687
|
-
# #{run_command}
|
687
|
+
# #{run_command.gsub(/\n/, "\n#")}
|
688
688
|
# <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
|
689
689
|
EOF
|
690
690
|
|
@@ -1010,6 +1010,17 @@ end
|
|
1010
1010
|
def code_run_environment
|
1011
1011
|
""
|
1012
1012
|
end
|
1013
|
+
|
1014
|
+
def warning(message)
|
1015
|
+
eputs "Warning: " + message; sleep 0.3
|
1016
|
+
end
|
1017
|
+
|
1018
|
+
class SubmitError < StandardError
|
1019
|
+
end
|
1020
|
+
|
1021
|
+
def error(message)
|
1022
|
+
raise("Error: " + message)
|
1023
|
+
end
|
1013
1024
|
end
|
1014
1025
|
|
1015
1026
|
end
|
@@ -14,8 +14,8 @@ EOF
|
|
14
14
|
|
15
15
|
def queue_status
|
16
16
|
if ((prefix = ENV['CODE_RUNNER_LAUNCHER']).size > 0 rescue false)
|
17
|
-
%x[cat #{ENV['HOME']}/.coderunner_to_launch_#{prefix}/queue_status.txt] +
|
18
|
-
%x[cat #{ENV['HOME']}/.coderunner_to_launch_#{prefix}/queue_status2.txt]
|
17
|
+
%x[cat #{ENV['HOME']}/.coderunner_to_launch_#{prefix}/queue_status.txt | grep sh] +
|
18
|
+
%x[cat #{ENV['HOME']}/.coderunner_to_launch_#{prefix}/queue_status2.txt | grep sh]
|
19
19
|
else
|
20
20
|
%x[qstat | grep $USER]
|
21
21
|
end
|
@@ -37,7 +37,7 @@ EOF
|
|
37
37
|
def run_command
|
38
38
|
# "qsub #{batch_script_file}"
|
39
39
|
if (ENV['CODE_RUNNER_LAUNCHER'].size > 0 rescue false)
|
40
|
-
return %[
|
40
|
+
return %[#{mpi_prog} #{executable_location}/#{executable_name} #{parameter_string} > #{output_file} 2> #{error_file}]
|
41
41
|
else
|
42
42
|
nodes, ppn = @nprocs.split(/x/)
|
43
43
|
nprocstot = nodes.to_i * ppn.to_i
|
@@ -49,8 +49,8 @@ EOF
|
|
49
49
|
if ((prefix = ENV['CODE_RUNNER_LAUNCHER']).size > 0 rescue false)
|
50
50
|
launch_id = "#{Time.now.to_i}#{$$}"
|
51
51
|
fname = ENV['HOME'] + "/.coderunner_to_launch_#{prefix}/#{launch_id}"
|
52
|
-
File.open(fname + '.start', 'w'){|file| file.
|
53
|
-
sleep
|
52
|
+
File.open(fname + '.start', 'w'){|file| file.print "cd #{Dir.pwd};", run_command, "\n"}
|
53
|
+
sleep 2 until FileTest.exist? fname + '.pid'
|
54
54
|
pid = File.read(fname + '.pid').to_i
|
55
55
|
FileUtils.rm fname + '.pid'
|
56
56
|
return pid
|
@@ -115,16 +115,30 @@ EOF
|
|
115
115
|
end
|
116
116
|
|
117
117
|
def error_file
|
118
|
-
|
118
|
+
if (ENV['CODE_RUNNER_LAUNCHER'].size > 0 rescue false)
|
119
|
+
return "#{executable_name}.#{job_identifier}.e"
|
120
|
+
else
|
121
|
+
return "#{executable_name}.#{job_identifier}.e#@job_no"
|
122
|
+
end
|
119
123
|
end
|
120
124
|
|
121
125
|
def output_file
|
122
|
-
|
126
|
+
if (ENV['CODE_RUNNER_LAUNCHER'].size > 0 rescue false)
|
127
|
+
return "#{executable_name}.#{job_identifier}.o"
|
128
|
+
else
|
129
|
+
return "#{executable_name}.#{job_identifier}.o#@job_no"
|
130
|
+
end
|
123
131
|
end
|
124
132
|
|
125
133
|
def get_run_status(job_no, current_status)
|
126
134
|
if ((prefix = ENV['CODE_RUNNER_LAUNCHER']).size > 0 rescue false)
|
127
|
-
|
135
|
+
if current_status =~ Regexp.new(job_no.to_s)
|
136
|
+
@running = true
|
137
|
+
return :Running
|
138
|
+
else
|
139
|
+
@running = false
|
140
|
+
return :Unknown
|
141
|
+
end
|
128
142
|
end
|
129
143
|
line = current_status.split(/\n/).grep(Regexp.new(job_no.to_s))[0]
|
130
144
|
unless line
|
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.
|
4
|
+
version: 0.11.22
|
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-
|
12
|
+
date: 2012-12-30 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: graphkit
|