coderunner 0.15.8 → 0.15.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/coderunner.gemspec +4 -3
- data/lib/coderunner/system_modules/launcher.rb +31 -0
- data/lib/coderunner/system_modules/slurm.rb +16 -21
- data/lib/coderunner/system_modules/stampede.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b2cb05494a17b78bd708cdfb36475697bc777df5
|
4
|
+
data.tar.gz: e3226dda219e54cfd0428fa994e32e24e228ece4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2351cad7c1d4af1b9a873a9bc71e1c657b0e79caefc11729cde60cc989a9b47aba0f10d828457a89bd392430598e3fb65b6fcf6907c7cc5419abb39ae4f0285a
|
7
|
+
data.tar.gz: d50941367780b23c9c7429ae29277a52cb0f914bf4cd943f635686482c52f2f86629d8c12369d29dbb097cfbd11c8b1a64a50b20c88d6fa70f6f6e82172bb0f6
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.15.
|
1
|
+
0.15.9
|
data/coderunner.gemspec
CHANGED
@@ -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.15.
|
5
|
+
# stub: coderunner 0.15.9 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.15.
|
10
|
+
s.version = "0.15.9"
|
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-04-
|
15
|
+
s.date = "2015-04-08"
|
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"]
|
@@ -63,6 +63,7 @@ Gem::Specification.new do |s|
|
|
63
63
|
"lib/coderunner/system_modules/hopper.rb",
|
64
64
|
"lib/coderunner/system_modules/iridis.rb",
|
65
65
|
"lib/coderunner/system_modules/juropa.rb",
|
66
|
+
"lib/coderunner/system_modules/launcher.rb",
|
66
67
|
"lib/coderunner/system_modules/load_leveler.rb",
|
67
68
|
"lib/coderunner/system_modules/loki.rb",
|
68
69
|
"lib/coderunner/system_modules/macosx.rb",
|
@@ -0,0 +1,31 @@
|
|
1
|
+
class CodeRunner
|
2
|
+
|
3
|
+
# A module containing methods for submitting runs using the CodeRunner
|
4
|
+
# launcher. Typically this would be used on a home Linux system or in
|
5
|
+
# an interactive session on a supercomputer.
|
6
|
+
module Launcher
|
7
|
+
def launcher_prefix
|
8
|
+
ENV['CODE_RUNNER_LAUNCHER']
|
9
|
+
end
|
10
|
+
def use_launcher
|
11
|
+
launcher_prefix and launcher_prefix.size > 0
|
12
|
+
end
|
13
|
+
def queue_status_launcher
|
14
|
+
%x[cat #{ENV['HOME']}/.coderunner_to_launch_#{prefix}/queue_status.txt] +
|
15
|
+
%x[cat #{ENV['HOME']}/.coderunner_to_launch_#{prefix}/queue_status2.txt]
|
16
|
+
end
|
17
|
+
def execute_launcher
|
18
|
+
launch_id = "#{Time.now.to_i}#{$$}"
|
19
|
+
fname = ENV['HOME'] + "/.coderunner_to_launch_#{prefix}/#{launch_id}"
|
20
|
+
File.open(fname + '.start', 'w'){|file| file.puts "cd #{Dir.pwd};#{run_command}"}
|
21
|
+
sleep 1 until FileTest.exist? fname + '.pid'
|
22
|
+
pid = File.read(fname + '.pid').to_i
|
23
|
+
FileUtils.rm fname + '.pid'
|
24
|
+
return pid
|
25
|
+
end
|
26
|
+
def cancel_job_launcher
|
27
|
+
fname = ENV['HOME'] + "/.coderunner_to_launch_#{prefix}/#{$$}.stop"
|
28
|
+
File.open(fname, 'w'){|file| file.puts "\n"}
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -1,20 +1,22 @@
|
|
1
1
|
class CodeRunner
|
2
|
-
|
3
|
-
|
2
|
+
require SCRIPT_FOLDER + '/system_modules/launcher.rb'
|
3
|
+
# A module to let CodeRunner run using the SLURM queue system,
|
4
|
+
# used on certain HPC systems.
|
4
5
|
module Slurm
|
6
|
+
include Launcher
|
5
7
|
|
6
8
|
def queue_status
|
7
|
-
if
|
8
|
-
|
9
|
-
%x[cat #{ENV['HOME']}/.coderunner_to_launch_#{prefix}/queue_status2.txt]
|
9
|
+
if use_launcher
|
10
|
+
queue_status_launcher
|
10
11
|
else
|
11
|
-
|
12
|
+
#%x[squeue | grep #{ENV['USER'][0..7]}]
|
13
|
+
%x[squeue -u $USER]
|
12
14
|
end
|
13
15
|
end
|
14
16
|
|
15
17
|
def run_command
|
16
18
|
# "qsub #{batch_script_file}"
|
17
|
-
if
|
19
|
+
if use_launcher
|
18
20
|
return %[mpiexec -np #{@nprocs} #{executable_location}/#{executable_name} #{parameter_string} > #{output_file} 2> #{error_file}]
|
19
21
|
else
|
20
22
|
"#@preamble #{mpi_prog} #{executable_location}/#{executable_name} #{parameter_string}"
|
@@ -27,17 +29,11 @@ module Slurm
|
|
27
29
|
end
|
28
30
|
|
29
31
|
def execute
|
30
|
-
if
|
31
|
-
|
32
|
-
fname = ENV['HOME'] + "/.coderunner_to_launch_#{prefix}/#{launch_id}"
|
33
|
-
File.open(fname + '.start', 'w'){|file| file.puts "cd #{Dir.pwd};#{run_command}"}
|
34
|
-
sleep 1 until FileTest.exist? fname + '.pid'
|
35
|
-
pid = File.read(fname + '.pid').to_i
|
36
|
-
FileUtils.rm fname + '.pid'
|
37
|
-
return pid
|
32
|
+
if use_launcher
|
33
|
+
return execute_launcher
|
38
34
|
else
|
39
35
|
File.open(batch_script_file, 'w'){|file| file.puts batch_script + run_command + "\n"}
|
40
|
-
|
36
|
+
_pid = %x[sbatch #{batch_script_file}].to_i
|
41
37
|
return nil
|
42
38
|
end
|
43
39
|
end
|
@@ -87,9 +83,8 @@ EOF
|
|
87
83
|
end
|
88
84
|
|
89
85
|
def cancel_job
|
90
|
-
if
|
91
|
-
|
92
|
-
File.open(fname, 'w'){|file| file.puts "\n"}
|
86
|
+
if use_launcher
|
87
|
+
cancel_job_launcher
|
93
88
|
else
|
94
89
|
`scancel #{@job_no}`
|
95
90
|
end
|
@@ -104,7 +99,7 @@ EOF
|
|
104
99
|
end
|
105
100
|
|
106
101
|
def get_run_status(job_no, current_status)
|
107
|
-
if
|
102
|
+
if use_launcher
|
108
103
|
return :Unknown
|
109
104
|
end
|
110
105
|
line = current_status.split(/\n/).grep(Regexp.new(job_no.to_s))[0]
|
@@ -126,5 +121,5 @@ def get_run_status(job_no, current_status)
|
|
126
121
|
end
|
127
122
|
end
|
128
123
|
|
129
|
-
|
124
|
+
end
|
130
125
|
end
|
@@ -12,7 +12,7 @@ class CodeRunner
|
|
12
12
|
def run_command
|
13
13
|
# "qsub #{batch_script_file}"
|
14
14
|
if (ENV['CODE_RUNNER_LAUNCHER'].size > 0 rescue false)
|
15
|
-
return %[
|
15
|
+
return %[ibrun -n #{@nprocs} -o 0 #{executable_location}/#{executable_name} #{parameter_string} > #{output_file} 2> #{error_file}]
|
16
16
|
else
|
17
17
|
"ibrun #{executable_location}/#{executable_name} #{parameter_string}"
|
18
18
|
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.15.
|
4
|
+
version: 0.15.9
|
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-04-
|
11
|
+
date: 2015-04-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: graphkit
|
@@ -206,6 +206,7 @@ files:
|
|
206
206
|
- lib/coderunner/system_modules/hopper.rb
|
207
207
|
- lib/coderunner/system_modules/iridis.rb
|
208
208
|
- lib/coderunner/system_modules/juropa.rb
|
209
|
+
- lib/coderunner/system_modules/launcher.rb
|
209
210
|
- lib/coderunner/system_modules/load_leveler.rb
|
210
211
|
- lib/coderunner/system_modules/loki.rb
|
211
212
|
- lib/coderunner/system_modules/macosx.rb
|