pbs 2.0.0 → 2.0.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/CHANGELOG.md +6 -0
- data/lib/pbs/batch.rb +42 -10
- data/lib/pbs/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2ad4146d23f9e6cdabb8fd29d0acef07e9ebc931
|
4
|
+
data.tar.gz: 2af9fd377f59eba1a511a4437777d8fc83b9ca52
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1dc0e94fc987178c1b6044206b1e9f1bd288b6448638d57c29aa18762c8dbccacf8f04def9e4ae868d9fd0bff1c9c9dcfc7473a0b9d833fd94dc8dca3c260b00
|
7
|
+
data.tar.gz: e8d0dbf079d8e4512ce5d54dcab71326bb78e7548c0597d6a16622b4e3d28511f203164b4d294bf8a53ea5c2452177b89c92ddcec7e6822e7b66a6ffc550d616
|
data/CHANGELOG.md
CHANGED
data/lib/pbs/batch.rb
CHANGED
@@ -9,23 +9,51 @@ module PBS
|
|
9
9
|
# @return [String] the batch server host
|
10
10
|
attr_reader :host
|
11
11
|
|
12
|
-
# The path to the Torque client installation
|
12
|
+
# The path to the Torque client installation libraries
|
13
13
|
# @example For Torque 5.0.0
|
14
|
-
# my_conn.
|
15
|
-
# @return [Pathname
|
16
|
-
|
14
|
+
# my_conn.lib.to_s #=> "/usr/local/torque/5.0.0/lib"
|
15
|
+
# @return [Pathname] path to torque libraries
|
16
|
+
def lib
|
17
|
+
@lib ||=
|
18
|
+
if @prefix.join('lib').directory?
|
19
|
+
@prefix.join('lib')
|
20
|
+
elsif @prefix.join('lib32').directory?
|
21
|
+
@prefix.join('lib32')
|
22
|
+
elsif @prefix.join('lib64').directory?
|
23
|
+
@prefix.join('lib64')
|
24
|
+
else
|
25
|
+
@prefix
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
# The path to the Torque client installation binaries
|
30
|
+
# @example For Torque 5.0.0
|
31
|
+
# my_conn.bin.to_s #=> "/usr/local/torque/5.0.0/bin"
|
32
|
+
# @return [Pathname] path to torque binaries
|
33
|
+
def bin
|
34
|
+
@bin ||=
|
35
|
+
if @prefix.join('bin').directory?
|
36
|
+
@prefix.join('bin')
|
37
|
+
else
|
38
|
+
@prefix
|
39
|
+
end
|
40
|
+
end
|
17
41
|
|
18
42
|
# @param host [#to_s] the batch server host
|
19
|
-
# @param prefix [#to_s
|
20
|
-
|
43
|
+
# @param prefix [#to_s] path to torque installation
|
44
|
+
# @param lib [#to_s, nil] path to torque installation libraries
|
45
|
+
# @param bin [#to_s, nil] path to torque installation binaries
|
46
|
+
def initialize(host:, prefix: '', lib: nil, bin: nil, **_)
|
21
47
|
@host = host.to_s
|
22
|
-
@prefix = Pathname.new(prefix)
|
48
|
+
@prefix = Pathname.new(prefix)
|
49
|
+
@lib = Pathname.new(lib) if lib
|
50
|
+
@bin = Pathname.new(bin) if bin
|
23
51
|
end
|
24
52
|
|
25
53
|
# Convert object to hash
|
26
54
|
# @return [Hash] the hash describing this object
|
27
55
|
def to_h
|
28
|
-
{host: host,
|
56
|
+
{host: host, lib: lib, bin: bin}
|
29
57
|
end
|
30
58
|
|
31
59
|
# The comparison operator
|
@@ -54,7 +82,7 @@ module PBS
|
|
54
82
|
# @yieldparam cid [Fixnum] connection id from established batch server connection
|
55
83
|
# @yieldreturn the final value of the block
|
56
84
|
def connect(&block)
|
57
|
-
Torque.lib =
|
85
|
+
Torque.lib = lib.join('libtorque.so')
|
58
86
|
cid = Torque.pbs_connect(host)
|
59
87
|
Torque.raise_error(cid.abs) if cid < 0 # raise error if negative connection id
|
60
88
|
begin
|
@@ -326,7 +354,11 @@ module PBS
|
|
326
354
|
end.flatten
|
327
355
|
params << script.to_s
|
328
356
|
|
329
|
-
|
357
|
+
env = {
|
358
|
+
"LD_LIBRARY_PATH" => "#{lib}:#{ENV['LD_LIBRARY_PATH']}"
|
359
|
+
}
|
360
|
+
cmd = bin.join("qsub").to_s
|
361
|
+
o, e, s = Open3.capture3(env, cmd, *params)
|
330
362
|
raise PBS::Error, e unless s.success?
|
331
363
|
o.chomp
|
332
364
|
end
|
data/lib/pbs/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pbs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeremy Nicklas
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-08-
|
11
|
+
date: 2016-08-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ffi
|