The only resource manager for which streaming output is supported is TORQUE 2.4 and later.
To configure TORQUE and Moab for streaming job output
This causes the MOM daemons to not move the job output files to another location after the jobs finish running.
If both msub and qsub are used by users, a filter must be supplied for both. The following example demonstrates a submit filter for the msub command that forces all job output to go to /var/spool/torque/spool. The script relies on Ruby, RubyGems, the libxml-ruby gem, and the availability of native libxml2 libraries that libxml-ruby needs.
#!/usr/bin/env ruby
require 'rubygems'
require 'libxml'
include LibXML::XML
SpoolDir = '/var/spool/torque/spool/'
ScriptStartRe = %r{^\s*\START}
ScriptDirectiveRe = %r{#{ScriptStartRe}\23!.+?\0a}
job = Parser.io($stdin).parse
e = job.find_first('/job/SubmitString')
output_directives = "#PBS -o #{SpoolDir}
#PBS -e #{SpoolDir}
"
{ " " => "\\20", "
" => "\\0a", "#" => "\\23" }.each do |a, b|
output_directives.gsub!(a, b)
end
if e.content =~ ScriptDirectiveRe || e.content =~ ScriptStartRe
e.content.insert($~.size, output_directives)
else
raise "Failed to recognize start of job submit string"
end
puts job
Use the $job_output_file_unmask parameter to configure all MOM daemons to produce job output files that are world-readable. Specifically, the following line causes job output files to be created with read privileges for all users:
$job_output_file_umask 022
Related topics