/******************************************************************************
* PVM Timing - Slave Program, File: slave_tim.c
* PVM Version used: 3.3.x
* Comment: This file is an adaptation of one packaged with the PVM source.  
******************************************************************************/

#include "pvm3.h"               /* PVM version 3.0 include file */

main() {
	int mytid;		/* PVM process task id */
	int parent;		/* PVM process task id for parent */
	int ret_int[10];	/* a return message */
	int stid, stag, slen;	/* parameters needed by pvm_precv */
	int i;			/* loop index */
	
	mytid = pvm_mytid();	/* enroll worker task in PVM virtual machine */
	parent = pvm_parent();	/* get PVM task id of parent/master process */

	/* wait for message master */
	pvm_precv(parent, 1, ret_int, 10, PVM_INT, &stid, &stag, &slen);
	
	/* this loop time will be included in the master's delta_t */
	for (i=0; i<10; i++)
	  ret_int[i] = 2*ret_int[i];
	  
	/* send reply back to master */
	pvm_psend(parent, 2, ret_int, 10, PVM_INT);

	/* exit from PVM */
	pvm_exit();
	exit(0);
        
}
