'Install Sun Grid Engine with a default parallel environment on
StarCluster'

def _setup_sge(self):

    master = self._master
    if (not master.ssh.isdir(self.SGE_ROOT)):
        master.ssh.execute(('cp    -r    %s    %s' % (self.SGE_FRESH, self.SGE_ROOT)))
        master.ssh.execute(('chown    -R    %(user)s:%(user)s    %(sge_root)s' % {'user': self._user, 'sge_root': self.SGE_ROOT}))
    self._disable_add_queue()
    self._setup_nfs(self.nodes, export_paths=[self.SGE_ROOT], start_server=False)
    default_cell = self._sge_path('default')
    if master.ssh.isdir(default_cell):
        log.info('Removing    previous    SGE    installation...')
        master.ssh.execute(('rm    -rf    %s' % default_cell))
        master.ssh.execute('exportfs    -fr')
    admin_hosts = '    '.join(map((lambda n: n.alias), self._nodes))
    submit_hosts = admin_hosts
    exec_hosts = admin_hosts
    sge_conf = master.ssh.remote_file(self._sge_path(self.SGE_CONF), 'w')
    conf = (sge.sgeinstall_template % dict(admin_hosts=admin_hosts, submit_hosts=submit_hosts, exec_hosts=exec_hosts))
    sge_conf.write(conf)
    sge_conf.close()
    log.info('Installing    Sun    Grid    Engine...')
    self._inst_sge(master, exec_host=self.master_is_exec_host)
    master.ssh.execute('qconf    -mattr    queue    shell    "/bin/bash"    all.q')
    for node in self.nodes:
        self.pool.simple_job(self._add_to_sge, (node,), jobid=node.alias)
    self.pool.wait(numtasks=len(self.nodes))
    self._create_sge_pe()
