Class: MRunEnv::MPIRunner
- Inherits:
-
Object
- Object
- MRunEnv::MPIRunner
- Defined in:
- ext/lib/CompLearnLib/RunEnv.rb,
ext/lib/CompLearnLib/RunEnv.rb
Overview
For now, use these paths
Constant Summary collapse
- @@MPIRUBY =
'mpi_ruby'
- @@MPIRUN =
'mpirun'
- @@MPILAMBOOT =
'lamboot'
- @@MPIWIPE =
'wipe'
- @@MPIHALT =
'lamhalt'
Class Method Summary collapse
- .bootMPI ⇒ Object
- .getGoodHostsFile ⇒ Object
- .haltMPI ⇒ Object
- .lamRunning? ⇒ Boolean
- .rebootMPI ⇒ Object
-
.runMPIRubyScript(scriptArray) ⇒ Object
returns PID of controller.
- .stopMPIRubyScript ⇒ Object
Class Method Details
.bootMPI ⇒ Object
67 68 69 70 71 72 |
# File 'ext/lib/CompLearnLib/RunEnv.rb', line 67 def MPIRunner.bootMPI() MPIRunner.getGoodHostsFile result = `#{@@MPILAMBOOT} -x -v -s #{@hostFilename}` puts result @lamRunning = true end |
.getGoodHostsFile ⇒ Object
57 58 59 60 61 62 |
# File 'ext/lib/CompLearnLib/RunEnv.rb', line 57 def MPIRunner.getGoodHostsFile() unless defined?(@hostFilename) @hostFilename = SSHAgent.writeGoodHostFile end @hostFilename end |
.haltMPI ⇒ Object
76 77 78 79 80 81 82 |
# File 'ext/lib/CompLearnLib/RunEnv.rb', line 76 def MPIRunner.haltMPI() MPIRunner.getGoodHostsFile #result = `#{@@MPIHALT}` result = `#{@@MPIWIPE} -v #{@hostFilename}` SSHAgent.runEverywhere('"killall mpi_ruby;killall lamboot;killall lamd"') @lamRunning = false end |
.lamRunning? ⇒ Boolean
73 74 75 |
# File 'ext/lib/CompLearnLib/RunEnv.rb', line 73 def MPIRunner.lamRunning?() defined?(@lamRunning) && @lamRunning end |
.rebootMPI ⇒ Object
63 64 65 66 |
# File 'ext/lib/CompLearnLib/RunEnv.rb', line 63 def MPIRunner.rebootMPI() MPIRunner.haltMPI MPIRunner.bootMPI end |
.runMPIRubyScript(scriptArray) ⇒ Object
returns PID of controller
87 88 89 90 91 92 93 94 95 96 97 98 |
# File 'ext/lib/CompLearnLib/RunEnv.rb', line 87 def MPIRunner.runMPIRubyScript(scriptArray) # returns PID of controller scriptName = scriptArray[0] scriptArgs = (scriptArray[1..-1]).join(' ') puts "Running script #{scriptName} on #{`hostname`}" MPIRunner.bootMPI unless lamRunning? # res = fork() # if (res) # res # else exec("#{@@MPIRUN} C #{@@MPIRUBY} #{scriptName} #{scriptArgs}") # end end |