Module: CodeRunner::GenericlinuxTestsystem
- Defined in:
- lib/coderunner/system_modules/genericlinux_testsystem.rb
Constant Summary collapse
- @@ruby_command =
"ruby1.9"
Instance Method Summary collapse
- #cancel_job ⇒ Object
- #error_file ⇒ Object
- #execute ⇒ Object
- #output_file ⇒ Object
- #queue_status ⇒ Object
- #run_command ⇒ Object
Instance Method Details
#cancel_job ⇒ Object
29 30 31 |
# File 'lib/coderunner/system_modules/genericlinux_testsystem.rb', line 29 def cancel_job `kill #{@job_no}` end |
#error_file ⇒ Object
33 34 35 |
# File 'lib/coderunner/system_modules/genericlinux_testsystem.rb', line 33 def error_file return nil end |
#execute ⇒ Object
23 24 25 26 27 |
# File 'lib/coderunner/system_modules/genericlinux_testsystem.rb', line 23 def execute log 'execute_submission' fork{exec run_command} sleep 0.2 end |
#output_file ⇒ Object
37 38 39 |
# File 'lib/coderunner/system_modules/genericlinux_testsystem.rb', line 37 def output_file return nil end |
#queue_status ⇒ Object
6 7 8 9 10 11 12 13 |
# File 'lib/coderunner/system_modules/genericlinux_testsystem.rb', line 6 def queue_status # if @@no_run # return "" # else return %x[ps] #%x[top -b -n 1 -u #{Process.uid} | grep #{@@executable_name}] # end # top runs very slowly. If you have a system (for example your laptop) where you will never run simulations, only analyse them, replace this command with %x[ps] and code runner will run much faster. end |
#run_command ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/coderunner/system_modules/genericlinux_testsystem.rb', line 15 def run_command if @@uses_mpi return %[mpirun -np #{@nprocs} #{executable_location}/#{executable_name} #{parameter_string}] else return %[#{executable_location}/#{executable_name} #{parameter_string}] end end |