Newsgroups: comp.parallel.pvm
From: souva@aibn58.astro.uni-bonn.de (Ignatios Souvatzis)
Reply-To: isouvatzis@astro.uni-bonn.de
Subject: Re: best method of transmitting many vectors (double)?
Organization: Radioastronomisches Institut der Universitaet Bonn, Bonn, FRG
Date: Thu, 2 Jun 1994 12:31:47 GMT
Message-ID: <SOUVA.94Jun2143148@aibn58.astro.uni-bonn.de>

In article <edh.770431208@epx.cis.umn.edu> edh@epx.cis.umn.edu (Eric
Hendrickson) writes:

   Hello, I am writing a ray tracer in InterViews and PVM, and I'm debating
   how to transmit many, many Vectors of type double (actually type
   ColorIntensity from InterViews) from the slave(s) to the parent process for
   viewing.  The Vectors contain RGB values, as values between 0 and 1.  What 
   I am wondering is if anyone has any advice on the best method for this.  I
   could translate each RGB element into values from 0-255 and then pass them
   to the parent (as ints).  Is there any advantage to passing ints rather
   than doubles?  

as ints: 50% savings on bandwidth.

But IF you do such a thing, you should transmit them as bytes, which
saves 87.5%.

If you need them as doubles on the receiving side, it depends on
whether you need the accuracy (then you must transmit as double),
whether your application is limited by user cpu time on the receiving
process (then you shouldn't do conversions on the receiving side).

   Should I transmit each RGB-triple one at a time, or try to group them
   somehow?  Would the unpacking be affected adversely by this?

Depends a bit...

If you use pvm_advise(PvmAllowDirect), e.g. direct tcp transmission,
sending the tripels one at a time isn't THAT bad, because the (bsd)
kernels tcp routines will group them as needed. But in general, you
should make reasonably-sized packets... usually you can pack 0.5 - 1.5
kBytes of user data per network packet, with the same overhead of ~40
bytes + what PVM needs. So sending less than about 10 doubles or 80
bytes should be avoided, if you can group the data.

Regards,
--
	Ignatios Souvatzis (also ignatios@cs.uni-bonn.de)
Cute quote: "You should also consider that the ST comes fully equipped with a 
	     text adventure. It's called ST Basic." Amylaar@meolyon.hanse.de


