Return-Path: Delivered-To: apmail-incubator-hama-dev-archive@minotaur.apache.org Received: (qmail 70080 invoked from network); 14 Feb 2011 13:06:03 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 14 Feb 2011 13:06:03 -0000 Received: (qmail 4219 invoked by uid 500); 14 Feb 2011 13:06:03 -0000 Delivered-To: apmail-incubator-hama-dev-archive@incubator.apache.org Received: (qmail 3987 invoked by uid 500); 14 Feb 2011 13:05:59 -0000 Mailing-List: contact hama-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: hama-dev@incubator.apache.org Delivered-To: mailing list hama-dev@incubator.apache.org Received: (qmail 3965 invoked by uid 99); 14 Feb 2011 13:05:58 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 14 Feb 2011 13:05:58 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.9] (HELO minotaur.apache.org) (140.211.11.9) by apache.org (qpsmtpd/0.29) with SMTP; Mon, 14 Feb 2011 13:05:56 +0000 Received: (qmail 69005 invoked by uid 99); 14 Feb 2011 13:05:35 -0000 Received: from localhost.apache.org (HELO mail-iy0-f175.google.com) (127.0.0.1) (smtp-auth username edwardyoon, mechanism plain) by minotaur.apache.org (qpsmtpd/0.29) with ESMTP; Mon, 14 Feb 2011 13:05:35 +0000 Received: by iyj8 with SMTP id 8so4748569iyj.6 for ; Mon, 14 Feb 2011 05:05:35 -0800 (PST) MIME-Version: 1.0 Received: by 10.231.35.8 with SMTP id n8mr2899246ibd.123.1297688734966; Mon, 14 Feb 2011 05:05:34 -0800 (PST) Received: by 10.231.37.66 with HTTP; Mon, 14 Feb 2011 05:05:34 -0800 (PST) In-Reply-To: References: Date: Mon, 14 Feb 2011 22:05:34 +0900 Message-ID: Subject: Re: communication From: "Edward J. Yoon" To: hama-user@incubator.apache.org Cc: hama-dev@incubator.apache.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Oh, thanks for nice report! At this time, it looks like impossible to send one more messages on to same server in bsp() method. It's a bug. I'll fix it now. Pls, update your TRUNK. ---- To developers, See the BSPPeer.send() method. The peerName should be a InetSocketAddress, not String. Otherwise, queue will be always null. And after add msg to queue, we have to put it to "outgoingQueues" again as below: --- src/java/org/apache/hama/bsp/BSPPeer.java (revision 1069189) +++ src/java/org/apache/hama/bsp/BSPPeer.java (working copy) @@ -140,12 +140,12 @@ @Override public void send(String peerName, BSPMessage msg) throws IOException { LOG.debug("Send bytes (" + msg.getData().toString() + ") to " + peerNa= me); - ConcurrentLinkedQueue queue =3D outgoingQueues.get(peerNam= e); + ConcurrentLinkedQueue queue =3D outgoingQueues.get(getAddress(peerName)); if (queue =3D=3D null) { queue =3D new ConcurrentLinkedQueue(); - outgoingQueues.put(getAddress(peerName), queue); } queue.add(msg); + outgoingQueues.put(getAddress(peerName), queue); } On Mon, Feb 14, 2011 at 7:02 PM, Pawe=C5=82 Brach wrote= : > Hello, > > I'm attaching PiEstimator with some changes. I'm sending exactly two > messages to "master" from each node. > > =C2=A0 =C2=A0 =C2=A0 bspPeer.send(masterTask, estimate); > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 LOG.info("Send message:" + System.currentT= imeMillis()); > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 bspPeer.send(masterTask, estimate2); > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 LOG.info("Send message:" + System.currentT= imeMillis()); > > After that I'm trying to receive all messages: > =C2=A0=C2=A0=C2=A0=C2=A0 LOG.info("Num msg =3D " + bspPeer.getNumCurrentM= essages()); > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 while ((received =3D bspPeer.getCurrentMes= sage()) !=3D null) { > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 LOG.info("Receives messages:" = + Bytes.toDouble(received.getData())); > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 .... > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 } > > In the log file I see: > 2011-02-14 09:46:07,124 INFO org.apache.hama.bsp.TaskRunner: > attempt_201102140938_0003_m_000000_0 11/02/14 09:46:07 INFO > algorithms.PiEstimator$MyEstimator: Send message:1297673167123 > 2011-02-14 09:46:07,125 INFO org.apache.hama.bsp.TaskRunner: > attempt_201102140938_0003_m_000000_0 11/02/14 09:46:07 INFO > algorithms.PiEstimator$MyEstimator: Send message:1297673167125 > 2011-02-14 09:46:07,270 INFO org.apache.hama.bsp.TaskRunner: > attempt_201102140938_0003_m_000000_0 11/02/14 09:46:07 INFO > algorithms.PiEstimator$MyEstimator: Receives messages:3.1536 > 2011-02-14 09:46:07,270 INFO org.apache.hama.bsp.TaskRunner: > attempt_201102140938_0003_m_000000_0 11/02/14 09:46:07 INFO > algorithms.PiEstimator$MyEstimator: Receives messages:3.148 > 2011-02-14 09:46:07,271 INFO org.apache.hama.bsp.TaskRunner: > attempt_201102140938_0003_m_000000_0 11/02/14 09:46:07 INFO > algorithms.PiEstimator$MyEstimator: Receives messages:3.1392 > 2011-02-14 09:46:07,272 INFO org.apache.hama.bsp.TaskRunner: > attempt_201102140938_0003_m_000000_0 11/02/14 09:46:07 INFO > algorithms.PiEstimator$MyEstimator: > 2011-02-14 09:46:07,272 INFO org.apache.hama.bsp.TaskRunner: > attempt_201102140938_0003_m_000000_0 Estimated value of PI is > 3.1450000000000005 > > > On each node I see that two messages are sent (so master should receive 6 > messages - I have 3 nodes). In the log file I see only 3 records > "Receives...", so only 3 messages were processed by master task. I don' > understand why is that. > > What's more, I have tried to change line: > while ((received =3D bspPeer.getCurrentMessage()) !=3D null) { > > to > if ((received =3D bspPeer.getCurrentMessage()) !=3D null) { > > So there should be messages in the queue which are not processed. In my > opinion bsp() should be called again and again... and in consequence fall= s > in loop of calls. But it doesn't happen - bsp() method is run exactly onc= e > and framework is probably hanging after last line of the bsp() code. Coul= d > you explain this for me? > > Best regards, > Pawel > > > > 2011/2/10 Edward J. Yoon >> >> It should be possible to send multiple messages to other nodes. >> >> Could you please show me your source code and debug level log? >> > --=20 Best Regards, Edward J. Yoon http://blog.udanax.org http://twitter.com/eddieyoon