summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Simianer <p@simianer.de>2014-07-22 11:40:59 +0200
committerPatrick Simianer <p@simianer.de>2014-07-22 11:40:59 +0200
commit499b2caf33507d31a4bb3eb267a2a311b8da5474 (patch)
treeb38766b95c95714387b8fc308539683a355f947a
parent093c99067d758bd5833f2f3f09920830c701c7b3 (diff)
mira qsub
-rwxr-xr-xtraining/mira/mira.py15
1 files changed, 12 insertions, 3 deletions
diff --git a/training/mira/mira.py b/training/mira/mira.py
index 691a62a6..ec9c2d64 100755
--- a/training/mira/mira.py
+++ b/training/mira/mira.py
@@ -143,6 +143,10 @@ def main():
parser.add_argument('--pass-suffix',
help='multipass decoding iteration. see documentation '
'at www.cdec-decoder.org for more information')
+ parser.add_argument('--qsub',
+ help='use qsub', action='store_true')
+ parser.add_argument('--pmem',
+ help='memory for qsub', type=str, default='5G')
parser.add_argument('-v', '--verbose',
help='more verbose mira optimizers')
args = parser.parse_args()
@@ -317,6 +321,8 @@ def split_devset(dev, outdir):
def optimize(args, script_dir, dev_size):
parallelize = script_dir+'/../utils/parallelize.pl'
+ if args.qsub:
+ parallelize += " -p %s"%args.pmem
decoder = script_dir+'/kbest_cut_mira'
(source, refs) = split_devset(args.devset, args.output_dir)
port = random.randint(15000,50000)
@@ -358,9 +364,12 @@ def optimize(args, script_dir, dev_size):
if args.verbose:
decoder_cmd += ' -v'
- #always use fork
- parallel_cmd = '{0} --use-fork -e {1} -j {2} --'.format(
- parallelize, logdir, args.jobs)
+ if args.qsub:
+ parallel_cmd = '{0} -e {1} -j {2} --'.format(
+ parallelize, logdir, args.jobs)
+ else:
+ parallel_cmd = '{0} --use-fork -e {1} -j {2} --'.format(
+ parallelize, logdir, args.jobs)
cmd = parallel_cmd + ' ' + decoder_cmd
logging.info('OPTIMIZATION COMMAND: {}'.format(cmd))