class WorkflowManager::HydraCluster

Public Instance Methods

cluster_nodes() click to toggle source
# 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) click to toggle source
# File lib/workflow_manager/cluster.rb, line 336
def copy_commands(org_dir, dest_parent_dir, now=nil)
  # TODO
end
delete_command(target) click to toggle source
# File lib/workflow_manager/cluster.rb, line 343
def delete_command(target)
  # TODO
end
job_ends?(log_file) click to toggle source
# File lib/workflow_manager/cluster.rb, line 330
def job_ends?(log_file)
  # TODO
end
job_pending?(job_id) click to toggle source
# File lib/workflow_manager/cluster.rb, line 333
def job_pending?(job_id)
  # TODO
end
job_running?(job_id) click to toggle source
# File lib/workflow_manager/cluster.rb, line 327
def job_running?(job_id)
  # TODO
end
kill_command(job_id) click to toggle source
# 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='') click to toggle source
# 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