Hi Sephiroth Yes, it looks like daemon.pl is not compatible with multi-threaded Moses. If you look at the comments in daemon.pl you can see that it is intended to run on a multi-host (ie cluster) setup, and pre-dates multi-threaded Moses.
If you want a multi-threaded Moses server, then use mosesserver in contrib/server. There's some documentation on the website, and here: http://homepages.inf.ed.ac.uk/bhaddow/dublin-mosesmt.pdf If you only have a single core though, you will not get any benefit from multi-threading, cheers - Barry On 02/11/12 03:39, 曹骏 wrote: > Hi Barry > > Thanks for answering my question. But I still feel confused with the > daemon.pl <http://daemon.pl>, it's a perl script that used to set up > Moses server. > The script is in the folder ~/mosesdecoder/contrib/web/bin . And the > line 43 is *my $pid = open2 ($MOSES_OUT, $MOSES_IN, $MOSES, '-f', > $MOSES_INI, '-t'); *It doesn't add the multi-thread switch > -th//-threads (th): number of threads to use in decoding (defaults to > single-threaded).So I think this server is set up defaults to > single-threaded. But even if I modify this line to *my $pid = open2 > ($MOSES_OUT, $MOSES_IN, $MOSES,'-th','5', '-f', $MOSES_INI, '-t'); *My > test code will still encounter the [Errno 10060]I have mentioned last > mail. > Is there some document which explains the mutil-thread in Moses server > specifically?Maybe there's some restrictions when setting a server? > > ps: I use a virtual machine to run Moses server. It only has one > processor. I wonder if this could affect the results. > > Best regards > Sephiroth > > 2012/11/1 Barry Haddow <[email protected] > <mailto:[email protected]>> > > Hi Sephiroth > > I don't know about daemon.pl <http://daemon.pl>, but the Moses > server supports multi-threaded operation > > http://www.statmt.org/moses/?n=Moses.AdvancedFeatures#ntoc27 > > cheers - Barry > > > On 01/11/12 06:32, 曹骏 wrote: >> Dear support >> >> I have used daemon.pl <http://daemon.pl> which has been >> introduced in chapter *Translating web pages with Moses to* set a >> Moses server. And of course it could work and translates string >> normally. However when I use multi-thread to send requests to the >> server at the same time some threads may catch the error: [Errno >> 10060] A connection attempt failed because the connected party >> did not properly respond after a period of time, or established >> connection failed because connected host has failed to respond. >> My test code are as follows: >> >> #python >> import threading >> import socket >> class ThreadClass(threading.Thread): >> def run(self): >> clisock=socket.socket(socket.AF_INET,socket.SOCK_STREAM) >> server='127.0.0.1' >> clisock.connect((server,8089)) >> clisock.send("could not connect it\n") >> print self.getName()+clisock.recv(1000) >> clisock.close() >> for i in range(20): >> t=ThreadClass() >> t.start() >> >> Does the Moses translation engine supports multi-thread? Or >> there're some restrictions about the number of the thread? Or I >> have to modify some code in daemon.pl <http://daemon.pl>? >> >> >> Best regards >> Sephiroth >> >> >> _______________________________________________ >> Moses-support mailing list >> [email protected] <mailto:[email protected]> >> http://mailman.mit.edu/mailman/listinfo/moses-support > >
_______________________________________________ Moses-support mailing list [email protected] http://mailman.mit.edu/mailman/listinfo/moses-support
