hama-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From PaweĊ‚ Brach <bras...@gmail.com>
Subject Re: communication
Date Mon, 14 Feb 2011 10:02:06 GMT
Hello,

I'm attaching PiEstimator with some changes. I'm sending exactly two
messages to "master" from each node.

      bspPeer.send(masterTask, estimate);
      LOG.info("Send message:" + System.currentTimeMillis());
      bspPeer.send(masterTask, estimate2);
      LOG.info("Send message:" + System.currentTimeMillis());

After that I'm trying to receive all messages:
     LOG.info("Num msg = " + bspPeer.getNumCurrentMessages());
      while ((received = bspPeer.getCurrentMessage()) != null) {
        LOG.info("Receives messages:" + Bytes.toDouble(received.getData()));
       ....
      }

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 = bspPeer.getCurrentMessage()) != null) {

to
if ((received = bspPeer.getCurrentMessage()) != 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 falls
in loop of calls. But it doesn't happen - bsp() method is run exactly once
and framework is probably hanging after last line of the bsp() code. Could
you explain this for me?

Best regards,
Pawel



2011/2/10 Edward J. Yoon <edwardyoon@apache.org>

> It should be possible to send multiple messages to other nodes.
>
> Could you please show me your source code and debug level log?
>
>

Mime
View raw message