qtools 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a24f89187ce4a9fa8cb311cb67124bf5db0b23e7
4
- data.tar.gz: 9c45dd74946bd5f309d597c74ede078be9c07e0a
3
+ metadata.gz: ff64b4d0551d64bc0271ada2001d0d293cb70b0c
4
+ data.tar.gz: 295eb6942865985a0cbeac0d1756fec46329eb33
5
5
  SHA512:
6
- metadata.gz: 2332ff59ecc9f734fd68ed9d96b6d0d1dd5f27029a51a4bd9fde3a8b81ac9980be9ff2e7fd2eed6a72c6673c154e7a833e0360b25b2f94aca1dcaf0b55ce5679
7
- data.tar.gz: 4de88930e6b3db1800fa16aa403a683834ff1b4e672f2f67319b58dbc7109f19dc8f847dc6894f176f867811d8f335cd7c4e77ae30c6e737c70022bf9ba41c8a
6
+ metadata.gz: cbb6bb21edf9c6becead7fe74ad01df9288e6fa6c72208238181ff405510d30f2585a25e271c7821a6d0432ff4f31e452ee12259801866e49bad9ef375b81f5b
7
+ data.tar.gz: 8507473670fcb4405637c42da0656537711b019130c42f83436fc62ec705beddc3394f5cd89c33015a6a9694a56e77b4469ad84ec47615cb42918005af7c61c0
data/README.md CHANGED
@@ -15,7 +15,8 @@ Install `qtools` using `gem`:
15
15
  - `qclean` to remove `.e[0-9]*` and `.o[0-9]*` files in the current directory
16
16
  - `qwatch` to see the running jobs for the current user
17
17
  - `qcount` to see the number of running jobs for the current user
18
- - `qnode` to see the free nodes
18
+ - `qnode` to list the free nodes
19
+ - `qundo` to stop the last submitted job for the current user
19
20
 
20
21
  ### qqsub
21
22
 
@@ -61,6 +62,14 @@ Usage:
61
62
 
62
63
  The command above will print the list of free nodes sorted by their `LOAD`. Use `qnode -m` to sort the list of free nodes by memory available and `qnode -c` to sort the list by the number of free cores.
63
64
 
65
+ ### qundo
66
+
67
+ Usage:
68
+
69
+ $ qundo
70
+
71
+ The command above will try to run `qdel` for the last job submitted.
72
+
64
73
  ## Contributing
65
74
 
66
75
  Bug reports and pull requests are welcome on [GitHub](https://github.com/kerkomen/qtools).
@@ -0,0 +1,22 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'qtools'
4
+
5
+ last_job = `qstat -u $USER | tail -n 1`
6
+ last_job_id = `qstat -u $USER | tail -n 1 | sed -rn 's/(^[0-9]*).*/\1/p'`
7
+
8
+ unless last_job.empty?
9
+ puts "-- The following job will be stopped:"
10
+ puts last_job
11
+ puts "-- Continue? [y/n]"
12
+
13
+ answer = gets.strip.downcase
14
+ if answer == 'y' or answer == 'yes'
15
+ `qdel #{last_job_id}`
16
+ puts "-- Ok, master. The job #{last_job_id} was stopped."
17
+ else
18
+ puts "-- Ok, master. No means no."
19
+ end
20
+ else
21
+ puts "-- No jobs of yours are currently running."
22
+ end
@@ -4,8 +4,11 @@ help_string = <<-HELP
4
4
 
5
5
  -- qtools:
6
6
  - qqsub to submit a script or a compiled executable
7
- - qwatch to see the running jobs for the current user
8
7
  - qclean to remove .e* and .o* run files in the current directory
8
+ - qwatch to see the running jobs for the current user
9
+ - qcount to see the number of running jobs for the current user
10
+ - qnode to list the free nodes
11
+ - qundo to stop the last job for the current user
9
12
 
10
13
  HELP
11
14
 
@@ -1,3 +1,3 @@
1
1
  module Qtools
2
- VERSION = "0.2.0"
2
+ VERSION = "0.3.0"
3
3
  end
@@ -23,9 +23,9 @@ Gem::Specification.new do |spec|
23
23
  end
24
24
 
25
25
  # spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
26
- spec.files = %w{ .gitignore .travis.yml Gemfile LICENSE.txt README.md Rakefile bin/console bin/qclean bin/qqsub bin/qwatch bin/qcount bin/qnode bin/setup lib/qtools.rb lib/qtools/version.rb qtools.gemspec}
26
+ spec.files = %w{ .gitignore .travis.yml Gemfile LICENSE.txt README.md Rakefile bin/console bin/qclean bin/qqsub bin/qwatch bin/qcount bin/qnode bin/qundo bin/setup lib/qtools.rb lib/qtools/version.rb qtools.gemspec}
27
27
  spec.bindir = "bin"
28
- spec.executables = ["qwatch", "qclean", "qqsub", "qcount", "qnode"]
28
+ spec.executables = ["qwatch", "qclean", "qqsub", "qcount", "qnode", "qundo"]
29
29
  spec.require_paths = ["lib"]
30
30
 
31
31
  spec.add_development_dependency "bundler", "~> 1.10"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: qtools
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel
@@ -47,6 +47,7 @@ executables:
47
47
  - qqsub
48
48
  - qcount
49
49
  - qnode
50
+ - qundo
50
51
  extensions: []
51
52
  extra_rdoc_files: []
52
53
  files:
@@ -61,6 +62,7 @@ files:
61
62
  - bin/qcount
62
63
  - bin/qnode
63
64
  - bin/qqsub
65
+ - bin/qundo
64
66
  - bin/qwatch
65
67
  - bin/setup
66
68
  - lib/qtools.rb