comana 0.0.9 → 0.0.10
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.
- data/CHANGES +20 -0
- data/Gemfile +10 -4
- data/Rakefile +26 -9
- data/VERSION +1 -1
- data/bin/machinestatus +189 -0
- data/bin/scpall +64 -0
- data/bin/sshall +58 -0
- data/example/dot.clustersetting +15 -0
- data/lib/comana.rb +12 -1
- data/lib/comana/clustersetting.rb +55 -0
- data/lib/comana/computationmanager.rb +10 -10
- data/lib/comana/hostinspector.rb +4 -0
- data/lib/comana/hostinspector/pbsnodes.rb +51 -0
- data/lib/comana/hostinspector/ping.rb +34 -0
- data/lib/comana/hostselector.rb +45 -0
- data/lib/comana/queuesubmitter.rb +39 -64
- data/memo.txt +2 -0
- data/test/helper.rb +17 -0
- data/{spec → test}/locked/input_a +0 -0
- data/{spec → test}/locked/input_b +0 -0
- data/{spec → test}/locked/lock_comana/dummy +0 -0
- data/{spec → test}/locked_outputted/input_a +0 -0
- data/{spec → test}/locked_outputted/input_b +0 -0
- data/{spec → test}/locked_outputted/lock_comana/dummy +0 -0
- data/{spec → test}/locked_outputted/output +0 -0
- data/{spec/queuesubmitter/locked/lock_queuesubmitter → test/not_executable}/dummy +0 -0
- data/{spec → test}/not_started/input_a +0 -0
- data/{spec → test}/not_started/input_b +0 -0
- data/{spec → test}/outputted/input_a +0 -0
- data/{spec → test}/outputted/input_b +0 -0
- data/{spec → test}/outputted/output +0 -0
- data/test/pbsnodes/Br09.xml +11 -0
- data/test/pbsnodes/Br10.xml +2 -0
- data/test/pbsnodes/Ge00.xml +2 -0
- data/test/pbsnodes/Ge08.xml +1 -0
- data/test/pbsnodes/all.xml +1 -0
- data/{spec/queuesubmitter/unlocked → test/queuesubmitter/locked/lock_queuesubmitter}/dummy +0 -0
- data/test/queuesubmitter/unlocked/dummy +0 -0
- data/test/test_clustersetting.rb +116 -0
- data/test/test_computationmanager.rb +131 -0
- data/test/test_hostinspector_pbsnodes.rb +92 -0
- data/test/test_hostinspector_ping.rb +21 -0
- data/test/test_hostselector.rb +57 -0
- data/test/test_queuesubmitter.rb +214 -0
- metadata +92 -49
- data/comana.gemspec +0 -84
- data/dot.machineinfo +0 -14
- data/lib/comana/machineinfo.rb +0 -44
- data/spec/computationmanager_spec.rb +0 -158
- data/spec/machineinfo +0 -7
- data/spec/machineinfo_spec.rb +0 -52
- data/spec/queuesubmitter_spec.rb +0 -263
- data/spec/spec_helper.rb +0 -12
    
        metadata
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: comana
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0.0. | 
| 4 | 
            +
              version: 0.0.10
         | 
| 5 5 | 
             
              prerelease: 
         | 
| 6 6 | 
             
            platform: ruby
         | 
| 7 7 | 
             
            authors:
         | 
| @@ -9,55 +9,59 @@ authors: | |
| 9 9 | 
             
            autorequire: 
         | 
| 10 10 | 
             
            bindir: bin
         | 
| 11 11 | 
             
            cert_chain: []
         | 
| 12 | 
            -
            date:  | 
| 12 | 
            +
            date: 2014-08-28 00:00:00.000000000 Z
         | 
| 13 13 | 
             
            dependencies:
         | 
| 14 14 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 15 | 
            -
              name:  | 
| 16 | 
            -
              requirement:  | 
| 15 | 
            +
              name: rdoc
         | 
| 16 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 17 17 | 
             
                none: false
         | 
| 18 18 | 
             
                requirements:
         | 
| 19 | 
            -
                - -  | 
| 19 | 
            +
                - - ~>
         | 
| 20 20 | 
             
                  - !ruby/object:Gem::Version
         | 
| 21 | 
            -
                    version:  | 
| 21 | 
            +
                    version: 4.0.1
         | 
| 22 22 | 
             
              type: :development
         | 
| 23 23 | 
             
              prerelease: false
         | 
| 24 | 
            -
              version_requirements:  | 
| 25 | 
            -
            - !ruby/object:Gem::Dependency
         | 
| 26 | 
            -
              name: rdoc
         | 
| 27 | 
            -
              requirement: &72264230 !ruby/object:Gem::Requirement
         | 
| 24 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 28 25 | 
             
                none: false
         | 
| 29 26 | 
             
                requirements:
         | 
| 30 | 
            -
                - -  | 
| 27 | 
            +
                - - ~>
         | 
| 31 28 | 
             
                  - !ruby/object:Gem::Version
         | 
| 32 | 
            -
                    version:  | 
| 33 | 
            -
              type: :development
         | 
| 34 | 
            -
              prerelease: false
         | 
| 35 | 
            -
              version_requirements: *72264230
         | 
| 29 | 
            +
                    version: 4.0.1
         | 
| 36 30 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 37 31 | 
             
              name: bundler
         | 
| 38 | 
            -
              requirement:  | 
| 32 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 39 33 | 
             
                none: false
         | 
| 40 34 | 
             
                requirements:
         | 
| 41 | 
            -
                - -  | 
| 35 | 
            +
                - - ~>
         | 
| 42 36 | 
             
                  - !ruby/object:Gem::Version
         | 
| 43 | 
            -
                    version: 1. | 
| 37 | 
            +
                    version: 1.7.2
         | 
| 44 38 | 
             
              type: :development
         | 
| 45 39 | 
             
              prerelease: false
         | 
| 46 | 
            -
              version_requirements:  | 
| 40 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 41 | 
            +
                none: false
         | 
| 42 | 
            +
                requirements:
         | 
| 43 | 
            +
                - - ~>
         | 
| 44 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 45 | 
            +
                    version: 1.7.2
         | 
| 47 46 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 48 47 | 
             
              name: jeweler
         | 
| 49 | 
            -
              requirement:  | 
| 48 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 50 49 | 
             
                none: false
         | 
| 51 50 | 
             
                requirements:
         | 
| 52 51 | 
             
                - - ! '>='
         | 
| 53 52 | 
             
                  - !ruby/object:Gem::Version
         | 
| 54 | 
            -
                    version:  | 
| 53 | 
            +
                    version: 2.0.1
         | 
| 55 54 | 
             
              type: :development
         | 
| 56 55 | 
             
              prerelease: false
         | 
| 57 | 
            -
              version_requirements:  | 
| 56 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 57 | 
            +
                none: false
         | 
| 58 | 
            +
                requirements:
         | 
| 59 | 
            +
                - - ! '>='
         | 
| 60 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 61 | 
            +
                    version: 2.0.1
         | 
| 58 62 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 59 63 | 
             
              name: simplecov
         | 
| 60 | 
            -
              requirement:  | 
| 64 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 61 65 | 
             
                none: false
         | 
| 62 66 | 
             
                requirements:
         | 
| 63 67 | 
             
                - - ! '>='
         | 
| @@ -65,13 +69,37 @@ dependencies: | |
| 65 69 | 
             
                    version: '0'
         | 
| 66 70 | 
             
              type: :development
         | 
| 67 71 | 
             
              prerelease: false
         | 
| 68 | 
            -
              version_requirements:  | 
| 72 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 73 | 
            +
                none: false
         | 
| 74 | 
            +
                requirements:
         | 
| 75 | 
            +
                - - ! '>='
         | 
| 76 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 77 | 
            +
                    version: '0'
         | 
| 78 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 79 | 
            +
              name: tefil
         | 
| 80 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 81 | 
            +
                none: false
         | 
| 82 | 
            +
                requirements:
         | 
| 83 | 
            +
                - - ! '>='
         | 
| 84 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 85 | 
            +
                    version: 0.0.3
         | 
| 86 | 
            +
              type: :development
         | 
| 87 | 
            +
              prerelease: false
         | 
| 88 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 89 | 
            +
                none: false
         | 
| 90 | 
            +
                requirements:
         | 
| 91 | 
            +
                - - ! '>='
         | 
| 92 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 93 | 
            +
                    version: 0.0.3
         | 
| 69 94 | 
             
            description: ! "Comana, COmputation MANAger,\n    is a software to provide a framework
         | 
| 70 95 | 
             
              of\n    managing scientific computing.\n    Researchers on computing have to check
         | 
| 71 96 | 
             
              calculation and\n    generate new calculation and execute, repeatedly.\n    The
         | 
| 72 97 | 
             
              abstract class that this gem provide would help the work.\n  "
         | 
| 73 98 | 
             
            email: ippei94da@gmail.com
         | 
| 74 | 
            -
            executables: | 
| 99 | 
            +
            executables:
         | 
| 100 | 
            +
            - machinestatus
         | 
| 101 | 
            +
            - scpall
         | 
| 102 | 
            +
            - sshall
         | 
| 75 103 | 
             
            extensions: []
         | 
| 76 104 | 
             
            extra_rdoc_files:
         | 
| 77 105 | 
             
            - LICENSE.txt
         | 
| @@ -79,37 +107,52 @@ extra_rdoc_files: | |
| 79 107 | 
             
            files:
         | 
| 80 108 | 
             
            - .document
         | 
| 81 109 | 
             
            - .rspec
         | 
| 110 | 
            +
            - CHANGES
         | 
| 82 111 | 
             
            - Gemfile
         | 
| 83 112 | 
             
            - LICENSE.txt
         | 
| 84 113 | 
             
            - README.rdoc
         | 
| 85 114 | 
             
            - Rakefile
         | 
| 86 115 | 
             
            - VERSION
         | 
| 87 | 
            -
            -  | 
| 88 | 
            -
            -  | 
| 116 | 
            +
            - bin/machinestatus
         | 
| 117 | 
            +
            - bin/scpall
         | 
| 118 | 
            +
            - bin/sshall
         | 
| 119 | 
            +
            - example/dot.clustersetting
         | 
| 89 120 | 
             
            - lib/comana.rb
         | 
| 121 | 
            +
            - lib/comana/clustersetting.rb
         | 
| 90 122 | 
             
            - lib/comana/computationmanager.rb
         | 
| 91 | 
            -
            - lib/comana/ | 
| 123 | 
            +
            - lib/comana/hostinspector.rb
         | 
| 124 | 
            +
            - lib/comana/hostinspector/pbsnodes.rb
         | 
| 125 | 
            +
            - lib/comana/hostinspector/ping.rb
         | 
| 126 | 
            +
            - lib/comana/hostselector.rb
         | 
| 92 127 | 
             
            - lib/comana/queuesubmitter.rb
         | 
| 93 128 | 
             
            - memo.txt
         | 
| 94 | 
            -
            -  | 
| 95 | 
            -
            -  | 
| 96 | 
            -
            -  | 
| 97 | 
            -
            -  | 
| 98 | 
            -
            -  | 
| 99 | 
            -
            -  | 
| 100 | 
            -
            -  | 
| 101 | 
            -
            -  | 
| 102 | 
            -
            -  | 
| 103 | 
            -
            -  | 
| 104 | 
            -
            -  | 
| 105 | 
            -
            -  | 
| 106 | 
            -
            -  | 
| 107 | 
            -
            -  | 
| 108 | 
            -
            -  | 
| 109 | 
            -
            -  | 
| 110 | 
            -
            -  | 
| 111 | 
            -
            -  | 
| 112 | 
            -
            -  | 
| 129 | 
            +
            - test/helper.rb
         | 
| 130 | 
            +
            - test/locked/input_a
         | 
| 131 | 
            +
            - test/locked/input_b
         | 
| 132 | 
            +
            - test/locked/lock_comana/dummy
         | 
| 133 | 
            +
            - test/locked_outputted/input_a
         | 
| 134 | 
            +
            - test/locked_outputted/input_b
         | 
| 135 | 
            +
            - test/locked_outputted/lock_comana/dummy
         | 
| 136 | 
            +
            - test/locked_outputted/output
         | 
| 137 | 
            +
            - test/not_executable/dummy
         | 
| 138 | 
            +
            - test/not_started/input_a
         | 
| 139 | 
            +
            - test/not_started/input_b
         | 
| 140 | 
            +
            - test/outputted/input_a
         | 
| 141 | 
            +
            - test/outputted/input_b
         | 
| 142 | 
            +
            - test/outputted/output
         | 
| 143 | 
            +
            - test/pbsnodes/Br09.xml
         | 
| 144 | 
            +
            - test/pbsnodes/Br10.xml
         | 
| 145 | 
            +
            - test/pbsnodes/Ge00.xml
         | 
| 146 | 
            +
            - test/pbsnodes/Ge08.xml
         | 
| 147 | 
            +
            - test/pbsnodes/all.xml
         | 
| 148 | 
            +
            - test/queuesubmitter/locked/lock_queuesubmitter/dummy
         | 
| 149 | 
            +
            - test/queuesubmitter/unlocked/dummy
         | 
| 150 | 
            +
            - test/test_clustersetting.rb
         | 
| 151 | 
            +
            - test/test_computationmanager.rb
         | 
| 152 | 
            +
            - test/test_hostinspector_pbsnodes.rb
         | 
| 153 | 
            +
            - test/test_hostinspector_ping.rb
         | 
| 154 | 
            +
            - test/test_hostselector.rb
         | 
| 155 | 
            +
            - test/test_queuesubmitter.rb
         | 
| 113 156 | 
             
            homepage: http://github.com/ippei94da/comana
         | 
| 114 157 | 
             
            licenses:
         | 
| 115 158 | 
             
            - MIT
         | 
| @@ -125,7 +168,7 @@ required_ruby_version: !ruby/object:Gem::Requirement | |
| 125 168 | 
             
                  version: '0'
         | 
| 126 169 | 
             
                  segments:
         | 
| 127 170 | 
             
                  - 0
         | 
| 128 | 
            -
                  hash:  | 
| 171 | 
            +
                  hash: -3582063889889649984
         | 
| 129 172 | 
             
            required_rubygems_version: !ruby/object:Gem::Requirement
         | 
| 130 173 | 
             
              none: false
         | 
| 131 174 | 
             
              requirements:
         | 
| @@ -134,7 +177,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement | |
| 134 177 | 
             
                  version: '0'
         | 
| 135 178 | 
             
            requirements: []
         | 
| 136 179 | 
             
            rubyforge_project: 
         | 
| 137 | 
            -
            rubygems_version: 1.8. | 
| 180 | 
            +
            rubygems_version: 1.8.23
         | 
| 138 181 | 
             
            signing_key: 
         | 
| 139 182 | 
             
            specification_version: 3
         | 
| 140 183 | 
             
            summary: Manager for scientific computing
         | 
    
        data/comana.gemspec
    DELETED
    
    | @@ -1,84 +0,0 @@ | |
| 1 | 
            -
            # Generated by jeweler
         | 
| 2 | 
            -
            # DO NOT EDIT THIS FILE DIRECTLY
         | 
| 3 | 
            -
            # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
         | 
| 4 | 
            -
            # -*- encoding: utf-8 -*-
         | 
| 5 | 
            -
             | 
| 6 | 
            -
            Gem::Specification.new do |s|
         | 
| 7 | 
            -
              s.name = "comana"
         | 
| 8 | 
            -
              s.version = "0.0.9"
         | 
| 9 | 
            -
             | 
| 10 | 
            -
              s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
         | 
| 11 | 
            -
              s.authors = ["ippei94da"]
         | 
| 12 | 
            -
              s.date = "2012-05-29"
         | 
| 13 | 
            -
              s.description = "Comana, COmputation MANAger,\n    is a software to provide a framework of\n    managing scientific computing.\n    Researchers on computing have to check calculation and\n    generate new calculation and execute, repeatedly.\n    The abstract class that this gem provide would help the work.\n  "
         | 
| 14 | 
            -
              s.email = "ippei94da@gmail.com"
         | 
| 15 | 
            -
              s.extra_rdoc_files = [
         | 
| 16 | 
            -
                "LICENSE.txt",
         | 
| 17 | 
            -
                "README.rdoc"
         | 
| 18 | 
            -
              ]
         | 
| 19 | 
            -
              s.files = [
         | 
| 20 | 
            -
                ".document",
         | 
| 21 | 
            -
                ".rspec",
         | 
| 22 | 
            -
                "Gemfile",
         | 
| 23 | 
            -
                "LICENSE.txt",
         | 
| 24 | 
            -
                "README.rdoc",
         | 
| 25 | 
            -
                "Rakefile",
         | 
| 26 | 
            -
                "VERSION",
         | 
| 27 | 
            -
                "comana.gemspec",
         | 
| 28 | 
            -
                "dot.machineinfo",
         | 
| 29 | 
            -
                "lib/comana.rb",
         | 
| 30 | 
            -
                "lib/comana/computationmanager.rb",
         | 
| 31 | 
            -
                "lib/comana/machineinfo.rb",
         | 
| 32 | 
            -
                "lib/comana/queuesubmitter.rb",
         | 
| 33 | 
            -
                "memo.txt",
         | 
| 34 | 
            -
                "spec/computationmanager_spec.rb",
         | 
| 35 | 
            -
                "spec/locked/input_a",
         | 
| 36 | 
            -
                "spec/locked/input_b",
         | 
| 37 | 
            -
                "spec/locked/lock_comana/dummy",
         | 
| 38 | 
            -
                "spec/locked_outputted/input_a",
         | 
| 39 | 
            -
                "spec/locked_outputted/input_b",
         | 
| 40 | 
            -
                "spec/locked_outputted/lock_comana/dummy",
         | 
| 41 | 
            -
                "spec/locked_outputted/output",
         | 
| 42 | 
            -
                "spec/machineinfo",
         | 
| 43 | 
            -
                "spec/machineinfo_spec.rb",
         | 
| 44 | 
            -
                "spec/not_started/input_a",
         | 
| 45 | 
            -
                "spec/not_started/input_b",
         | 
| 46 | 
            -
                "spec/outputted/input_a",
         | 
| 47 | 
            -
                "spec/outputted/input_b",
         | 
| 48 | 
            -
                "spec/outputted/output",
         | 
| 49 | 
            -
                "spec/queuesubmitter/locked/lock_queuesubmitter/dummy",
         | 
| 50 | 
            -
                "spec/queuesubmitter/unlocked/dummy",
         | 
| 51 | 
            -
                "spec/queuesubmitter_spec.rb",
         | 
| 52 | 
            -
                "spec/spec_helper.rb"
         | 
| 53 | 
            -
              ]
         | 
| 54 | 
            -
              s.homepage = "http://github.com/ippei94da/comana"
         | 
| 55 | 
            -
              s.licenses = ["MIT"]
         | 
| 56 | 
            -
              s.require_paths = ["lib"]
         | 
| 57 | 
            -
              s.rubygems_version = "1.8.11"
         | 
| 58 | 
            -
              s.summary = "Manager for scientific computing"
         | 
| 59 | 
            -
             | 
| 60 | 
            -
              if s.respond_to? :specification_version then
         | 
| 61 | 
            -
                s.specification_version = 3
         | 
| 62 | 
            -
             | 
| 63 | 
            -
                if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
         | 
| 64 | 
            -
                  s.add_development_dependency(%q<rspec>, [">= 2.10.0"])
         | 
| 65 | 
            -
                  s.add_development_dependency(%q<rdoc>, [">= 3.12"])
         | 
| 66 | 
            -
                  s.add_development_dependency(%q<bundler>, [">= 1.1.3"])
         | 
| 67 | 
            -
                  s.add_development_dependency(%q<jeweler>, [">= 1.8.3"])
         | 
| 68 | 
            -
                  s.add_development_dependency(%q<simplecov>, [">= 0"])
         | 
| 69 | 
            -
                else
         | 
| 70 | 
            -
                  s.add_dependency(%q<rspec>, [">= 2.10.0"])
         | 
| 71 | 
            -
                  s.add_dependency(%q<rdoc>, [">= 3.12"])
         | 
| 72 | 
            -
                  s.add_dependency(%q<bundler>, [">= 1.1.3"])
         | 
| 73 | 
            -
                  s.add_dependency(%q<jeweler>, [">= 1.8.3"])
         | 
| 74 | 
            -
                  s.add_dependency(%q<simplecov>, [">= 0"])
         | 
| 75 | 
            -
                end
         | 
| 76 | 
            -
              else
         | 
| 77 | 
            -
                s.add_dependency(%q<rspec>, [">= 2.10.0"])
         | 
| 78 | 
            -
                s.add_dependency(%q<rdoc>, [">= 3.12"])
         | 
| 79 | 
            -
                s.add_dependency(%q<bundler>, [">= 1.1.3"])
         | 
| 80 | 
            -
                s.add_dependency(%q<jeweler>, [">= 1.8.3"])
         | 
| 81 | 
            -
                s.add_dependency(%q<simplecov>, [">= 0"])
         | 
| 82 | 
            -
              end
         | 
| 83 | 
            -
            end
         | 
| 84 | 
            -
             | 
    
        data/dot.machineinfo
    DELETED
    
    | @@ -1,14 +0,0 @@ | |
| 1 | 
            -
            --- # vim:syntax=yaml
         | 
| 2 | 
            -
             | 
| 3 | 
            -
            fileserver: Pt
         | 
| 4 | 
            -
             | 
| 5 | 
            -
            SeriesA:
         | 
| 6 | 
            -
              economy_nodes: 1 # num of nodes for prior efficiency mode.
         | 
| 7 | 
            -
              speed_nodes: 4   # num of nodes for prior speed mode.
         | 
| 8 | 
            -
              vasp: "/usr/local/calc/bin/mpiexec /usr/local/calc/bin/vasp4631-mpich2"
         | 
| 9 | 
            -
             | 
| 10 | 
            -
            SeriesB:
         | 
| 11 | 
            -
              economy_nodes: 1
         | 
| 12 | 
            -
              speed_nodes: 8
         | 
| 13 | 
            -
              vasp: "/usr/local/calc/bin/mpiexec /usr/local/calc/bin/vasp4631-mpich2"
         | 
| 14 | 
            -
             | 
    
        data/lib/comana/machineinfo.rb
    DELETED
    
    | @@ -1,44 +0,0 @@ | |
| 1 | 
            -
            #! /usr/bin/env ruby
         | 
| 2 | 
            -
            # coding: utf-8
         | 
| 3 | 
            -
             | 
| 4 | 
            -
            require "yaml"
         | 
| 5 | 
            -
             | 
| 6 | 
            -
            # Series name is composed only of alphabets.
         | 
| 7 | 
            -
            # Host name is started by the series name and followed by integers.
         | 
| 8 | 
            -
            # E.g.,
         | 
| 9 | 
            -
            #   "Fe", "Fe00", "Fe01" are of series "Fe" and not "F"
         | 
| 10 | 
            -
            #
         | 
| 11 | 
            -
            class MachineInfo
         | 
| 12 | 
            -
             | 
| 13 | 
            -
              class NoEntryError < Exception; end
         | 
| 14 | 
            -
             | 
| 15 | 
            -
              #
         | 
| 16 | 
            -
              def initialize(data)
         | 
| 17 | 
            -
                @data = data
         | 
| 18 | 
            -
              end
         | 
| 19 | 
            -
             | 
| 20 | 
            -
              def self.load_file(data_file = (ENV["HOME"] + "/.machineinfo"))
         | 
| 21 | 
            -
                data = YAML.load_file(data_file)
         | 
| 22 | 
            -
                MachineInfo.new data
         | 
| 23 | 
            -
              end
         | 
| 24 | 
            -
             | 
| 25 | 
            -
              def get_info(host)
         | 
| 26 | 
            -
                series = host.sub(/\d*$/, "")
         | 
| 27 | 
            -
                unless @data.has_key?(series)
         | 
| 28 | 
            -
                  raise NoEntryError,
         | 
| 29 | 
            -
                    "#{series}"
         | 
| 30 | 
            -
                end
         | 
| 31 | 
            -
                @data[series]
         | 
| 32 | 
            -
              end
         | 
| 33 | 
            -
             | 
| 34 | 
            -
              #def has_info?(host)
         | 
| 35 | 
            -
              #  series = host.sub(/\d*$/, "")
         | 
| 36 | 
            -
              #  unless @data.has_key?(series)
         | 
| 37 | 
            -
              #    raise NoEntryError,
         | 
| 38 | 
            -
              #      "#{series}"
         | 
| 39 | 
            -
              #  end
         | 
| 40 | 
            -
              #  @data[series]
         | 
| 41 | 
            -
              #end
         | 
| 42 | 
            -
             | 
| 43 | 
            -
            end
         | 
| 44 | 
            -
             | 
| @@ -1,158 +0,0 @@ | |
| 1 | 
            -
            require "fileutils"
         | 
| 2 | 
            -
            require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
         | 
| 3 | 
            -
             | 
| 4 | 
            -
            NOW = Time.now
         | 
| 5 | 
            -
             | 
| 6 | 
            -
            class ComputationManager
         | 
| 7 | 
            -
              public :latest_modified_time, :started?
         | 
| 8 | 
            -
            end
         | 
| 9 | 
            -
             | 
| 10 | 
            -
            describe ComputationManager, "not started" do
         | 
| 11 | 
            -
              class CalcYet < ComputationManager
         | 
| 12 | 
            -
                def finished?         ; false     ; end
         | 
| 13 | 
            -
              end
         | 
| 14 | 
            -
              before do
         | 
| 15 | 
            -
                calc_dir = "spec/not_started"
         | 
| 16 | 
            -
                @calc = CalcYet.new(calc_dir)
         | 
| 17 | 
            -
             | 
| 18 | 
            -
                File.utime(NOW - 1000 ,NOW - 1000, "#{calc_dir}/input_a")
         | 
| 19 | 
            -
                File.utime(NOW - 2000 ,NOW - 2000, "#{calc_dir}/input_b")
         | 
| 20 | 
            -
                @lockdir = "#{calc_dir}/lock_comana"
         | 
| 21 | 
            -
                FileUtils.rm(@lockdir) if File.exist?(@lockdir)
         | 
| 22 | 
            -
              end
         | 
| 23 | 
            -
             | 
| 24 | 
            -
              it "should return the state" do
         | 
| 25 | 
            -
                @calc.state.should == :yet
         | 
| 26 | 
            -
              end
         | 
| 27 | 
            -
             | 
| 28 | 
            -
              it "should return latest modified time" do
         | 
| 29 | 
            -
                @calc.latest_modified_time.should == (NOW - 1000)
         | 
| 30 | 
            -
              end
         | 
| 31 | 
            -
             | 
| 32 | 
            -
              it "should return false without lock." do
         | 
| 33 | 
            -
                @calc.started?.should_not == nil
         | 
| 34 | 
            -
                @calc.started?.should be_false
         | 
| 35 | 
            -
              end
         | 
| 36 | 
            -
             | 
| 37 | 
            -
              it "should return true with lock." do
         | 
| 38 | 
            -
                @calc.started?.should be_false
         | 
| 39 | 
            -
              end
         | 
| 40 | 
            -
             | 
| 41 | 
            -
              #after do
         | 
| 42 | 
            -
              #  FileUtils.rm(@lockdir) if File.exist?(@lockdir)
         | 
| 43 | 
            -
              #end
         | 
| 44 | 
            -
            end
         | 
| 45 | 
            -
             | 
| 46 | 
            -
            describe ComputationManager, "with lock" do
         | 
| 47 | 
            -
              class CalcStarted < ComputationManager
         | 
| 48 | 
            -
                def finished?         ; false     ; end
         | 
| 49 | 
            -
              end
         | 
| 50 | 
            -
             | 
| 51 | 
            -
              before do
         | 
| 52 | 
            -
                calc_dir = "spec/locked"
         | 
| 53 | 
            -
                @calc = CalcStarted   .new(calc_dir)
         | 
| 54 | 
            -
                File.utime(NOW - 1000 ,NOW - 1000, "#{calc_dir}/input_a")
         | 
| 55 | 
            -
                File.utime(NOW - 2000 ,NOW - 2000, "#{calc_dir}/input_b")
         | 
| 56 | 
            -
              end
         | 
| 57 | 
            -
             | 
| 58 | 
            -
              it "should return :started" do
         | 
| 59 | 
            -
                @calc.state.should == :started
         | 
| 60 | 
            -
              end
         | 
| 61 | 
            -
            end
         | 
| 62 | 
            -
             | 
| 63 | 
            -
            describe ComputationManager, "with output, without lock" do
         | 
| 64 | 
            -
              class CalcStarted < ComputationManager
         | 
| 65 | 
            -
                def finished?         ; false     ; end
         | 
| 66 | 
            -
              end
         | 
| 67 | 
            -
             | 
| 68 | 
            -
              before do
         | 
| 69 | 
            -
                calc_dir = "spec/outputted"
         | 
| 70 | 
            -
                @calc = CalcStarted   .new(calc_dir)
         | 
| 71 | 
            -
                File.utime(NOW - 1000 ,NOW - 1000, "#{calc_dir}/input_a")
         | 
| 72 | 
            -
                File.utime(NOW - 2000 ,NOW - 2000, "#{calc_dir}/input_b")
         | 
| 73 | 
            -
                File.utime(NOW - 2000 ,NOW - 2000, "#{calc_dir}/output")
         | 
| 74 | 
            -
                #File.utime(NOW - 9000 ,NOW - 9000, "#{calc_dir}/lock")
         | 
| 75 | 
            -
                #File.open(OUTFILES[0], "w")
         | 
| 76 | 
            -
              end
         | 
| 77 | 
            -
             | 
| 78 | 
            -
              it "should return :started" do
         | 
| 79 | 
            -
                @calc.state.should == :yet
         | 
| 80 | 
            -
              end
         | 
| 81 | 
            -
             | 
| 82 | 
            -
            end
         | 
| 83 | 
            -
             | 
| 84 | 
            -
            describe ComputationManager, "terminated" do
         | 
| 85 | 
            -
              class CalcTerminated < ComputationManager
         | 
| 86 | 
            -
                def finished?         ; false     ; end
         | 
| 87 | 
            -
                def initialize(dir)
         | 
| 88 | 
            -
                  @dir = dir
         | 
| 89 | 
            -
                  @lockdir   = "lock_comana"
         | 
| 90 | 
            -
                  @alive_time = 500
         | 
| 91 | 
            -
                end
         | 
| 92 | 
            -
              end
         | 
| 93 | 
            -
             | 
| 94 | 
            -
              before do
         | 
| 95 | 
            -
                calc_dir = "spec/locked_outputted"
         | 
| 96 | 
            -
                @calc_terminated   = CalcTerminated.new(calc_dir)
         | 
| 97 | 
            -
             | 
| 98 | 
            -
                File.utime(NOW - 1000 ,NOW - 1000, "#{calc_dir}/input_a")
         | 
| 99 | 
            -
                File.utime(NOW - 2000 ,NOW - 2000, "#{calc_dir}/input_b")
         | 
| 100 | 
            -
                File.utime(NOW - 9000 ,NOW - 9000, "#{calc_dir}/output")
         | 
| 101 | 
            -
                File.utime(NOW - 9000 ,NOW - 9000, "#{calc_dir}/lock_comana")
         | 
| 102 | 
            -
              end
         | 
| 103 | 
            -
             | 
| 104 | 
            -
              it "should return the state" do
         | 
| 105 | 
            -
                @calc_terminated  .state.should == :terminated
         | 
| 106 | 
            -
              end
         | 
| 107 | 
            -
            end
         | 
| 108 | 
            -
             | 
| 109 | 
            -
            describe ComputationManager, "finished" do
         | 
| 110 | 
            -
              class CalcFinished    < ComputationManager
         | 
| 111 | 
            -
                def finished?         ; true      ; end
         | 
| 112 | 
            -
              end
         | 
| 113 | 
            -
             | 
| 114 | 
            -
              before do
         | 
| 115 | 
            -
                calc_dir = "spec/locked_outputted"
         | 
| 116 | 
            -
                @calc_finished     = CalcFinished  .new(calc_dir)
         | 
| 117 | 
            -
             | 
| 118 | 
            -
                File.utime(NOW - 1000 ,NOW - 1000, "#{calc_dir}/input_a")
         | 
| 119 | 
            -
                File.utime(NOW - 2000 ,NOW - 2000, "#{calc_dir}/input_b")
         | 
| 120 | 
            -
              end
         | 
| 121 | 
            -
             | 
| 122 | 
            -
              it "should return the state" do
         | 
| 123 | 
            -
                @calc_finished    .state.should == :finished
         | 
| 124 | 
            -
              end
         | 
| 125 | 
            -
            end
         | 
| 126 | 
            -
             | 
| 127 | 
            -
            describe ComputationManager, "cannot execute" do
         | 
| 128 | 
            -
              class CalcNotExecutable    < ComputationManager
         | 
| 129 | 
            -
                def calculate
         | 
| 130 | 
            -
                  end_status = system "" # notExistCommand
         | 
| 131 | 
            -
                  raise ExecuteError unless end_status
         | 
| 132 | 
            -
                end
         | 
| 133 | 
            -
             | 
| 134 | 
            -
                def finished?
         | 
| 135 | 
            -
                  return false
         | 
| 136 | 
            -
                end
         | 
| 137 | 
            -
             | 
| 138 | 
            -
                def prepare_next
         | 
| 139 | 
            -
                  #return false
         | 
| 140 | 
            -
                  raise
         | 
| 141 | 
            -
                end
         | 
| 142 | 
            -
              end
         | 
| 143 | 
            -
             | 
| 144 | 
            -
              before do
         | 
| 145 | 
            -
                calc_dir = "spec/not_executable"
         | 
| 146 | 
            -
                @calc     = CalcNotExecutable  .new(calc_dir)
         | 
| 147 | 
            -
                #File.utime(NOW - 1000 ,NOW - 1000, "#{calc_dir}/input_a")
         | 
| 148 | 
            -
                #File.utime(NOW - 2000 ,NOW - 2000, "#{calc_dir}/input_b")
         | 
| 149 | 
            -
                @lockdir = calc_dir + "/lock_comana"
         | 
| 150 | 
            -
             | 
| 151 | 
            -
                Dir.rmdir(@lockdir) if File.exist?(@lockdir)
         | 
| 152 | 
            -
              end
         | 
| 153 | 
            -
             | 
| 154 | 
            -
              it "should raise error" do
         | 
| 155 | 
            -
                lambda{@calc.start}.should raise_error(ComputationManager::ExecuteError)
         | 
| 156 | 
            -
              end
         | 
| 157 | 
            -
            end
         | 
| 158 | 
            -
             |