Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/moses-smt/mosesdecoder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'web/bin/start-daemon-cluster.pl')
-rw-r--r--web/bin/start-daemon-cluster.pl35
1 files changed, 35 insertions, 0 deletions
diff --git a/web/bin/start-daemon-cluster.pl b/web/bin/start-daemon-cluster.pl
new file mode 100644
index 000000000..3bfe01927
--- /dev/null
+++ b/web/bin/start-daemon-cluster.pl
@@ -0,0 +1,35 @@
+#!/usr/bin/perl -w
+use warnings;
+use strict;
+$|++;
+
+# file: start-daemon-cluster.pl
+
+# Herve Saint-Amand
+# Universitaet des Saarlandes
+# Thu May 15 08:22:13 2008
+
+# Utility to start/stop the daemon processes on the 16 cluster machines.
+# Config in here should match that given in translate.cgi (hostnames, ports)
+
+#------------------------------------------------------------------------------
+
+my $stop = @ARGV && $ARGV[0] eq '-s';
+
+foreach my $i (qw/01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16/) {
+ my $host = "cluster-$i";
+ my $port = "90$i";
+
+ my @cmd = $stop ?
+ ('ssh', $host, 'killall', '-q', 'daemon.pl')
+ :
+ ('ssh',
+ '-L', "$port:localhost:$port",
+ $host,
+ '/local/herves/moses/daemon.pl', 'localhost', $port);
+
+ print "@cmd\n";
+ exec @cmd unless fork ();
+}
+
+#------------------------------------------------------------------------------