Newsgroups: comp.parallel.pvm
From: pu@basin08.cacs.usl.edu (Putchong Uthayopas)
Subject: PET announcement
Organization: University of Southwestern Louisiana
Date: 3 Oct 1995 16:52:29 GMT
Message-ID: <44rpod$b3b@rouge.usl.edu>

********************************
*                              *
*   A N N O U N C E M E N T    *
*   PET ( Pvm Encoding Tool)   * 
*                              *
********************************


Introduction
------------

This program is a home-made utility that I developed to help me
encode the complex data structure in the form that usable
by PVM program. This will reduce a lot of errors arises from the 
misplace of pvm_pk* and pvm_upk* library call.

I'm working on a document right now and should finish briefly after this.
You can download the software from my web at
http://www.cacs.usl.edu/~pu/pet

Features 
--------

- Support most of PVM data types such as: float, double,
  char(byte), int, long , short 
- 2 data structure : structure and sequence ( see examples)
- packing of multi-dimensional array (up to 4 dimensions)
- packing of fix size array (both structure and sequence)
- packing of variable size array ( sequence only)

How it works
------------

Suppose you want to exchange the data structure such as:

struct msg1 {
	int msgtype;
	int x;
	int y;
	};

We start by writing a "Data Definition" file like this: 
#
#	Data Definition  <- Comment begin with # in the first col
#
struct msg1
{			 <- Must be on seperate line
	int msgtype
	int x
	int y
}			 <- This too...

OK. We finish and save this in file name "spec".
The next step is to translate the definition.

%pet spec
PET (Pvm Encoding Tool) 0.1 alpha
By Putchong Uthayopas (Aug 1,1995)
CACS, Univeristy of Southwestern Louisiana
001:  struct msg1
002:  {
003:  	int msgtype
004:  	int x
005:  	int y
006:  }
Total: 6 lines

Generate out put file...code generation completed
done

PET will generate 2 files, pet.h and pet.c which contain
C language declaration and C code to pack and unpack data
structure.

========== spec.h ==========
/*
 * PET (Pvm Encoding Tool) Version 0.1 alpha
 * Fri Aug 18 13:35:18 1995
 */
/*  1 data structures generated. */

struct msg1 {
	int	msgtype;
	int	x;
	int	y;
};
========== spec.c ==========
/*
 * PET (Pvm Encoding Tool) Version 0.1 alpha
 * Fri Aug 18 13:35:18 1995
 */
#include "spec.h"
/*
 * Pack and Unpack msg1
 */
int pk_msg1(p)
struct msg1 *p;
{
	pvm_pkint(&p->msgtype,1,1);
	pvm_pkint(&p->x,1,1);
	pvm_pkint(&p->y,1,1);
}

int upk_msg1(p)
struct msg1 *p;
{
	pvm_upkint(&p->msgtype,1,1);
	pvm_upkint(&p->x,1,1);
	pvm_upkint(&p->y,1,1);
}

When you write your program , just include spec.h and link the
application with spec.c. 

------------------------------------------------
For more information see: 
http://www.cacs.usl.edu/~pu/pet
Any commments and bug report are very welcome.
------------------------------------------------

