rbbt-util 5.25.13 → 5.25.14
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/bin/rbbt +9 -0
- data/lib/rbbt/hpc.rb +8 -3
- metadata +1 -1
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA1:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: e5aabac2c8c621d8ee26f59822fdb44044de2150
         | 
| 4 | 
            +
              data.tar.gz: 2bc06d77e9770da322089b495807c7b9478dcd19
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: f99b7a4494a17ef70af8a9cd26fdaa7b835745b6f12d5a90103eab67de9c7621f0694c4a9e067be0d932e906839bb12cf16f99b42d060323460e8b896e02bda4
         | 
| 7 | 
            +
              data.tar.gz: b601014d631449cfd2363461f9aa83f590fc4998ecd14ddc0fb4f21d7b6577e6015c9b33f15e57881dc82d8c7c94d241665723c46246db79c674c105e3aee9b0
         | 
    
        data/bin/rbbt
    CHANGED
    
    | @@ -1,5 +1,11 @@ | |
| 1 1 | 
             
            #!/usr/bin/env ruby
         | 
| 2 2 |  | 
| 3 | 
            +
            class CmdStop < Exception
         | 
| 4 | 
            +
              attr_accessor :exit_status
         | 
| 5 | 
            +
              def initialize(exit_status = 0)
         | 
| 6 | 
            +
                @exit_status = exit_status
         | 
| 7 | 
            +
              end
         | 
| 8 | 
            +
            end
         | 
| 3 9 | 
             
            dev_dir = nil
         | 
| 4 10 | 
             
            if _i = ARGV.index("--dev")
         | 
| 5 11 | 
             
              dev_dir = ARGV[_i+1]
         | 
| @@ -248,6 +254,9 @@ rescue ParameterException | |
| 248 254 | 
             
              puts
         | 
| 249 255 | 
             
              exit -1
         | 
| 250 256 | 
             
            rescue SystemExit
         | 
| 257 | 
            +
            rescue CmdStop
         | 
| 258 | 
            +
              exit_status = $!.exit_status
         | 
| 259 | 
            +
              exit exit_status
         | 
| 251 260 | 
             
            rescue Exception
         | 
| 252 261 | 
             
              Log.exception $!
         | 
| 253 262 | 
             
              exit -1
         | 
    
        data/lib/rbbt/hpc.rb
    CHANGED
    
    | @@ -3,6 +3,13 @@ require 'rbbt/util/cmd' | |
| 3 3 |  | 
| 4 4 | 
             
            module Marenostrum
         | 
| 5 5 | 
             
              SERVER='mn1'
         | 
| 6 | 
            +
              class SBATCH < Exception; 
         | 
| 7 | 
            +
                attr_accessor :directory
         | 
| 8 | 
            +
                def initialize(directory)
         | 
| 9 | 
            +
                  @directory = directory
         | 
| 10 | 
            +
                end
         | 
| 11 | 
            +
              end
         | 
| 12 | 
            +
             | 
| 6 13 | 
             
              module SLURM
         | 
| 7 14 |  | 
| 8 15 | 
             
                def self.template(args, options = {})
         | 
| @@ -256,10 +263,8 @@ EOF | |
| 256 263 | 
             
                    if File.exists?(fout)
         | 
| 257 264 | 
             
                      return
         | 
| 258 265 | 
             
                    elsif dry_run
         | 
| 259 | 
            -
                      STDERR.puts Log.color(:magenta, "Prepared work directory: ")
         | 
| 260 | 
            -
                      puts workdir
         | 
| 261 266 | 
             
                      STDERR.puts Log.color(:magenta, "To execute run: sbatch '#{workdir}/command.slurm'")
         | 
| 262 | 
            -
                       | 
| 267 | 
            +
                      raise Marenostrum::SBATCH, workdir
         | 
| 263 268 | 
             
                    else
         | 
| 264 269 | 
             
                      Open.rm fsync
         | 
| 265 270 | 
             
                      Open.rm fexit
         |