trinitycrmod 0.3.4 → 0.3.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/VERSION +1 -1
- data/lib/trinitycrmod/actual_parameter_values.rb +18 -0
- data/lib/trinitycrmod/check_parameters.rb +27 -0
- data/lib/trinitycrmod/trinity.rb +24 -13
- data/trinitycrmod.gemspec +8 -6
- metadata +6 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 45addc2aec59dee48597a236e7badca79c0ff97d
|
4
|
+
data.tar.gz: c5754e7e66463e83b3a5ed3e3697bff877e85ffb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eee87a5a162a34d23d9195c1b2279362a6e6d56ae1a54ad034a306080fa9ceab4fabd47b5c18705ac7198d7a45ff776a97c658c9424e9a7a55f0911dcc995df4
|
7
|
+
data.tar.gz: 157219eb32d5697710a2b8d8555e8deeeeac6a65cd8a4949f21099c2a8b9a6c68fd3319319314153997f7e3cf265134a61f6f700e7c95f68d34dfe932133f3bd
|
data/Gemfile
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.3.
|
1
|
+
0.3.5
|
@@ -0,0 +1,18 @@
|
|
1
|
+
|
2
|
+
class CodeRunner::Trinity
|
3
|
+
# Functions to return the values of parameters if they are not set in CodeRunner.
|
4
|
+
# These must be manually kept in sync with Trinity... let's keep their number down
|
5
|
+
# to a minimum
|
6
|
+
module ActualParameterValues
|
7
|
+
def dflx_stencil_actual
|
8
|
+
@dflx_stencil or 2
|
9
|
+
end
|
10
|
+
def evolve_grads_only_actual
|
11
|
+
@evolve_grads_only or ".true."
|
12
|
+
end
|
13
|
+
def fork_flag_actual
|
14
|
+
@fork_flag or ".true."
|
15
|
+
end
|
16
|
+
end
|
17
|
+
include ActualParameterValues
|
18
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
|
2
|
+
class CodeRunner::Trinity
|
3
|
+
def check_parameters
|
4
|
+
|
5
|
+
check_geometery
|
6
|
+
check_parallelisation
|
7
|
+
check_flux_option
|
8
|
+
|
9
|
+
end
|
10
|
+
|
11
|
+
def check_geometery
|
12
|
+
error( "Can't find geo_file #@geo_file (the path of geo file should be either absolute or set relative to the run folder #@directory). If you are not using a geometry file for this run please unset the parameter geo_file.") if @geo_file and not FileTest.exist? @geo_file
|
13
|
+
end
|
14
|
+
|
15
|
+
def check_parallelisation
|
16
|
+
error("nrad must be explicitly specified") unless @nrad
|
17
|
+
error("Number of jobs: #{n_flux_tubes} must evenly divide the number of processors: #{actual_number_of_processors} when fork_flag is .true.") if fork_flag_actual.fortran_true? and not actual_number_of_processors%n_flux_tubes == 0
|
18
|
+
|
19
|
+
end
|
20
|
+
|
21
|
+
def check_flux_option
|
22
|
+
if @flux_option == "gs2"
|
23
|
+
error("subfolders must be .true. ") unless @subfolders and @subfolders.fortran_true?
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
data/lib/trinitycrmod/trinity.rb
CHANGED
@@ -18,6 +18,8 @@ class CodeRunner
|
|
18
18
|
require 'trinitycrmod/output_files'
|
19
19
|
require 'trinitycrmod/graphs'
|
20
20
|
require 'trinitycrmod/trinity_gs2'
|
21
|
+
require 'trinitycrmod/check_parameters'
|
22
|
+
require 'trinitycrmod/actual_parameter_values'
|
21
23
|
|
22
24
|
# Setup gs2 in case people are using it
|
23
25
|
CodeRunner.setup_run_class('gs2')
|
@@ -84,30 +86,39 @@ class CodeRunner
|
|
84
86
|
# This is a hook which gets called just before submitting a simulation. It sets up the folder and generates any necessary input files.
|
85
87
|
def generate_input_file
|
86
88
|
@run_name += "_t"
|
89
|
+
check_parameters
|
87
90
|
write_input_file
|
88
91
|
generate_gs2_input_files if @flux_option == "gs2"
|
89
92
|
end
|
90
93
|
|
94
|
+
|
91
95
|
# The number of separate flux tube results needed for the jacobian
|
92
96
|
def n_flux_tubes
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
97
|
+
d1 = dflx_stencil_actual - 1
|
98
|
+
ngrads =d1 * case @grad_option
|
99
|
+
when "tigrad", "ngrad", "lgrad"
|
100
|
+
1
|
101
|
+
when "tgrads"
|
102
|
+
2
|
103
|
+
when "ltgrads", "ntgrads"
|
104
|
+
3
|
105
|
+
when "all"
|
106
|
+
4
|
107
|
+
else
|
108
|
+
raise "unknown grad_option: #@grad_option"
|
109
|
+
end
|
110
|
+
if evolve_grads_only_actual.fortran_true?
|
111
|
+
njac = ngrads + 1
|
112
|
+
else
|
113
|
+
njac = 2*ngrads+1
|
114
|
+
end
|
115
|
+
#p 'nraaad', @nrad
|
116
|
+
(@nrad-1) * njac
|
105
117
|
end
|
106
118
|
# Writes the gs2 input files, creating separate subfolders
|
107
119
|
# for them if @subfolders is .true.
|
108
120
|
def generate_gs2_input_files
|
109
121
|
# At the moment we must use subfolders
|
110
|
-
raise "subfolders must be .true. " unless @subfolders and @subfolders.fortran_true?
|
111
122
|
for i in 0...n_flux_tubes
|
112
123
|
#gs2run = gs2_run(:base).dup
|
113
124
|
#gs2_run(i).instance_variables.each do |var|
|
data/trinitycrmod.gemspec
CHANGED
@@ -2,16 +2,16 @@
|
|
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: trinitycrmod 0.3.
|
5
|
+
# stub: trinitycrmod 0.3.5 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "trinitycrmod"
|
9
|
-
s.version = "0.3.
|
9
|
+
s.version = "0.3.5"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
12
|
s.require_paths = ["lib"]
|
13
13
|
s.authors = ["Edmund Highcock"]
|
14
|
-
s.date = "2014-02-
|
14
|
+
s.date = "2014-02-06"
|
15
15
|
s.description = "This module allows Trinity, the Multiscale Gyrokinetic Turbulent Transport solver for Fusion Reactors, to harness the power of CodeRunner, a framework for the automated running and analysis of simulations."
|
16
16
|
s.email = "edmundhighcock@sourceforge.net"
|
17
17
|
s.extra_rdoc_files = [
|
@@ -26,6 +26,8 @@ Gem::Specification.new do |s|
|
|
26
26
|
"Rakefile",
|
27
27
|
"VERSION",
|
28
28
|
"lib/trinitycrmod.rb",
|
29
|
+
"lib/trinitycrmod/actual_parameter_values.rb",
|
30
|
+
"lib/trinitycrmod/check_parameters.rb",
|
29
31
|
"lib/trinitycrmod/deleted_variables.rb",
|
30
32
|
"lib/trinitycrmod/graphs.rb",
|
31
33
|
"lib/trinitycrmod/namelists.rb",
|
@@ -45,7 +47,7 @@ Gem::Specification.new do |s|
|
|
45
47
|
s.specification_version = 4
|
46
48
|
|
47
49
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
48
|
-
s.add_runtime_dependency(%q<coderunner>, [">= 0.14.
|
50
|
+
s.add_runtime_dependency(%q<coderunner>, [">= 0.14.2"])
|
49
51
|
s.add_runtime_dependency(%q<text-data-tools>, [">= 1.1.3"])
|
50
52
|
s.add_runtime_dependency(%q<gs2crmod>, [">= 0.11.10"])
|
51
53
|
s.add_development_dependency(%q<shoulda>, [">= 0"])
|
@@ -53,7 +55,7 @@ Gem::Specification.new do |s|
|
|
53
55
|
s.add_development_dependency(%q<bundler>, ["> 1.0.0"])
|
54
56
|
s.add_development_dependency(%q<jeweler>, [">= 2.0.0"])
|
55
57
|
else
|
56
|
-
s.add_dependency(%q<coderunner>, [">= 0.14.
|
58
|
+
s.add_dependency(%q<coderunner>, [">= 0.14.2"])
|
57
59
|
s.add_dependency(%q<text-data-tools>, [">= 1.1.3"])
|
58
60
|
s.add_dependency(%q<gs2crmod>, [">= 0.11.10"])
|
59
61
|
s.add_dependency(%q<shoulda>, [">= 0"])
|
@@ -62,7 +64,7 @@ Gem::Specification.new do |s|
|
|
62
64
|
s.add_dependency(%q<jeweler>, [">= 2.0.0"])
|
63
65
|
end
|
64
66
|
else
|
65
|
-
s.add_dependency(%q<coderunner>, [">= 0.14.
|
67
|
+
s.add_dependency(%q<coderunner>, [">= 0.14.2"])
|
66
68
|
s.add_dependency(%q<text-data-tools>, [">= 1.1.3"])
|
67
69
|
s.add_dependency(%q<gs2crmod>, [">= 0.11.10"])
|
68
70
|
s.add_dependency(%q<shoulda>, [">= 0"])
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: trinitycrmod
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Edmund Highcock
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-02-
|
11
|
+
date: 2014-02-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: coderunner
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.14.
|
19
|
+
version: 0.14.2
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.14.
|
26
|
+
version: 0.14.2
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: text-data-tools
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -125,6 +125,8 @@ files:
|
|
125
125
|
- Rakefile
|
126
126
|
- VERSION
|
127
127
|
- lib/trinitycrmod.rb
|
128
|
+
- lib/trinitycrmod/actual_parameter_values.rb
|
129
|
+
- lib/trinitycrmod/check_parameters.rb
|
128
130
|
- lib/trinitycrmod/deleted_variables.rb
|
129
131
|
- lib/trinitycrmod/graphs.rb
|
130
132
|
- lib/trinitycrmod/namelists.rb
|