Navigation Menu

Skip to content

Commit

Permalink
firt pass to support sge
Browse files Browse the repository at this point in the history
  • Loading branch information
Satrajit Ghosh committed Jul 17, 2010
1 parent b222b5c commit e9f4279
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 13 deletions.
13 changes: 11 additions & 2 deletions IPython/kernel/scripts/ipcluster.py
Expand Up @@ -339,6 +339,15 @@ class SGEEngineSet(BatchEngineSet):
def __init__(self, template_file, **kwargs):
BatchEngineSet.__init__(self, template_file, **kwargs)

def parse_job_id(self, output):
m = re.search(self.job_id_regexp, output)
if m is not None:
job_id = m.group()
else:
raise Exception("job id couldn't be determined: %s" % output)
self.job_id = job_id
log.msg('Job started with job id: %r' % job_id)
return job_id

sshx_template="""#!/bin/sh
"$@" &> /dev/null &
Expand Down Expand Up @@ -820,15 +829,15 @@ def get_args():

parser_sge = subparsers.add_parser(
'sge',
help='run a sge cluster',
help='run an sge cluster',
parents=[base_parser]
)
parser_sge.add_argument(
'--sge-script',
type=str,
dest='sgescript',
help='SGE script template',
default='sge.template'
default='template.sge'
)
parser_sge.set_defaults(func=main_sge)

Expand Down
22 changes: 11 additions & 11 deletions docs/source/parallel/parallel_process.txt
Expand Up @@ -177,17 +177,17 @@ The SGE mode uses the Sun Grid Engine [SGE]_ to start the engines. To use this

.. sourcecode:: bash

#!/bin/bash
#$ -V
#$ -cwd
#$ -M joe@gmail.com
#$ -m beas
#$ -N ipython
#$ -r y
#$ -S /bin/bash

cd $$HOME/sge
/usr/local/bin/mpiexec -n ${n} ipengine --logfile=$$HOME/sge/ipengine
#!/bin/bash
#$ -V
#$ -cwd
#$ -m n
#$ -N satra-ipython
#$ -r y
#$ -q sub
#$ -S /bin/bash

cd $$HOME/sge
ipengine --logfile=ipengine

There are a few important points about this template:

Expand Down

0 comments on commit e9f4279

Please sign in to comment.