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) ⇒ 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
Constructor Details
This class inherits a constructor from WorkflowManager::Cluster
Instance Method Details
#cluster_nodes ⇒ Object
TODO
271 272 273 274 275 276 |
# File 'lib/workflow_manager/cluster.rb', line 271 def cluster_nodes # TODO nodes = { 'cluster/largemem' => 'cluster/largemem', } end |
#copy_commands(org_dir, dest_parent_dir, now = nil) ⇒ Object
TODO
261 262 263 |
# File 'lib/workflow_manager/cluster.rb', line 261 def copy_commands(org_dir, dest_parent_dir, now=nil) # TODO end |
#delete_command(target) ⇒ Object
268 269 270 |
# File 'lib/workflow_manager/cluster.rb', line 268 def delete_command(target) # TODO end |
#job_ends?(log_file) ⇒ Boolean
TODO
255 256 257 |
# File 'lib/workflow_manager/cluster.rb', line 255 def job_ends?(log_file) # TODO end |
#job_pending?(job_id) ⇒ Boolean
TODO
258 259 260 |
# File 'lib/workflow_manager/cluster.rb', line 258 def job_pending?(job_id) # TODO end |
#job_running?(job_id) ⇒ Boolean
252 253 254 |
# File 'lib/workflow_manager/cluster.rb', line 252 def job_running?(job_id) # TODO end |
#kill_command(job_id) ⇒ Object
TODO
264 265 266 267 |
# File 'lib/workflow_manager/cluster.rb', line 264 def kill_command(job_id) # TODO command = "ssh hydra; scancel #{job_id}" end |
#submit_job(script_file, script_content, option = '') ⇒ Object
238 239 240 241 242 243 244 245 246 247 248 249 250 251 |
# File 'lib/workflow_manager/cluster.rb', line 238 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 |