Module: CodeRunner::Launcher
- Included in:
- GenericLinux, Moab, Slurm
- Defined in:
- lib/coderunner/system_modules/launcher.rb
Overview
A module containing methods for submitting runs using the CodeRunner launcher. Typically this would be used on a home Linux system or in an interactive session on a supercomputer.
Instance Method Summary collapse
- #cancel_job_launcher ⇒ Object
- #error_file_launcher ⇒ Object
- #execute_launcher ⇒ Object
- #launcher_prefix ⇒ Object
- #output_file_launcher ⇒ Object
- #queue_status_launcher ⇒ Object
- #use_launcher ⇒ Object
Instance Method Details
#cancel_job_launcher ⇒ Object
28 29 30 31 |
# File 'lib/coderunner/system_modules/launcher.rb', line 28 def cancel_job_launcher fname = CodeRunner.launcher_directory + "/#{$$}.stop" File.open(fname, 'w'){|file| file.puts "\n"} end |
#error_file_launcher ⇒ Object
32 33 34 |
# File 'lib/coderunner/system_modules/launcher.rb', line 32 def error_file_launcher return "#{executable_name}.#{job_identifier}.e" end |
#execute_launcher ⇒ Object
19 20 21 22 23 24 25 26 27 |
# File 'lib/coderunner/system_modules/launcher.rb', line 19 def execute_launcher launch_id = "#{Time.now.to_i}#{$$}" fname = "#{CodeRunner.launcher_directory}/#{launch_id}" File.open(fname + '.start', 'w'){|file| file.print "cd #{Dir.pwd};", run_command, "\n"} sleep 2 until FileTest.exist? fname + '.pid' pid = File.read(fname + '.pid').to_i FileUtils.rm fname + '.pid' return pid end |
#launcher_prefix ⇒ Object
7 8 9 |
# File 'lib/coderunner/system_modules/launcher.rb', line 7 def launcher_prefix CodeRunner.(:launcher) end |
#output_file_launcher ⇒ Object
35 36 37 |
# File 'lib/coderunner/system_modules/launcher.rb', line 35 def output_file_launcher return "#{executable_name}.#{job_identifier}.o" end |
#queue_status_launcher ⇒ Object
13 14 15 16 17 18 |
# File 'lib/coderunner/system_modules/launcher.rb', line 13 def queue_status_launcher #%x[cat #{CodeRunner.launcher_directory}/queue_status.txt | grep sh] + #%x[cat #{CodeRunner.launcher_directory}/queue_status2.txt | grep sh] %x[cat #{CodeRunner.launcher_directory}/queue_status.txt ] + %x[cat #{CodeRunner.launcher_directory}/queue_status2.txt ] end |
#use_launcher ⇒ Object
10 11 12 |
# File 'lib/coderunner/system_modules/launcher.rb', line 10 def use_launcher launcher_prefix end |