Class: WorkflowManager::HydraCluster
- Defined in:
- lib/workflow_manager/cluster.rb
Instance Attribute Summary
Attributes inherited from Cluster
Instance Method Summary collapse
-
#cluster_nodes ⇒ Object
TODO.
-
#copy_commands(org_dir, dest_parent_dir, now = nil, queue = "light") ⇒ Object
TODO.
- #delete_command(target) ⇒ Object
-
#job_ends?(log_file) ⇒ Boolean
TODO.
-
#job_pending?(job_id) ⇒ Boolean
TODO.
- #job_running?(job_id) ⇒ Boolean
-
#kill_command(job_id) ⇒ Object
TODO.
- #submit_job(script_file, script_content, option = '') ⇒ Object
Methods inherited from Cluster
#default_node, #generate_new_job_script, #initialize, #node_list
Constructor Details
This class inherits a constructor from WorkflowManager::Cluster
Instance Method Details
#cluster_nodes ⇒ Object
TODO
346 347 348 349 350 351 |
# File 'lib/workflow_manager/cluster.rb', line 346 def cluster_nodes # TODO nodes = { 'cluster/largemem' => 'cluster/largemem', } end |
#copy_commands(org_dir, dest_parent_dir, now = nil, queue = "light") ⇒ Object
TODO
336 337 338 |
# File 'lib/workflow_manager/cluster.rb', line 336 def copy_commands(org_dir, dest_parent_dir, now=nil, queue="light") # TODO end |
#delete_command(target) ⇒ Object
343 344 345 |
# File 'lib/workflow_manager/cluster.rb', line 343 def delete_command(target) # TODO end |
#job_ends?(log_file) ⇒ Boolean
TODO
330 331 332 |
# File 'lib/workflow_manager/cluster.rb', line 330 def job_ends?(log_file) # TODO end |
#job_pending?(job_id) ⇒ Boolean
TODO
333 334 335 |
# File 'lib/workflow_manager/cluster.rb', line 333 def job_pending?(job_id) # TODO end |
#job_running?(job_id) ⇒ Boolean
327 328 329 |
# File 'lib/workflow_manager/cluster.rb', line 327 def job_running?(job_id) # TODO end |
#kill_command(job_id) ⇒ Object
TODO
339 340 341 342 |
# File 'lib/workflow_manager/cluster.rb', line 339 def kill_command(job_id) # TODO command = "ssh hydra; scancel #{job_id}" end |
#submit_job(script_file, script_content, option = '') ⇒ Object
313 314 315 316 317 318 319 320 321 322 323 324 325 326 |
# File 'lib/workflow_manager/cluster.rb', line 313 def submit_job(script_file, script_content, option='') # TODO if script_name = File.basename(script_file) and script_name =~ /\.sh$/ new_job_script = generate_new_job_script(script_name, script_content) new_job_script_base = File.basename(new_job_script) log_file = File.join(@log_dir, new_job_script_base + "_o.log") err_file = File.join(@log_dir, new_job_script_base + "_e.log") #command = "g-sub -o #{log_file} -e #{err_file} #{option} #{new_job_script}" command = "cat #{new_job_script} |ssh hydra 'cat > #{new_job_script_base}; source /etc/profile; module load cluster/largemem; sbatch #{new_job_script_base};'" job_id = `#{command}` job_id = job_id.match(/Submitted batch job (\d+)/)[1] [job_id, log_file, command] end end |