/*
 *                 	Exemple "HolaUSR.c" PVM versio 3.3
 *		 Susana Maria Bajo Sanchez (ei05646@salleURL.edu)
 *		 Josep Maria Garrell i Guiu (josepmg@salleURL.edu)
 *		           Departament d'Informatica (DI)
 *				Software Paral.lel
 *	                Enginyeria i Arquitectura La Salle
 *		           Universitat Ramon Llull (URL)
 * 		                 Curs 1999/2000
*/

#include <stdio.h>
#include "pvm3.h"

void main()
{
	int ptid,msgtag;
	char buf[100];

	ptid = pvm_parent();
	printf("HolaUSR: Mi padre es el #%x\n",ptid);

	strcpy(buf,"BIENVENIDO A PVM 3.3 DESDE ");
	gethostname(buf + strlen(buf), 64);

	msgtag = 1;
	
	pvm_initsend(PvmDataDefault);
	printf("HolaUSR: He inicializado el canal\n");
	
	pvm_pkstr(buf);
	printf("HolaUSR: He empaquetado el string '%s'\n",buf);
	
	pvm_send(ptid,msgtag);
	printf("HolaUSR: He enviado el string a la tarea # %x\n",ptid);

	printf("HolaUSR: Salgo de PVM\n");
	pvm_exit();
}

