comana 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGES +52 -19
- data/Gemfile +1 -0
- data/README.rdoc +6 -1
- data/VERSION +1 -1
- data/bin/genqsub +38 -30
- data/bin/scpall +1 -1
- data/comana.gemspec +19 -15
- data/example/dot.clustersetting +24 -9
- data/lib/comana/clustersetting.rb +10 -0
- data/lib/comana/computationmanager.rb +134 -10
- data/lib/comana/gridengine.rb +173 -0
- data/lib/comana/hostinspector.rb +5 -59
- data/lib/comana.rb +4 -7
- data/test/gridengine/qconfsql.dat +13 -0
- data/test/gridengine/qstatf0.xml +1275 -0
- data/test/gridengine/qstatf1.xml +39 -0
- data/test/gridengine/qstatq0.xml +247 -0
- data/test/gridengine/qstatq1.xml +37 -0
- data/test/gridengine/qstatu0.xml +437 -0
- data/test/gridengine/qstatu1.xml +47 -0
- data/test/hostselector/dot.clustersetting +15 -0
- data/test/test_clustersetting.rb +20 -23
- data/test/test_computationmanager.rb +49 -15
- data/test/test_gridengine.rb +198 -0
- data/test/test_hostinspector.rb +11 -29
- data/test/test_hostselector.rb +2 -13
- metadata +27 -14
- data/bin/machinestatus +0 -192
- data/bin/queueinfo +0 -28
- data/lib/comana/gridenginescript.rb +0 -68
- data/lib/comana/queuemanager.rb +0 -34
- data/lib/comana/queuesubmitter.rb +0 -156
- data/memo.txt +0 -34
- data/test/test_gridenginescript.rb +0 -16
- data/test/test_queuemanager.rb +0 -19
- data/test/test_queuesubmitter.rb +0 -214
@@ -3,13 +3,11 @@
|
|
3
3
|
|
4
4
|
require "fileutils"
|
5
5
|
require "helper"
|
6
|
-
|
7
|
-
#require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
|
6
|
+
require "pp"
|
8
7
|
|
9
8
|
NOW = Time.now
|
10
9
|
|
11
10
|
class Comana::ComputationManager
|
12
|
-
#public :latest_modified_time, :started?
|
13
11
|
public :started?
|
14
12
|
end
|
15
13
|
|
@@ -22,12 +20,10 @@ class TC_ComputationManager < Test::Unit::TestCase
|
|
22
20
|
def finished? ; false ; end
|
23
21
|
end
|
24
22
|
|
25
|
-
#describe Comana::ComputationManager, "with output, without lock" do
|
26
23
|
class CalcStarted < Comana::ComputationManager
|
27
24
|
def finished? ; false ; end
|
28
25
|
end
|
29
26
|
|
30
|
-
#describe Comana::ComputationManager, "terminated" do
|
31
27
|
class CalcTerminated < Comana::ComputationManager
|
32
28
|
def finished? ; false ; end
|
33
29
|
def initialize(dir)
|
@@ -37,12 +33,10 @@ class TC_ComputationManager < Test::Unit::TestCase
|
|
37
33
|
end
|
38
34
|
end
|
39
35
|
|
40
|
-
#describe Comana::ComputationManager, "finished" do
|
41
36
|
class CalcFinished < Comana::ComputationManager
|
42
37
|
def finished? ; true ; end
|
43
38
|
end
|
44
39
|
|
45
|
-
#describe Comana::ComputationManager, "cannot execute" do
|
46
40
|
class CalcNotExecutable < Comana::ComputationManager
|
47
41
|
def calculate
|
48
42
|
end_status = system "" # notExistCommand
|
@@ -54,14 +48,10 @@ class TC_ComputationManager < Test::Unit::TestCase
|
|
54
48
|
end
|
55
49
|
|
56
50
|
def prepare_next
|
57
|
-
#return false
|
58
51
|
raise
|
59
52
|
end
|
60
53
|
end
|
61
54
|
|
62
|
-
|
63
|
-
|
64
|
-
|
65
55
|
def setup
|
66
56
|
calc_dir = "test/not_started"
|
67
57
|
@calc00 = CalcYet.new(calc_dir)
|
@@ -110,22 +100,66 @@ class TC_ComputationManager < Test::Unit::TestCase
|
|
110
100
|
end
|
111
101
|
|
112
102
|
def test_latest_modified_time
|
113
|
-
#it "should return latest modified time" do
|
114
103
|
assert_equal(NOW - 1000, @calc00.latest_modified_time)
|
115
104
|
end
|
116
105
|
|
117
106
|
def test_started?
|
118
|
-
#it "should return false without lock." do
|
119
107
|
assert_not_nil(@calc00.started?)
|
120
108
|
assert_equal(false, @calc00.started?)
|
121
109
|
|
122
|
-
#it "should return true with lock." do
|
123
110
|
assert_equal(false, @calc00.started?)
|
124
111
|
end
|
125
112
|
|
126
113
|
def test_start
|
127
|
-
#it "should raise error" do
|
128
114
|
assert_raise(Comana::ComputationManager::ExecuteError){ @calc_not_exe.start}
|
129
115
|
end
|
116
|
+
|
117
|
+
def test_effective_queue
|
118
|
+
## 空きホストがあるときは benchmarks の短い方
|
119
|
+
queues = ['A.q', 'B.q']
|
120
|
+
jobs = {'A.q' => 1, 'B.q' => 0}
|
121
|
+
hosts = {'A.q' => 2, 'B.q' => 2}
|
122
|
+
benchmarks = {'A.q' => 1.0, 'B.q' => 2.0}
|
123
|
+
r = Comana::ComputationManager.effective_queue(queues, jobs, hosts, benchmarks)
|
124
|
+
c = 'A.q'
|
125
|
+
assert_equal(c, r)
|
126
|
+
|
127
|
+
## 空きホストがあるなかで選ぶ。
|
128
|
+
queues = ['A.q', 'B.q']
|
129
|
+
jobs = {'A.q' => 2, 'B.q' => 0}
|
130
|
+
hosts = {'A.q' => 2, 'B.q' => 2}
|
131
|
+
benchmarks = {'A.q' => 1.0, 'B.q' => 2.0}
|
132
|
+
r = Comana::ComputationManager.effective_queue(queues, jobs, hosts, benchmarks)
|
133
|
+
c = 'B.q'
|
134
|
+
assert_equal(c, r)
|
135
|
+
|
136
|
+
## 全てのホストが埋まっていたら、見込み時間の早いもので。
|
137
|
+
queues = ['A.q', 'B.q']
|
138
|
+
jobs = {'A.q' => 2, 'B.q' => 2}
|
139
|
+
hosts = {'A.q' => 2, 'B.q' => 2}
|
140
|
+
benchmarks = {'A.q' => 1.0, 'B.q' => 2.0}
|
141
|
+
r = Comana::ComputationManager.effective_queue(queues, jobs, hosts, benchmarks)
|
142
|
+
c = 'A.q'
|
143
|
+
assert_equal(c, r)
|
144
|
+
|
145
|
+
## 全てのホストが埋まっていたら、見込み時間の早いもので。
|
146
|
+
queues = ['A.q', 'B.q']
|
147
|
+
jobs = {'A.q' => 99, 'B.q' => 2}
|
148
|
+
hosts = {'A.q' => 2, 'B.q' => 2}
|
149
|
+
benchmarks = {'A.q' => 1.0, 'B.q' => 2.0}
|
150
|
+
r = Comana::ComputationManager.effective_queue(queues, jobs, hosts, benchmarks)
|
151
|
+
c = 'B.q'
|
152
|
+
assert_equal(c, r)
|
153
|
+
end
|
154
|
+
|
155
|
+
def test_guess_end_time
|
156
|
+
assert_equal(1.0, Comana::ComputationManager.guess_end_time(0, 1, 1.0))
|
157
|
+
assert_equal(1.0, Comana::ComputationManager.guess_end_time(1, 2, 1.0))
|
158
|
+
assert_equal(2.0, Comana::ComputationManager.guess_end_time(1, 1, 1.0))
|
159
|
+
assert_equal(3.0, Comana::ComputationManager.guess_end_time(2, 2, 2.0))
|
160
|
+
assert_equal(4.5, Comana::ComputationManager.guess_end_time(8, 4, 2.0))
|
161
|
+
end
|
162
|
+
|
163
|
+
|
130
164
|
end
|
131
165
|
|
@@ -0,0 +1,198 @@
|
|
1
|
+
#! /usr/bin/env ruby
|
2
|
+
# coding: utf-8
|
3
|
+
|
4
|
+
require "pp"
|
5
|
+
require "helper"
|
6
|
+
|
7
|
+
|
8
|
+
class TC_GridEngine < Test::Unit::TestCase
|
9
|
+
def test_write_qsub_script
|
10
|
+
io = StringIO.new
|
11
|
+
|
12
|
+
Comana::GridEngine.write_qsub_script(
|
13
|
+
q_name: 'Cd.q',
|
14
|
+
pe_name: 'Cd.openmpi',
|
15
|
+
ppn: '4',
|
16
|
+
ld_library_path: '/usr/lib:/usr/local/lib:/opt/intel/mkl/lib/intel64:/opt/intel/lib/intel64:/opt/intel/lib:/opt/openmpi-intel/lib',
|
17
|
+
command: '/opt/openmpi-intel/bin/mpiexec -machinefile machines -np $NSLOTS /opt/bin/vasp5212openmpi',
|
18
|
+
io: io
|
19
|
+
)
|
20
|
+
io.rewind
|
21
|
+
results = io.readlines
|
22
|
+
corrects = [
|
23
|
+
"#! /bin/sh\n",
|
24
|
+
"#$ -S /bin/sh\n",
|
25
|
+
"#$ -cwd\n",
|
26
|
+
"#$ -o stdout\n",
|
27
|
+
"#$ -e stderr\n",
|
28
|
+
"#$ -q Cd.q\n",
|
29
|
+
"#$ -pe Cd.openmpi 4\n",
|
30
|
+
"MACHINE_FILE='machines'\n",
|
31
|
+
"LD_LIBRARY_PATH=/usr/lib:/usr/local/lib:/opt/intel/mkl/lib/intel64:/opt/intel/lib/intel64:/opt/intel/lib:/opt/openmpi-intel/lib\n",
|
32
|
+
"export LD_LIBRARY_PATH\n",
|
33
|
+
"cd $SGE_O_WORKDIR\n",
|
34
|
+
"printenv | sort > printenv.log\n",
|
35
|
+
"cut -d ' ' -f 1,2 $PE_HOSTFILE | sed 's/ / cpu=/' > $MACHINE_FILE\n",
|
36
|
+
"/opt/openmpi-intel/bin/mpiexec -machinefile machines -np $NSLOTS /opt/bin/vasp5212openmpi\n",
|
37
|
+
]
|
38
|
+
assert_equal(corrects, results)
|
39
|
+
|
40
|
+
end
|
41
|
+
|
42
|
+
def test_qstat_f
|
43
|
+
results = Comana::GridEngine.qstat_f(File.open('test/gridengine/qstatf1.xml', 'r'))
|
44
|
+
corrects = [
|
45
|
+
{'name' =>'Ag.q@Ag00.calc.atom',
|
46
|
+
'qtype' =>'BIP',
|
47
|
+
'slots_used' =>4,
|
48
|
+
'slots_resv' =>0,
|
49
|
+
'slots_total' =>4,
|
50
|
+
'arch' =>'lx26-amd64'},
|
51
|
+
|
52
|
+
{'name' =>'Ag.q@Ag01.calc.atom',
|
53
|
+
'qtype' =>'BIP',
|
54
|
+
'slots_used' =>4,
|
55
|
+
'slots_resv' =>0,
|
56
|
+
'slots_total' =>4,
|
57
|
+
'arch' =>'lx26-amd64'},
|
58
|
+
|
59
|
+
{'name' =>'Cd.q@Cd00.calc.atom',
|
60
|
+
'qtype' =>'BIP',
|
61
|
+
'slots_used' =>0,
|
62
|
+
'slots_resv' =>0,
|
63
|
+
'slots_total' =>4,
|
64
|
+
'arch' =>'lx26-amd64'},
|
65
|
+
|
66
|
+
{'name' =>'Cd.q@Cd02.calc.atom',
|
67
|
+
'qtype' =>'BIP',
|
68
|
+
'slots_used' =>0,
|
69
|
+
'slots_resv' =>0,
|
70
|
+
'slots_total' =>4,
|
71
|
+
'state' => 'au',
|
72
|
+
},
|
73
|
+
]
|
74
|
+
assert_equal(corrects, results)
|
75
|
+
end
|
76
|
+
|
77
|
+
def test_queue_alive_hosts
|
78
|
+
results = Comana::GridEngine.queue_alive_hosts(File.open('test/gridengine/qstatf1.xml', 'r'))
|
79
|
+
corrects = {
|
80
|
+
'Ag.q' => ["Ag00.calc.atom", "Ag01.calc.atom"],
|
81
|
+
'Cd.q' => ['Cd00.calc.atom']
|
82
|
+
}
|
83
|
+
assert_equal(corrects, results)
|
84
|
+
end
|
85
|
+
|
86
|
+
def test_queue_alive_num
|
87
|
+
results = Comana::GridEngine.queue_alive_nums(File.open('test/gridengine/qstatf1.xml', 'r'))
|
88
|
+
corrects = {
|
89
|
+
'Ag.q' => 2,
|
90
|
+
'Cd.q' => 1
|
91
|
+
}
|
92
|
+
assert_equal(corrects, results)
|
93
|
+
end
|
94
|
+
|
95
|
+
def test_qstat_u
|
96
|
+
results = Comana::GridEngine.qstat_u(File.open('test/gridengine/qstatu1.xml', 'r'))
|
97
|
+
corrects = [
|
98
|
+
{ 'job_list_state' => "running",
|
99
|
+
'JB_job_number' => 26,
|
100
|
+
'JAT_prio' => 0.75000,
|
101
|
+
'JB_name' => 'vasp-Ag.qsub',
|
102
|
+
'JB_owner' => 'koyama',
|
103
|
+
'state' => 'r',
|
104
|
+
'JAT_start_time' => '2016-02-16T17:53:44',
|
105
|
+
'queue_name'=> 'Ag.q@Ag01.calc.atom',
|
106
|
+
'slots' => 4,
|
107
|
+
}, {'job_list_state' => "running",
|
108
|
+
'JB_job_number' => 46,
|
109
|
+
'JAT_prio' => 0.73443,
|
110
|
+
'JB_name' => 'vasp-Tc.qsub',
|
111
|
+
'JB_owner' => 'koyama',
|
112
|
+
'state' => 'dr',
|
113
|
+
'JAT_start_time' => '2016-02-17T09:31:36',
|
114
|
+
'queue_name'=> 'Tc.q@Tc04.calc.atom',
|
115
|
+
'slots' => 4,
|
116
|
+
}, {'job_list_state' => "running",
|
117
|
+
'JB_job_number' => 283,
|
118
|
+
'JAT_prio' => 0.51059,
|
119
|
+
'JB_name' => 'vasp-Ag.qsub',
|
120
|
+
'JB_owner' => 'koyama',
|
121
|
+
'state' => 'r',
|
122
|
+
'JAT_start_time' => '2016-02-26T18:10:43',
|
123
|
+
'queue_name'=> 'Ag.q@Ag05.calc.atom',
|
124
|
+
'slots' => 4,
|
125
|
+
}, {'job_list_state' => "pending",
|
126
|
+
'JB_job_number' => 468,
|
127
|
+
'JAT_prio' => 0.25000,
|
128
|
+
'JB_name' => 'vasp-Ga.qsub',
|
129
|
+
'JB_owner' => 'ippei',
|
130
|
+
'state' => 'qw',
|
131
|
+
'JB_submission_time' => '2016-03-08T15:43:29',
|
132
|
+
'queue_name'=> '',
|
133
|
+
'slots' => 4,
|
134
|
+
},
|
135
|
+
]
|
136
|
+
assert_equal(corrects, results)
|
137
|
+
end
|
138
|
+
|
139
|
+
def test_queues
|
140
|
+
str = "Ag.q\nGa.q"
|
141
|
+
results = Comana::GridEngine.queues(str)
|
142
|
+
corrects = ['Ag.q', 'Ga.q']
|
143
|
+
assert_equal(corrects, results)
|
144
|
+
end
|
145
|
+
|
146
|
+
def test_queue_jobs
|
147
|
+
io = File.open('test/gridengine/qstatq1.xml', 'r')
|
148
|
+
results = Comana::GridEngine.queue_jobs('Ga.q', io)
|
149
|
+
corrects = [
|
150
|
+
{"job_list_state"=>"running",
|
151
|
+
"JB_job_number"=>557,
|
152
|
+
"JAT_prio"=>0.25,
|
153
|
+
"JB_name"=>"vasp-Ga.qsub",
|
154
|
+
"JB_owner"=>"ippei",
|
155
|
+
"state"=>"r",
|
156
|
+
"JAT_start_time"=>"2016-03-08T16:59:02",
|
157
|
+
"queue_name"=>"Ga.q@Ga00.calc.atom",
|
158
|
+
"slots"=>4},
|
159
|
+
{"job_list_state"=>"running",
|
160
|
+
"JB_job_number"=>563,
|
161
|
+
"JAT_prio"=>0.25,
|
162
|
+
"JB_name"=>"vasp-Ga.qsub",
|
163
|
+
"JB_owner"=>"ippei",
|
164
|
+
"state"=>"r",
|
165
|
+
"JAT_start_time"=>"2016-03-08T16:59:02",
|
166
|
+
"queue_name"=>"Ga.q@Ga01.calc.atom",
|
167
|
+
"slots"=>4},
|
168
|
+
{"job_list_state"=>"pending",
|
169
|
+
"JB_job_number"=>564,
|
170
|
+
"JAT_prio"=>0.25,
|
171
|
+
"JB_name"=>"vasp-Ga.qsub",
|
172
|
+
"JB_owner"=>"ippei",
|
173
|
+
"state"=>"qw",
|
174
|
+
"JB_submission_time"=>"2016-03-08T16:58:13",
|
175
|
+
"queue_name"=>"",
|
176
|
+
"slots"=>4}
|
177
|
+
]
|
178
|
+
assert_equal(corrects, results)
|
179
|
+
end
|
180
|
+
|
181
|
+
def test_guess_end_time
|
182
|
+
assert_equal(1.00, Comana::GridEngine.guess_end_time(nj: 0, nh: 4, bench: 1.0))
|
183
|
+
assert_equal(1.00, Comana::GridEngine.guess_end_time(nj: 1, nh: 4, bench: 1.0))
|
184
|
+
assert_equal(1.00, Comana::GridEngine.guess_end_time(nj: 2, nh: 4, bench: 1.0))
|
185
|
+
assert_equal(1.00, Comana::GridEngine.guess_end_time(nj: 3, nh: 4, bench: 1.0))
|
186
|
+
assert_equal(2.00, Comana::GridEngine.guess_end_time(nj: 4, nh: 4, bench: 1.0))
|
187
|
+
assert_equal(2.25, Comana::GridEngine.guess_end_time(nj: 5, nh: 4, bench: 1.0))
|
188
|
+
assert_equal(2.50, Comana::GridEngine.guess_end_time(nj: 6, nh: 4, bench: 1.0))
|
189
|
+
|
190
|
+
assert_equal(2.00, Comana::GridEngine.guess_end_time(nj: 0, nh: 4, bench: 2.0))
|
191
|
+
assert_equal(2.00, Comana::GridEngine.guess_end_time(nj: 1, nh: 4, bench: 2.0))
|
192
|
+
assert_equal(2.00, Comana::GridEngine.guess_end_time(nj: 2, nh: 4, bench: 2.0))
|
193
|
+
assert_equal(2.00, Comana::GridEngine.guess_end_time(nj: 3, nh: 4, bench: 2.0))
|
194
|
+
assert_equal(4.00, Comana::GridEngine.guess_end_time(nj: 4, nh: 4, bench: 2.0))
|
195
|
+
assert_equal(4.50, Comana::GridEngine.guess_end_time(nj: 5, nh: 4, bench: 2.0))
|
196
|
+
assert_equal(5.00, Comana::GridEngine.guess_end_time(nj: 6, nh: 4, bench: 2.0))
|
197
|
+
end
|
198
|
+
end
|
data/test/test_hostinspector.rb
CHANGED
@@ -2,32 +2,23 @@
|
|
2
2
|
# coding: utf-8
|
3
3
|
|
4
4
|
require "helper"
|
5
|
-
#require "test/unit"
|
6
|
-
#require "pkg/klass.rb"
|
7
|
-
|
8
|
-
|
9
|
-
class Comana::HostInspector
|
10
|
-
CACHE_DIR = "test/hostinspector/var"
|
11
|
-
end
|
12
5
|
|
13
6
|
class TC_HostInspector < Test::Unit::TestCase
|
14
|
-
CACHE_DIR = Comana::HostInspector::CACHE_DIR
|
15
|
-
|
16
7
|
def setup
|
17
|
-
|
18
|
-
|
8
|
+
@cache_dir = "test/hostinspector/var"
|
9
|
+
@h00 = Comana::HostInspector.new("localhost", @cache_dir)
|
10
|
+
@h01 = Comana::HostInspector.new("__not_exist_host__", @cache_dir)
|
19
11
|
end
|
20
12
|
|
21
13
|
def test_update_ping
|
22
|
-
ping_file = "#{
|
23
|
-
#FileUtils.rm_rf "#{CACHE_DIR}/#{@h00.hostname}"
|
14
|
+
ping_file = "#{@cache_dir}/#{@h00.hostname}/ping.yaml"
|
24
15
|
FileUtils.rm ping_file if File.exist?(ping_file)
|
25
16
|
assert_equal(false, File.exist?(ping_file))
|
26
17
|
@h00.update_ping
|
27
18
|
assert_equal(true, File.exist?(ping_file))
|
28
19
|
assert_equal(true, YAML.load_file(ping_file))
|
29
20
|
|
30
|
-
ping_file = "#{
|
21
|
+
ping_file = "#{@cache_dir}/#{@h01.hostname}/ping.yaml"
|
31
22
|
FileUtils.rm ping_file if File.exist?(ping_file)
|
32
23
|
assert_equal(false, File.exist?(ping_file))
|
33
24
|
@h01.update_ping
|
@@ -36,23 +27,16 @@ class TC_HostInspector < Test::Unit::TestCase
|
|
36
27
|
end
|
37
28
|
|
38
29
|
def test_update_cwd
|
39
|
-
cwd_file = "#{
|
30
|
+
cwd_file = "#{@cache_dir}/#{@h00.hostname}/cwd.yaml"
|
40
31
|
FileUtils.rm cwd_file if File.exist?(cwd_file)
|
41
32
|
assert_equal(false, File.exist?(cwd_file))
|
42
33
|
@h00.update_cwd
|
43
34
|
assert_equal(true, File.exist?(cwd_file))
|
44
35
|
assert_equal(Hash, YAML.load_file(cwd_file).class)
|
45
|
-
|
46
|
-
#cwd_file = "#{CACHE_DIR}/#{@h01.hostname}/cwd.yaml"
|
47
|
-
#FileUtils.rm cwd_file if File.exist?(cwd_file)
|
48
|
-
#assert_equal(false, File.exist?(cwd_file))
|
49
|
-
#@h01.update_cwd
|
50
|
-
#assert_equal(true, File.exist?(cwd_file))
|
51
|
-
#assert_equal(Hash, YAML.load_file(cwd_file).class)
|
52
36
|
end
|
53
37
|
|
54
38
|
def test_update_ps
|
55
|
-
ps_file = "#{
|
39
|
+
ps_file = "#{@cache_dir}/#{@h00.hostname}/ps.yaml"
|
56
40
|
FileUtils.rm ps_file if File.exist?(ps_file)
|
57
41
|
assert_equal(false, File.exist?(ps_file))
|
58
42
|
@h00.update_ps
|
@@ -61,7 +45,7 @@ class TC_HostInspector < Test::Unit::TestCase
|
|
61
45
|
end
|
62
46
|
|
63
47
|
def test_update_cpuinfo
|
64
|
-
cpuinfo_file = "#{
|
48
|
+
cpuinfo_file = "#{@cache_dir}/#{@h00.hostname}/cpuinfo.yaml"
|
65
49
|
FileUtils.rm cpuinfo_file if File.exist?(cpuinfo_file)
|
66
50
|
assert_equal(false, File.exist?(cpuinfo_file))
|
67
51
|
@h00.update_cpuinfo
|
@@ -73,7 +57,7 @@ class TC_HostInspector < Test::Unit::TestCase
|
|
73
57
|
end
|
74
58
|
|
75
59
|
def test_update_meminfo
|
76
|
-
meminfo_file = "#{
|
60
|
+
meminfo_file = "#{@cache_dir}/#{@h00.hostname}/meminfo.yaml"
|
77
61
|
FileUtils.rm meminfo_file if File.exist?(meminfo_file)
|
78
62
|
assert_equal(false, File.exist?(meminfo_file))
|
79
63
|
@h00.update_meminfo
|
@@ -90,7 +74,7 @@ class TC_HostInspector < Test::Unit::TestCase
|
|
90
74
|
@h01.update_ping
|
91
75
|
assert_equal(false, @h01.fetch('ping'))
|
92
76
|
|
93
|
-
ping_file = "#{
|
77
|
+
ping_file = "#{@cache_dir}/#{@h00.hostname}/ping.yaml"
|
94
78
|
FileUtils.rm ping_file if File.exist?(ping_file)
|
95
79
|
assert_raise(Comana::HostInspector::NoUpdateFile) do
|
96
80
|
@h00.fetch('ping')
|
@@ -101,10 +85,8 @@ class TC_HostInspector < Test::Unit::TestCase
|
|
101
85
|
|
102
86
|
def test_time_ping
|
103
87
|
time = Time.local(2015, 5, 29, 22, 00, 17)
|
104
|
-
ping_file = "#{
|
105
|
-
#pp File.mtime(ping_file)
|
88
|
+
ping_file = "#{@cache_dir}/#{@h00.hostname}/ping.yaml"
|
106
89
|
File::utime(time, time, ping_file)
|
107
|
-
#pp File.mtime(ping_file)
|
108
90
|
assert_equal(time, File.mtime(ping_file))
|
109
91
|
end
|
110
92
|
|
data/test/test_hostselector.rb
CHANGED
@@ -24,33 +24,22 @@ class TC_HostSelector < Test::Unit::TestCase
|
|
24
24
|
end
|
25
25
|
|
26
26
|
def test_load_file
|
27
|
-
hs = Comana::HostSelector.load_file("
|
27
|
+
hs = Comana::HostSelector.load_file("test/hostselector/dot.clustersetting")
|
28
28
|
assert_equal(Comana::HostSelector, hs.class)
|
29
|
-
#pp hs
|
30
|
-
#assert_equal(["A00", "A01", "B00", "B01", "B02"], hs.select_all)
|
31
29
|
assert_equal({"A"=>["A00", "A01"], "B"=>["B00", "B01", "B02"]}, hs.groups_hosts)
|
32
30
|
end
|
33
31
|
|
34
32
|
def test_select_all
|
35
|
-
#it 'should return all hosts' do
|
36
33
|
assert_equal(["A00", "A01", "B00", "B01", "B02"], @hs00.select_all)
|
37
|
-
|
38
|
-
#it 'should return all hosts without nil' do
|
39
34
|
assert_equal(["A00", "A01", "B00", "B01", "B02"], @hs01.select_all)
|
40
35
|
end
|
41
36
|
|
42
37
|
def test_select_group
|
43
|
-
#it 'should return hosts in GroupA' do
|
44
38
|
assert_equal(["A00", "A01"], @hs00.select_group("GroupA"))
|
45
|
-
|
46
|
-
#it 'should raise Comana::HostSelector::NoEntryError' do
|
47
|
-
assert_raise(Comana::HostSelector::NoEntryError){
|
48
|
-
@hs00.select_group("GroupNil")
|
49
|
-
}
|
39
|
+
assert_raise(Comana::HostSelector::NoEntryError){ @hs00.select_group("GroupNil") }
|
50
40
|
end
|
51
41
|
|
52
42
|
def test_groups
|
53
|
-
#it 'should return all groups' do
|
54
43
|
assert_equal(["GroupA", "GroupB"], @hs00.groups)
|
55
44
|
end
|
56
45
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: comana
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ippei94da
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-03-
|
11
|
+
date: 2016-03-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: test-unit
|
@@ -94,6 +94,20 @@ dependencies:
|
|
94
94
|
- - ">="
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0.1'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: builtinextension
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0.1'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0.1'
|
97
111
|
description: "Comana, COmputation MANAger,\n is a software to provide a framework
|
98
112
|
of\n managing scientific computing.\n Researchers on computing have to check
|
99
113
|
calculation and\n generate new calculation and execute, repeatedly.\n The
|
@@ -102,8 +116,6 @@ email: ippei94da@gmail.com
|
|
102
116
|
executables:
|
103
117
|
- genqsub
|
104
118
|
- hostinfo
|
105
|
-
- machinestatus
|
106
|
-
- queueinfo
|
107
119
|
- scpall
|
108
120
|
- sshall
|
109
121
|
extensions: []
|
@@ -121,8 +133,6 @@ files:
|
|
121
133
|
- VERSION
|
122
134
|
- bin/genqsub
|
123
135
|
- bin/hostinfo
|
124
|
-
- bin/machinestatus
|
125
|
-
- bin/queueinfo
|
126
136
|
- bin/scpall
|
127
137
|
- bin/sshall
|
128
138
|
- comana.gemspec
|
@@ -130,14 +140,19 @@ files:
|
|
130
140
|
- lib/comana.rb
|
131
141
|
- lib/comana/clustersetting.rb
|
132
142
|
- lib/comana/computationmanager.rb
|
133
|
-
- lib/comana/
|
143
|
+
- lib/comana/gridengine.rb
|
134
144
|
- lib/comana/hostinspector.rb
|
135
145
|
- lib/comana/hostselector.rb
|
136
|
-
-
|
137
|
-
-
|
138
|
-
-
|
146
|
+
- test/gridengine/qconfsql.dat
|
147
|
+
- test/gridengine/qstatf0.xml
|
148
|
+
- test/gridengine/qstatf1.xml
|
149
|
+
- test/gridengine/qstatq0.xml
|
150
|
+
- test/gridengine/qstatq1.xml
|
151
|
+
- test/gridengine/qstatu0.xml
|
152
|
+
- test/gridengine/qstatu1.xml
|
139
153
|
- test/helper.rb
|
140
154
|
- test/hostinspector/.gitignore
|
155
|
+
- test/hostselector/dot.clustersetting
|
141
156
|
- test/locked/input_a
|
142
157
|
- test/locked/input_b
|
143
158
|
- test/locked/lock_comana/dummy
|
@@ -160,11 +175,9 @@ files:
|
|
160
175
|
- test/queuesubmitter/unlocked/dummy
|
161
176
|
- test/test_clustersetting.rb
|
162
177
|
- test/test_computationmanager.rb
|
163
|
-
- test/
|
178
|
+
- test/test_gridengine.rb
|
164
179
|
- test/test_hostinspector.rb
|
165
180
|
- test/test_hostselector.rb
|
166
|
-
- test/test_queuemanager.rb
|
167
|
-
- test/test_queuesubmitter.rb
|
168
181
|
homepage: http://github.com/ippei94da/comana
|
169
182
|
licenses:
|
170
183
|
- MIT
|
@@ -185,7 +198,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
185
198
|
version: '0'
|
186
199
|
requirements: []
|
187
200
|
rubyforge_project:
|
188
|
-
rubygems_version: 2.
|
201
|
+
rubygems_version: 2.5.1
|
189
202
|
signing_key:
|
190
203
|
specification_version: 4
|
191
204
|
summary: Manager for scientific computing
|