Re: [ROOT] multicasting

From: Fons Rademakers (Fons.Rademakers@cern.ch)
Date: Mon May 21 2001 - 17:22:49 MEST


Hi HP,

  a simple serial way to do it is:

{
   // open file

   while (!EOF) {
      // read N bytes (> 256 KB is efficient)

      for (node = 0; node < MAXNODES; node++) {
         socket[node]->Send(buffer);
         // if error flag node as down and continue with other nodes
      }

   }

   // close file
}

More efficient is to send the same buffer in parallel to the 50 nodes
using non-blocking sockets and a select to check when a socket it ready
to send a next message. This can be easily done with a TMonitor. For an
example of this technique see:
http://root.cern.ch/lxr/source/net/src/TPSocket.cxx#283

Cheers, Fons.

      
HP Wei wrote:
> 
> Hi rooters,
>   I want to get some ideas on how to do the following
>   in ROOT.
> 
>   Suppose there is one machine called M on which there is
>   a file (ascii or binary) named filename.
> 
>   Suppose there are another 50 machines named
>   C1, C2, ... C50.
> 
>   All these machines are on a network, and are all running
>   UNIX like OS.
> 
>   Now, I want to send (copy) the filename from M
>   onto those 50 machines by multicasting way.
> 
>   -----------
>   A skeleton code will be appreciated!
> 
> Thanks,
> HP
> 
> 
> 

-- 
Org:    CERN, European Laboratory for Particle Physics.
Mail:   1211 Geneve 23, Switzerland
E-Mail: Fons.Rademakers@cern.ch              Phone: +41 22 7679248
WWW:    http://root.cern.ch/~rdm/            Fax:   +41 22 7677910



This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:50:46 MET