Sha256: c3a340dc3cb4512cfdf85c6953f1691389a3f2c7043f3421a986644ea7ba1394

Contents?: true

Size: 1.14 KB

Versions: 165

Compression:

Stored size: 1.14 KB

Contents

class CodeRunner
	module Macosx
# @@ruby_command = "ruby1.9"

def queue_status
	%x[ps].grep(Regexp.new(Regexp.escape(executable_name))) #Can't put grep in the shell command because it will grep itself - OS X displays the entire command in ps!
end

def run_command
	if rcp.uses_mpi
		return %[mpirun -np #{@nprocs} #{executable_location}/#{executable_name} #{parameter_string} > #{output_file} 2> #{error_file}]
	else
		return %[#{executable_location}/#{executable_name} #{parameter_string} > #{output_file} 2> #{error_file}]
	end
end		

def execute
	log 'execute_submission'
  if ENV['CODE_RUNNER_LAUNCHER']
    launch_id = "#{Time.now.to_i}#{$$}"
    fname = ENV['HOME'] + "/.coderunner_to_launch/#{launch_id}"
    File.open(fname + '.start', 'w'){|file| file.puts "cd #{Dir.pwd};#{run_command}"}
    sleep 1 until FileTest.exist? fname + '.pid'
    pid = File.read(fname + '.pid').to_i
    FileUtils.rm fname + '.pid'
  else
    pid = Kernel.spawn(run_command + " & ")
  end
  
	return nil # pid
end


def cancel_job
	`kill #{@job_no}`
end

def error_file
	return executable_name + ".sh.e"
end

def output_file
	return executable_name + ".sh.o"
end

	end
end



Version data entries

165 entries across 165 versions & 1 rubygems

Version Path
coderunner-1.0.14 lib/coderunner/system_modules/macosx.rb
coderunner-1.0.13 lib/coderunner/system_modules/macosx.rb
coderunner-1.0.12 lib/coderunner/system_modules/macosx.rb
coderunner-1.0.11 lib/coderunner/system_modules/macosx.rb
coderunner-1.0.10 lib/coderunner/system_modules/macosx.rb
coderunner-1.0.9 lib/coderunner/system_modules/macosx.rb
coderunner-1.0.8 lib/coderunner/system_modules/macosx.rb
coderunner-1.0.7 lib/coderunner/system_modules/macosx.rb
coderunner-1.0.6 lib/coderunner/system_modules/macosx.rb
coderunner-1.0.4 lib/coderunner/system_modules/macosx.rb
coderunner-1.0.3 lib/coderunner/system_modules/macosx.rb
coderunner-1.0.2 lib/coderunner/system_modules/macosx.rb
coderunner-1.0.1 lib/coderunner/system_modules/macosx.rb
coderunner-1.0.0 lib/coderunner/system_modules/macosx.rb
coderunner-0.18.5 lib/coderunner/system_modules/macosx.rb
coderunner-0.18.4 lib/coderunner/system_modules/macosx.rb
coderunner-0.18.3 lib/coderunner/system_modules/macosx.rb
coderunner-0.18.2 lib/coderunner/system_modules/macosx.rb
coderunner-0.18.1 lib/coderunner/system_modules/macosx.rb
coderunner-0.18.0 lib/coderunner/system_modules/macosx.rb