pass in PATH variable from master node. When you're running of a grid but really just qsubbing everything to 1 slave node

This commit is contained in:
Hieu Hoang 2015-04-02 19:15:21 +04:00
parent 2d1da3219d
commit 27b36e0c96
3 changed files with 25 additions and 5 deletions

View File

@ -18,7 +18,19 @@ sub trim($)
my $host = `hostname`; chop($host);
print STDERR "STARTING UP AS PROCESS $$ ON $host AT ".`date`;
my ($CONFIG_FILE,$EXECUTE,$NO_GRAPH,$CONTINUE,$FINAL_STEP,$FINAL_OUT,$VERBOSE,$IGNORE_TIME,$DELETE_CRASHED,$DELETE_VERSION);
my ($CONFIG_FILE,
$EXECUTE,
$NO_GRAPH,
$CONTINUE,
$FINAL_STEP,
$FINAL_OUT,
$VERBOSE,
$IGNORE_TIME,
$DELETE_CRASHED,
$DELETE_VERSION,
$MASTER_PATH
);
my $SLEEP = 2;
my $META = "$RealBin/experiment.meta";
@ -48,7 +60,8 @@ die("experiment.perl -config config-file [-exec] [-no-graph]")
'verbose' => \$VERBOSE,
'sleep=i' => \$SLEEP,
'max-active=i' => \$MAX_ACTIVE,
'no-graph' => \$NO_GRAPH);
'no-graph' => \$NO_GRAPH,
'master-path=s' => \$MASTER_PATH);
if (! -e "steps") { `mkdir -p steps`; }
die("error: could not find config file")
@ -3442,7 +3455,14 @@ sub create_step {
$subdir = "lm" if $subdir eq "interpolated-lm";
open(STEP,">$file") or die "Cannot open: $!";
print STEP "#!/bin/bash\n\n";
print STEP "PATH=\"".$ENV{"PATH"}."\"\n";
if (defined($MASTER_PATH)) {
print STEP "PATH=\"$MASTER_PATH\"\n";
}
else {
print STEP "PATH=\"".$ENV{"PATH"}."\"\n";
}
print STEP "cd $dir\n";
print STEP "echo 'starting at '`date`' on '`hostname`\n";
print STEP "mkdir -p $dir/$subdir\n\n";

View File

@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Author: Rico Sennrich

View File

@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Author: Rico Sennrich