Newsgroups: comp.parallel.pvm
From: Andrea OMODEO <andrea@frodo.cra.enel.it>
Subject: Chosing the best encoding
Organization: ENEL - Centro Ricerca di Automatica
Date: Wed, 10 May 1995 09:40:36 +0200
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Message-ID: <Pine.A32.3.91.950510093750.14045A-100000@frodo.cra.enel.it>

Hello,
	I have a problem that someone on the net may already have solved.
I have two PVM tasks involved in point-to-point communications.
Since the tasks can potentially reside on incompatible hosts, I am forced to
use pvm_initsend(PvmDataDefault), even if we all know that PvmDataInPlace is
much faster when hosts are compatible.

I suppose it will be possible, during program startup, to send a trial raw
message between the programs and decide which kind of encoding is needed
depending on the received values.
For instance, to check for byte ordering, i could send the int 0x01020304
and, on the receiving side:

	if (received_int == 0x01020304)
	  preferred_encoding = PvmDataInPlace;
	else
	  preferred_encoding = PvmDataDefault;

With similar tests it will be possible to check for float representation and
for any other problem.
I think this approach is more viable than simply comparing the PVM_ARCH value
(because there are many different PVM_ARCHs using the same binary
representation) and it is more suitable as long as new architectures are
added to the PVM list.

However, i'm not aware of how many incompatibilities there are (apart from
byte ordering and float representation), and I don't have access to the 
whole array of PVM-supported architectures for testing.
If someone could help me, I will publish the resulting code, both for sharing
my results and for having an army of beta-testers.

	Thanks in advance,
		Andrew.

-----------------------------------------------------------------------------
|Andrea Omodeo				e-mail: omodeo@cra.enel.it	    |
|ENEL - Centro Ricerca di Automatica		andrea@omodeo.cra.enel.it   |
|v. Volta 1 - 20093 Cologno Monzese (MI) http://www.cra.enel.it/~andrea/    |
-----------------------------------------------------------------------------


