Prereq: 336
*** ../netlib/pvm3.3.6/src/patchlevel.h	Wed Dec 21 16:56:49 1994
--- src/patchlevel.h	Wed Feb 01 16:36:20 1995
***************
*** 1,3 ****
  
! #define PATCHLEVEL 336
  
--- 1,3 ----
  
! #define PATCHLEVEL 337
  
*** ../netlib/pvm3.3.6/conf/BSD386.def	Sat Jun 04 17:55:26 1994
--- conf/BSD386.def	Wed Feb 01 14:59:26 1995
***************
*** 1,4 ****
! ARCHCFLAGS	=	-DSOCKADHASLEN -DNOREXEC -DRSHCOMMAND=\"/usr/bin/rsh\"
  ARCHDLIB	=
  ARCHDOBJ	=
  ARCHLIB	=	-lrpc
--- 1,4 ----
! ARCHCFLAGS	=	-DSOCKADHASLEN -DNOREXEC -DRSHCOMMAND=\"/usr/bin/rsh\" -DHASSTDLIB
  ARCHDLIB	=
  ARCHDOBJ	=
  ARCHLIB	=	-lrpc
*** ../netlib/pvm3.3.6/console/cmds.c	Wed Nov 09 10:58:24 1994
--- console/cmds.c	Wed Feb 01 15:00:35 1995
***************
*** 137,143 ****
  	{ 0, 0, 0, 0 }
  };
  
! static char rcsid[] = "$Id: cmds.c,v 1.3 1994/10/15 18:38:56 manchek Exp $";
  
  
  freealias(ap)
--- 137,143 ----
  	{ 0, 0, 0, 0 }
  };
  
! static char rcsid[] = "$Id: cmds.c,v 1.3 1994/10/15 18:38:56 manchek Exp manchek $";
  
  
  freealias(ap)
***************
*** 456,466 ****
  	"ps           -x       show console task (default is not)",
  	"ps Output fields:",
  	"ps   HOST    host name",
- 	"ps   A.OUT   executable name",
  	"ps   TID     task id",
  	"ps   PTID    parent task id",
! 	"ps   PTID    task process id",
  	"ps   FLAG    status",
  	"ps FLAG values:",
  	"ps   f   task process is child of pvmd",
  	"ps   c   task connected to pvmd",
--- 456,466 ----
  	"ps           -x       show console task (default is not)",
  	"ps Output fields:",
  	"ps   HOST    host name",
  	"ps   TID     task id",
  	"ps   PTID    parent task id",
! 	"ps   PID     task process id",
  	"ps   FLAG    status",
+ 	"ps   COMMAND executable name",
  	"ps FLAG values:",
  	"ps   f   task process is child of pvmd",
  	"ps   c   task connected to pvmd",
*** ../netlib/pvm3.3.6/gexamples/gexamp.c	Tue Nov 30 10:40:32 1993
--- gexamples/gexamp.c	Mon Feb 06 17:55:30 1995
***************
*** 3,9 ****
--- 3,15 ----
  */
  
  #include <stdio.h>
+ #ifdef	SYSVSTR
+ #include <string.h>
+ #define RINDEX(s,c) strrchr(s,c)
+ #else
  #include <strings.h>
+ #define RINDEX(s,c) rindex(s,c)
+ #endif
  #include "pvm3.h"
  
  int
***************
*** 28,34 ****
  
  	/* join a group */
  	/* the group name is the last path of the path name */
! 	gp = rindex(argv[0],'/');
  	if (gp == 0) 
  		gp = argv[0];
  	else
--- 34,40 ----
  
  	/* join a group */
  	/* the group name is the last path of the path name */
! 	gp = RINDEX(argv[0],'/');
  	if (gp == 0) 
  		gp = argv[0];
  	else
*** ../netlib/pvm3.3.6/include/pvm3.h	Wed Dec 21 16:56:50 1994
--- include/pvm3.h	Wed Feb 01 15:01:43 1995
***************
*** 106,111 ****
--- 106,112 ----
  #define	PvmOk			0	/* Error 0 */
  #define	PvmBadParam		-2	/* Bad parameter */
  #define	PvmMismatch		-3	/* Count mismatch */
+ #define	PvmOverflow		-4	/* Value too large */
  #define	PvmNoData		-5	/* End of buffer */
  #define	PvmNoHost		-6	/* No such host */
  #define	PvmNoFile		-7	/* No such file */
*** ../netlib/pvm3.3.6/lib/aimk	Fri Jun 03 15:47:36 1994
--- lib/aimk	Tue Feb 07 09:43:50 1995
***************
*** 59,78 ****
  if [ $makeincwd = 0 -a \( -f $PVM_ARCH/Makefile -o -f $PVM_ARCH/makefile \) ]; then
  	echo making in $PVM_ARCH/ for $PVM_ARCH
  	cd $PVM_ARCH
! 	exec make PVM_ARCH=$PVM_ARCH $@
  
  else
! 	if [ -f Makefile.aimk ]; then
  		if [ ! -d $PVM_ARCH ]; then
  			mkdir $PVM_ARCH
  		fi
  		echo making in $PVM_ARCH/ for $PVM_ARCH
  		cd $PVM_ARCH
! 		exec make -f $PVM_ROOT/conf/$PVM_ARCH.def -f ../Makefile.aimk PVM_ARCH=$PVM_ARCH $@
  
  	else
  		echo making in . for $PVM_ARCH
! 		exec make PVM_ARCH=$PVM_ARCH $@
  	fi
  fi
  
--- 59,90 ----
  if [ $makeincwd = 0 -a \( -f $PVM_ARCH/Makefile -o -f $PVM_ARCH/makefile \) ]; then
  	echo making in $PVM_ARCH/ for $PVM_ARCH
  	cd $PVM_ARCH
! 	if [ "$*" = "" ]; then
! 		exec make PVM_ARCH=$PVM_ARCH
! 	else
! 		exec make PVM_ARCH=$PVM_ARCH "$@"
! 	fi
  
  else
! 	if [ $makeincwd = 0 -a -f Makefile.aimk ]; then
  		if [ ! -d $PVM_ARCH ]; then
  			mkdir $PVM_ARCH
  		fi
  		echo making in $PVM_ARCH/ for $PVM_ARCH
  		cd $PVM_ARCH
! 		if [ "$*" = "" ]; then
! 			exec make -f $PVM_ROOT/conf/$PVM_ARCH.def -f ../Makefile.aimk PVM_ARCH=$PVM_ARCH
! 		else
! 			exec make -f $PVM_ROOT/conf/$PVM_ARCH.def -f ../Makefile.aimk PVM_ARCH=$PVM_ARCH "$@"
! 		fi
  
  	else
  		echo making in . for $PVM_ARCH
! 		if [ "$*" = "" ]; then
! 			exec make PVM_ARCH=$PVM_ARCH "$@"
! 		else
! 			exec make PVM_ARCH=$PVM_ARCH "$@"
! 		fi
  	fi
  fi
  
*** ../netlib/pvm3.3.6/lib/debugger2	Sun Sep 04 16:25:27 1994
--- lib/debugger2	Wed Feb 01 15:38:41 1995
***************
*** 60,65 ****
--- 60,70 ----
  	set DBFF=""
  	breaksw
  
+ case CSPP:
+ 	set DBCMD="cxdb"
+ 	set DBFF="-nw "
+ 	breaksw
+ 
  default:
  # ALPHA PMAX SYMM RS6K
  	breaksw
*** ../netlib/pvm3.3.6/lib/pvmgetarch	Wed Dec 21 16:56:50 1994
--- lib/pvmgetarch	Wed Feb 01 15:39:57 1995
***************
*** 8,23 ****
  # to time.  I don't know of a real solution to determining the
  # machine type.  Claims to pick one of:
  #   AFX8, ALPHA, ALPHAMP, BFLY, BSD386, CM2, CM5, CNVX, CNVXN,
! #   CRAY, CRAY2, CRAYSMP, DGAV, E88K, HP300, HPPA, I860, KSR1, LINUX,
  #   MASPAR, MIPS, NEXT, PGON, PMAX, POWER4, RS6K, RT, SGI, SGI5, SGIMP,
  #   SUN2, SUN3, SUN4, SUN4SOL2, SUNMP, SX3, SYMM, TITN, UVAX, VAX,
  #   UNKNOWN
  # Need to do:
! #   BAL, CSPP, IPSC2, VCM2
  #
  # Notes:
  #   1. Local people mess with things.
  #   2. It's good to try a few things for robustness.
  #
  # 08 Apr 1993  Robert Manchek  manchek@CS.UTK.EDU.
  # 24 Aug 1994  last revision
--- 8,24 ----
  # to time.  I don't know of a real solution to determining the
  # machine type.  Claims to pick one of:
  #   AFX8, ALPHA, ALPHAMP, BFLY, BSD386, CM2, CM5, CNVX, CNVXN,
! #   CRAY, CRAY2, CRAYSMP, CSPP, DGAV, E88K, HP300, HPPA, I860, KSR1, LINUX,
  #   MASPAR, MIPS, NEXT, PGON, PMAX, POWER4, RS6K, RT, SGI, SGI5, SGIMP,
  #   SUN2, SUN3, SUN4, SUN4SOL2, SUNMP, SX3, SYMM, TITN, UVAX, VAX,
  #   UNKNOWN
  # Need to do:
! #   BAL, IPSC2, VCM2
  #
  # Notes:
  #   1. Local people mess with things.
  #   2. It's good to try a few things for robustness.
+ #   3. Don't use test -x
  #
  # 08 Apr 1993  Robert Manchek  manchek@CS.UTK.EDU.
  # 24 Aug 1994  last revision
***************
*** 162,167 ****
--- 163,169 ----
  fi
  if [ "$ARCH" = PMAX -a -d /usr/maspar ]; then ARCH=MASPAR; fi
  if [ "$ARCH" = RS6K -a -d /usr/lpp/power4 ]; then ARCH=POWER4; fi
+ if [ "$ARCH" = HPPA -a -f /bin/sysinfo ]; then ARCH=CSPP; fi
  
  #
  # ugh, done.
*** ../netlib/pvm3.3.6/man/man3/pvm_pack.3	Wed Nov 09 10:58:30 1994
--- man/man3/pvm_pack.3	Wed Feb 01 15:03:16 1995
***************
*** 229,234 ****
--- 229,238 ----
  		the available memory on this host.
  	PvmNoBuf	There is no active send buffer to pack into.
  		Try calling pvm_initsend before packing message.
+ 	PvmOverflow	A data element is too large for the encoding format.
+ 		This can happen when packing a long integer in
+ 		PvmDataDefault format on a machine with 8-byte long
+ 		ints.
  .fi
  .SH SEE ALSO
  pvm_unpack(3PVM),
*** ../netlib/pvm3.3.6/man/man3/pvm_reduce.3	Wed Nov 09 10:58:31 1994
--- man/man3/pvm_reduce.3	Mon Feb 06 11:31:54 1995
***************
*** 1,4 ****
! .TH REDUCE 3PVM "20 April, 1994"
  .SH NAME
  pvm_reduce \- Performs a reduction operation over members of the specified group. 
  
--- 1,4 ----
! .TH REDUCE 3PVM "6 February, 1995"
  .SH NAME
  pvm_reduce \- Performs a reduction operation over members of the specified group. 
  
***************
*** 22,27 ****
--- 22,28 ----
  global data. Predefined are PvmMax, PvmMin, PvmSum, and PvmProduct.
  Users can define their own function.
  .br
+ 
    SYNOPSIS for func
  .br
    C   void func(int *datatype, void *x, void *y, 
***************
*** 34,44 ****
--- 35,50 ----
  Pointer to the starting address of an array of local values.
  On return, the data array on the root will be overwritten
  with the result of the reduce operation over the group.
+ For the other (non-root) members of the group the values
+ of the data array upon return from the reduce operation
+ are not defined; the values may be different than 
+ those originally passed to pvm_reduce.
  .br
  .IP count
  Integer specifying the number of elements of 
  .I datatype 
  in the data array.
+ The value of count should agree between all members of the group.
  .br
  .IP datatype 
  Integer specifying the type of the entries in the data array.
***************
*** 61,73 ****
  
  .SH DISCUSSION
  .I pvm_reduce() 
! performs global operations such as max, min, and sum
! over all the tasks in a group. All group members call pvm_reduce()
! with their local data, and the result of the reduction operation
! appears on the user specified root task
! .I root. 
! The root task is identified by its instance number in the group.
  .PP
  PVM supplies the following predefined functions 
  that can be specified in
  .I func.
--- 67,90 ----
  
  .SH DISCUSSION
  .I pvm_reduce() 
! performs global operations such as max, min, sum, or a 
! user provided operation on the data provided
! by the members of a group. 
! All group members call pvm_reduce with the same size local
! .I data 
! array which may contain one or more entries.
! The 
! .I root
! task is identified by its instance number in the group.
  .PP
+ The inner workings of the pvm_reduce call are implementation dependent;
+ however, when the pvm_reduce call completes, the root's data 
+ array will be equal to the specified operation applied elementwise to
+ the data arrays of all the group members.
+ .PP
+ A broadcast by the root can be used if the other members of the group 
+ need the resultant value(s).
+ .PP
  PVM supplies the following predefined functions 
  that can be specified in
  .I func.
***************
*** 100,106 ****
             PVM_LONG  
  .fi
  .PP
! A user defined function may be used used in 
  .I func.
  The argument func is a function with four arguments.  It is the base 
  function used for the reduction operation.  Both x and y are
--- 117,123 ----
             PVM_LONG  
  .fi
  .PP
! A user defined function may be used in 
  .I func.
  The argument func is a function with four arguments.  It is the base 
  function used for the reduction operation.  Both x and y are
***************
*** 109,131 ****
  The arguments x and num correspond to data and count above.
  The argument y contains received values.
  .PP
! Note: pvm_reduce() does not block.  If a task calls pvm_reduce and then
! leaves the group before the root has called pvm_reduce an error may occur.
  .PP
  The current algorithm is very simple and robust.  A future implementation
  may make more efficient use of the architecture to allow greater
  parallelism.
  
  
  .SH EXAMPLES
  .nf
  C:
!    info =  pvm_reduce(PvmMax, &myvals, 10, PVM_INT,
!                       msgtag, "workers", rootginst);
  .sp
  Fortran:
!    CALL PVMFREDUCE(PvmMax, MYVALS, COUNT, INTEGER4,
!   &                MTAG, 'workers', ROOT, INFO)
  .fi
  
  .SH ERRORS
--- 126,194 ----
  The arguments x and num correspond to data and count above.
  The argument y contains received values.
  .PP
! Caveat: pvm_reduce() does not block, a call to pvm_barrier may be necessary.
! For example,
! an error may occur if a task calls pvm_reduce and then leaves the group 
! before the root has completed its call to pvm_reduce.
! Similarly, an error may occur if a task joins the group after the root 
! has issued its call to pvm_reduce.
! Synchronization of the tasks (such as a call to pvm_barrier) was not 
! included within the pvm_reduce implementation since this overhead 
! is unnecessary in many user codes (which may already synchronize
! the tasks for other purposes).
  .PP
  The current algorithm is very simple and robust.  A future implementation
  may make more efficient use of the architecture to allow greater
  parallelism.
  
+ .SH ILLUSTRATION
+ .PP
+ The following example illustrates a call to pvm_reduce.
+ Suppose you have three group members (instance numbers 0, 1, 2)
+ with an array called Idata with 5 values as specified:
+ .PP
+ .nf
+      instance       the 5 values in the integer array
+         0                1,   2,   3,   4,   5
+         1               10,  20,  30,  40,  50
+         2              100, 200, 300, 400, 500
+ .fi
  
+ .PP
+ And, suppose that a call to reduce (such as the ones following) are
+ issued where the root is the group member with instance value of 1:
+ .PP
+ .nf
+    C:
+       root = 1;
+       info = pvm_reduce(PvmSum, &Idata, 5, PVM_INT, msgtag, 
+                         "worker", root);
+    Fortran:
+       root = 1
+       call pvmfreduce(PvmSum, Idata, 5, INTEGER4, msgtag, 
+                       "worker", root, info)
+ .fi
+ 
+ .PP
+ Then, upon completion of the reduce call, the following will result:
+ .PP
+ .nf
+      instance       the 5 values in the integer array
+         0              .... not defined.......
+         1              111, 222, 333, 444, 555
+         2              .... not defined ......
+ .fi
+ 
+ 
  .SH EXAMPLES
  .nf
  C:
!    info =  pvm_reduce(PvmMax, &myvals, 10, PVM_FLOAT,
!                       msgtag, "worker", rootginst);
  .sp
  Fortran:
!    CALL PVMFREDUCE(PvmMax, MYVALS, COUNT, REAL4,
!   &                MTAG, 'worker', ROOT, INFO)
  .fi
  
  .SH ERRORS
*** ../netlib/pvm3.3.6/patches/Contents	Wed Dec 21 16:56:51 1994
--- patches/Contents	Tue Feb 07 15:14:06 1995
***************
*** 1,5 ****
! patch #5
  version:
      3.3.5 -> 3.3.6
  files:
      patch  src/patchlevel.h
--- 1,63 ----
! patch #7
  version:
+     3.3.6 -> 3.3.7
+ files:
+     patch  src/patchlevel.h
+     patch  conf/BSD386.def
+     patch  console/cmds.c
+     patch  gexamples/gexamp.c
+     patch  include/pvm3.h
+     patch  lib/aimk
+     patch  lib/debugger2
+     patch  lib/pvmgetarch
+     patch  man/man3/pvm_pack.3
+     patch  man/man3/pvm_reduce.3
+     patch  patches/Contents
+     patch  src/CM5/pvmdmimd.c
+     patch  src/I860/pvmdmimd.c
+     patch  src/PGON/pvmdmimd.c
+     patch  src/ddpro.c
+     patch  src/global.h
+     patch  src/lpvm.c
+     patch  src/lpvmgen.c
+     patch  src/lpvmmimd.c
+     patch  src/lpvmpack.c
+     patch  src/lpvmshmem.c
+     patch  src/pvmd.c
+     patch  src/pvmdmp.h
+     patch  src/pvmdshmem.c
+     patch  src/startup.c
+     patch  src/task.c
+ what:
+     . pvmd-pvmd' protocol is reset after adding hosts - caused pvm_addhosts()
+       to return PvmDSysErr on Solaris machines.
+     . pvmd-pvmd UDP mtu is set correctly on shared-memory machines -
+       caused complaints about bogus packets.
+     . better cleanup of message buffers in shared-memory pvmendtask.
+       caused some applications to hang.
+     . shared-memory port now responds to control messages, denies direct TCP
+       routes - caused mixed-architecture applications to hang.
+     . shared-memory ports now pass environment variables to tasks through
+       spawn.
+     . call task_cleanup and task_free in CM5 mpp_free -
+       tasks weren't getting marked dead.
+     . some machines with wait3() don't have struct rusage.  added
+       ifdef RUSAGE_SELF around declaration.  this isn't quite right,
+       but it's more conservative.
+     . connect() calls in libpvm protected against EINTR.
+     . range is checked in pvm_pklong() if XDR fails.  PvmOverflow is returned
+       instead of PvmNoMem.
+     . pvm_hostsync() frees its message buffers - was a small memory leak.
+     . cleaned up loop in dm_execack() - tids of spawned tasks were returned
+       in reverse order.
+     . aimk has quotes around "$@" so multiple parameters can be passed to
+       make without being interpreted by aimk.
+     . aimk -here forces compilation in . even if Makefile.aimk exists.
+     . added CSPP to pvmgetarch and lib/debugger2.
+     . new reduce man page.
+     . console help text updated - ps fields were wrong.
+ patch #6
+ version:
      3.3.5 -> 3.3.6
  files:
      patch  src/patchlevel.h
***************
*** 38,43 ****
--- 96,102 ----
      . "EOF on pvmd sock" message no longer printed on halt.
      . fixed typo in pvm_joingroup.3 man page.
      . include <stdlib.h> in various examples.
+ patch #5
  version:
      3.3.4 -> 3.3.5
  files:
*** ../netlib/pvm3.3.6/src/CM5/pvmdmimd.c	Wed Dec 21 16:56:52 1994
--- src/CM5/pvmdmimd.c	Sun Feb 05 23:39:18 1995
***************
*** 36,42 ****
   *			argc, argv: passed from main.
   *
   *		int mpp_load(int flags, char *name, char *argv, int count, int tids[],
!  *					int ptid):
   *			Load executable onto nodes; create new entries in task table,
   *			encode node number and process type into task IDs, etc.
   *
--- 36,42 ----
   *			argc, argv: passed from main.
   *
   *		int mpp_load(int flags, char *name, char *argv, int count, int tids[],
!  *					int ptid, int nenv, char **envp):
   *			Load executable onto nodes; create new entries in task table,
   *			encode node number and process type into task IDs, etc.
   *
***************
*** 86,91 ****
--- 86,97 ----
   *			tid: task ID.
   *
  $Log: pvmdmimd.c,v $
+  * Revision 1.6  1995/02/06  04:39:00  manchek
+  * call task_cleanup and task_free in mpp_free instead of setting TF_CLOSE
+  *
+  * Revision 1.5  1995/02/01  20:45:59  manchek
+  * added nenv and envp args to mpp_load
+  *
   * Revision 1.4  1994/12/21  15:56:15  manchek
   * mpp_load() assigns t_out of host process to tasks.
   * allows output collection.
***************
*** 155,161 ****
  
  /* private */
  
! static char rcsid[] = "$Id: pvmdmimd.c,v 1.4 1994/12/21 15:56:15 manchek Exp $";
  static struct nodeset *busynodes;	/* active nodes; ordered by proc type */
  static char etext[512];			/* scratch for error log */
  static int ptypemask;			/* mask; we use these bits of ptype in tids */
--- 161,167 ----
  
  /* private */
  
! static char rcsid[] = "$Id: pvmdmimd.c,v 1.6 1995/02/06 04:39:00 manchek Exp $";
  static struct nodeset *busynodes;	/* active nodes; ordered by proc type */
  static char etext[512];			/* scratch for error log */
  static int ptypemask;			/* mask; we use these bits of ptype in tids */
***************
*** 247,254 ****
  				/* ptype cannot be recycled */
  					busynodes->n_ptype = sp->n_ptype + 1;
  #endif
! 				if (tp = task_find(sp->n_ptid))
! 					tp->t_flag |= TF_CLOSE;
  				LISTDELETE(sp, n_link, n_rlink);
  				PVM_FREE(sp);
  			}
--- 253,268 ----
  				/* ptype cannot be recycled */
  					busynodes->n_ptype = sp->n_ptype + 1;
  #endif
! 				if (tp = task_find(sp->n_ptid)) {
! 				/* 
! 				 * Setting TF_CLOSE would work if the last task calls pvm_exit.
! 				 * If the task is killed by pvm_kill, however, pvmd will never 
! 				 * realize the flag has been set, because no more msg will
! 				 * be sent to or received from pvmhost.
! 				 */
! 					task_cleanup(tp);
! 					task_free(tp);
! 				}
  				LISTDELETE(sp, n_link, n_rlink);
  				PVM_FREE(sp);
  			}
***************
*** 261,267 ****
  
  /* load executable onto the given set of nodes */
  int
! mpp_load(flags, name, argv, count, tids, ptid)
  	int flags;              /* exec options */
  	char *name;             /* executable */
  	char **argv;            /* arg list (argv[-1] must be there) */
--- 275,281 ----
  
  /* load executable onto the given set of nodes */
  int
! mpp_load(flags, name, argv, count, tids, ptid, nenv, envp)
  	int flags;              /* exec options */
  	char *name;             /* executable */
  	char **argv;            /* arg list (argv[-1] must be there) */
***************
*** 268,273 ****
--- 282,289 ----
  	int count;				/* how many */
  	int tids[];				/* array to store new tids */
  	int ptid;				/* parent task ID */
+ 	int nenv;				/* length of environment */
+ 	char **envp;			/* environment strings */
  {
  	int j;
  	int ptypepart;
*** ../netlib/pvm3.3.6/src/I860/pvmdmimd.c	Wed Nov 09 10:58:35 1994
--- src/I860/pvmdmimd.c	Wed Feb 01 15:48:34 1995
***************
*** 38,43 ****
--- 38,46 ----
   *		deleted loclinput(), and merged loclinpkt() into pvmd.c
   *
  $Log: pvmdmimd.c,v $
+  * Revision 1.5  1995/02/01  20:48:41  manchek
+  * added nenv and envp args to mpp_load
+  *
   * Revision 1.4  1994/11/07  21:21:28  manchek
   * Modify mpp_input() to handle DataInPlace properly.
   * Fix a bug in the way cube id is computed in mpp_mcast()
***************
*** 117,123 ****
  
  /* private */
  
! static char rcsid[] = "$Id: pvmdmimd.c,v 1.4 1994/11/07 21:21:28 manchek Exp $";
  static char     etext[512];		/* scratch for error log */
  static long 	isendmid = -1;	/* msg ID returned by isend() */
  static struct pkt *outpkt = 0;	/* packet being sent */
--- 120,126 ----
  
  /* private */
  
! static char rcsid[] = "$Id: pvmdmimd.c,v 1.5 1995/02/01 20:48:41 manchek Exp $";
  static char     etext[512];		/* scratch for error log */
  static long 	isendmid = -1;	/* msg ID returned by isend() */
  static struct pkt *outpkt = 0;	/* packet being sent */
***************
*** 202,208 ****
  */
  }
  
! mpp_load(flags, name, argv, count, tids, ptid)
      int flags;              /* exec options */
      char *name;             /* executable */
      char **argv;            /* arg list (argv[-1] must be there) */
--- 205,211 ----
  */
  }
  
! mpp_load(flags, name, argv, count, tids, ptid, nenv, envp)
      int flags;              /* exec options */
      char *name;             /* executable */
      char **argv;            /* arg list (argv[-1] must be there) */
***************
*** 209,214 ****
--- 212,219 ----
      int count;              /* how many */
      int tids[];             /* array to store new tids */
      int ptid;               /* parent task ID */
+ 	int nenv;				/* length of environment */
+ 	char **envp;			/* environment strings */
  {
  	char path[MAXPATHLEN];
  	struct stat sb;
*** ../netlib/pvm3.3.6/src/PGON/pvmdmimd.c	Wed Nov 09 10:58:36 1994
--- src/PGON/pvmdmimd.c	Wed Feb 01 15:50:58 1995
***************
*** 36,42 ****
   *			argc, argv: passed from main.
   *
   *		int mpp_load(int flags, char *name, char *argv, int count, int tids[],
!  *					int ptid):
   *			Load executable onto nodes; create new entries in task table,
   *			encode node number and process type into task IDs, etc.
   *
--- 36,42 ----
   *			argc, argv: passed from main.
   *
   *		int mpp_load(int flags, char *name, char *argv, int count, int tids[],
!  *					int ptid, int nenv, char **envp):
   *			Load executable onto nodes; create new entries in task table,
   *			encode node number and process type into task IDs, etc.
   *
***************
*** 92,97 ****
--- 92,100 ----
   *      deleted loclinput(), and merged loclinpkt() into pvmd.c
   *
  $Log: pvmdmimd.c,v $
+  * Revision 1.5  1995/02/01  20:51:05  manchek
+  * added nenv and envp args to mpp_load
+  *
   * Revision 1.4  1994/11/07  21:30:45  manchek
   * Modify mpp_output() and mpp_mcast() to send a null packet to alert precv().
   * Modify mpp_input() to handle DataInPlace properly.
***************
*** 162,168 ****
  
  /* private */
  
! static char rcsid[] = "$Id: pvmdmimd.c,v 1.4 1994/11/07 21:30:45 manchek Exp $";
  static struct nodeset *busynodes;	/* active nodes; ordered by proc type */
  static char etext[512];			/* scratch for error log */
  static int ptypemask;			/* mask; we use these bits of ptype in tids */
--- 165,171 ----
  
  /* private */
  
! static char rcsid[] = "$Id: pvmdmimd.c,v 1.5 1995/02/01 20:51:05 manchek Exp $";
  static struct nodeset *busynodes;	/* active nodes; ordered by proc type */
  static char etext[512];			/* scratch for error log */
  static int ptypemask;			/* mask; we use these bits of ptype in tids */
***************
*** 317,323 ****
  
  /* load executable onto the given set of nodes */
  int
! mpp_load(flags, name, argv, count, tids, ptid)
  	int flags;              /* exec options */
  	char *name;             /* executable */
  	char **argv;            /* arg list (argv[-1] must be there) */
--- 320,326 ----
  
  /* load executable onto the given set of nodes */
  int
! mpp_load(flags, name, argv, count, tids, ptid, nenv, envp)
  	int flags;              /* exec options */
  	char *name;             /* executable */
  	char **argv;            /* arg list (argv[-1] must be there) */
***************
*** 324,329 ****
--- 327,334 ----
  	int count;				/* how many */
  	int tids[];				/* array to store new tids */
  	int ptid;				/* parent task ID */
+ 	int nenv;				/* length of environment */
+ 	char **envp;			/* environment strings */
  {
      char path[MAXPATHLEN];
      struct stat sb;
*** ../netlib/pvm3.3.6/src/ddpro.c	Wed Nov 09 10:58:37 1994
--- src/ddpro.c	Wed Feb 01 16:04:04 1995
***************
*** 32,37 ****
--- 32,42 ----
   *	Entry points for messages from network.
   *
  $Log: ddpro.c,v $
+  * Revision 1.8  1995/02/01  21:03:07  manchek
+  * addhosts returns PvmDSysErr instead of -1 if something breaks.
+  * mpp_load is called with environment so it can be passed to tasks.
+  * dm_execack processes received tids in order instead of backwards
+  *
   * Revision 1.7  1994/10/15  19:02:36  manchek
   * cast message tags for comparison as integer.
   * send output and trace open messages for dmp and shmem ports.
***************
*** 123,129 ****
   **           **
   ***************/
  
! static char rcsid[] = "$Id: ddpro.c,v 1.7 1994/10/15 19:02:36 manchek Exp $";
  static char pvmtxt[512];			/* scratch for error log */
  
  int dm_add();
--- 128,134 ----
   **           **
   ***************/
  
! static char rcsid[] = "$Id: ddpro.c,v 1.8 1995/02/01 21:03:07 manchek Exp $";
  static char pvmtxt[512];			/* scratch for error log */
  
  int dm_add();
***************
*** 726,732 ****
  		wait_delete(wp);
  	}
  	busyadding = 0;
! 	pkint(rmp, -1);
  	sendmessage(rmp);
  	return 0;
  }
--- 731,737 ----
  		wait_delete(wp);
  	}
  	busyadding = 0;
! 	pkint(rmp, PvmDSysErr);
  	sendmessage(rmp);
  	return 0;
  }
***************
*** 865,871 ****
  
  #if defined(IMA_PGON) || defined(IMA_I860) || defined(IMA_CM5) || defined(SHMEM)
  
! #ifndef SHMEM
  /* XXX only writing the first tid, oops. */
  	if (flags & PvmMppFront) {
  		/* spawn on service node */
--- 870,879 ----
  
  #if defined(IMA_PGON) || defined(IMA_I860) || defined(IMA_CM5) || defined(SHMEM)
  
! #ifdef SHMEM
! 	mpp_load(flags, av[0], av, count, tids, ptid, nenv, env);
! 
! #else /*SHMEM*/
  /* XXX only writing the first tid, oops. */
  	if (flags & PvmMppFront) {
  		/* spawn on service node */
***************
*** 876,883 ****
  			tids[0] = tp->t_tid;
  		}
  	} else
  #endif /*SHMEM*/
- 		mpp_load(flags, av[0], av, count, tids, ptid);
  
  	for (i = 0; i < count; i++) {
  		if (tids[i] < 0)
--- 884,891 ----
  			tids[0] = tp->t_tid;
  		}
  	} else
+ 		mpp_load(flags, av[0], av, count, tids, ptid, nenv, env);
  #endif /*SHMEM*/
  
  	for (i = 0; i < count; i++) {
  		if (tids[i] < 0)
***************
*** 1051,1062 ****
  	int tid;
  	int v;
  	int err = 0;
  
  	if (!(wp = wait_get(hp, mp, WT_SPAWN)))
  		return 0;
  
  	wxp = (struct waitc_spawn*)wp->wa_spec;
! 	upkint(mp, &rcnt);
  	v = wxp->w_veclen;
  
  	/*
--- 1059,1072 ----
  	int tid;
  	int v;
  	int err = 0;
+ 	int i;
  
  	if (!(wp = wait_get(hp, mp, WT_SPAWN)))
  		return 0;
  
  	wxp = (struct waitc_spawn*)wp->wa_spec;
! 	if (upkint(mp, &rcnt))
! 		goto bad;
  	v = wxp->w_veclen;
  
  	/*
***************
*** 1068,1087 ****
  			hp->hd_hostpart, v, rcnt);
  	pvmlogerror(pvmtxt);
  */
  	while (rcnt-- > 0) {
! 		upkint(mp, &tid);
  		if (tid < 0)
  			err++;
! 		while (--v >= 0)
! 			if (wxp->w_vec[v] == hp->hd_hostpart)
! 				break;
! 		if (v < 0) {
! /* XXX aargh */
! 			pvmlogerror("dm_execack() too many tids for result vector, hosing the request\n");
  			wait_delete(wp);
  			return 0;
  		}
! 		wxp->w_vec[v] = tid;
  	}
  
  	if (err)
--- 1078,1097 ----
  			hp->hd_hostpart, v, rcnt);
  	pvmlogerror(pvmtxt);
  */
+ 	i = 0;
  	while (rcnt-- > 0) {
! 		if (upkint(mp, &tid))
! 			goto bad;
  		if (tid < 0)
  			err++;
! 		while (i < v && wxp->w_vec[i] != hp->hd_hostpart)
! 			i++;
! 		if (i == v) {
! 			pvmlogerror("dm_execack() tids don't fit result vector?\n");
  			wait_delete(wp);
  			return 0;
  		}
! 		wxp->w_vec[i++] = tid;
  	}
  
  	if (err)
***************
*** 1094,1099 ****
--- 1104,1115 ----
  
  	if (wp->wa_peer == wp)
  		assign_tasks(wp);
+ 	wait_delete(wp);
+ 	return 0;
+ 
+ bad:
+ 	sprintf(pvmtxt, "dm_execack() from 0x%x bad msg format\n", mp->m_src);
+ 	pvmlogerror(pvmtxt);
  	wait_delete(wp);
  	return 0;
  }
*** ../netlib/pvm3.3.6/src/global.h	Wed Dec 21 16:56:52 1994
--- src/global.h	Fri Feb 03 11:46:51 1995
***************
*** 32,37 ****
--- 32,40 ----
   *	Generic includes.
   *
  $Log: global.h,v $
+  * Revision 1.16  1995/02/03  16:46:47  manchek
+  * version 3.3.7
+  *
   * Revision 1.15  1994/12/21  21:27:34  manchek
   * version 3.3.6
   *
***************
*** 82,88 ****
  
  /* release version */
  
! #define	PVM_VER	"3.3.6"
  
  /* UDPMAXLEN should be set to the largest UDP message length
     your system can handle. */
--- 85,91 ----
  
  /* release version */
  
! #define	PVM_VER	"3.3.7"
  
  /* UDPMAXLEN should be set to the largest UDP message length
     your system can handle. */
*** ../netlib/pvm3.3.6/src/lpvm.c	Wed Dec 21 16:56:52 1994
--- src/lpvm.c	Wed Feb 01 16:08:40 1995
***************
*** 32,37 ****
--- 32,41 ----
   *	Libpvm core for unix environment.
   *
  $Log: lpvm.c,v $
+  * Revision 1.15  1995/02/01  21:08:46  manchek
+  * error 4 is now PvmOverflow.
+  * connect is retried in case of EINTR
+  *
   * Revision 1.14  1994/12/20  16:28:19  manchek
   * added PvmShowTids case to setopt.
   * removed EOF message on pvmd socket close
***************
*** 208,214 ****
  		"Error 1",
  	"Bad parameter",
  	"Count mismatch",
! 		"Error 4",				/* not used */
  	"End of buffer",
  	"No such host",
  	"No such file",
--- 212,218 ----
  		"Error 1",
  	"Bad parameter",
  	"Count mismatch",
! 	"Value too large",
  	"End of buffer",
  	"No such host",
  	"No such file",
***************
*** 274,280 ****
   **           **
   ***************/
  
! static char rcsid[] = "$Id: lpvm.c,v 1.14 1994/12/20 16:28:19 manchek Exp $";
  static int debugmask = 0;				/* which debugging info */
  static int mxfersingle = 1;				/* mxfer returns after single frag */
  static char pvmtxt[512];				/* scratch for error log */
--- 278,284 ----
   **           **
   ***************/
  
! static char rcsid[] = "$Id: lpvm.c,v 1.15 1995/02/01 21:08:46 manchek Exp $";
  static int debugmask = 0;				/* which debugging info */
  static int mxfersingle = 1;				/* mxfer returns after single frag */
  static char pvmtxt[512];				/* scratch for error log */
***************
*** 819,838 ****
  				BZERO((char*)&uns, sizeof(uns));
  				uns.sun_family = AF_UNIX;
  				strcpy(uns.sun_path, buf);
! 				if (connect(pcbp->tt_fd, (struct sockaddr*)&uns,
! 						sizeof(uns)) == -1) {
  					pvmlogperror("pvmmctl() connect");
! 
! 				} else {
  					pcbp->tt_state = TTOPEN;
- 				}
  #endif /*NOUNIXDOM*/
  
  			} else {
  				pcbp->tt_osad.sin_family = AF_INET;
  				hex_inadport(buf, &pcbp->tt_osad);
! 				if (connect(pcbp->tt_fd, (struct sockaddr*)&pcbp->tt_osad,
! 						sizeof(pcbp->tt_osad)) == -1) {
  					pvmlogperror("pvmmctl() connect");
  
  				} else {
--- 823,847 ----
  				BZERO((char*)&uns, sizeof(uns));
  				uns.sun_family = AF_UNIX;
  				strcpy(uns.sun_path, buf);
! 				while ((i = connect(pcbp->tt_fd, (struct sockaddr*)&uns,
! 						sizeof(uns))) == -1
! 						&& errno == EINTR)
! 					;
! 				if (i == -1)
  					pvmlogperror("pvmmctl() connect");
! 				else
  					pcbp->tt_state = TTOPEN;
  #endif /*NOUNIXDOM*/
  
  			} else {
  				pcbp->tt_osad.sin_family = AF_INET;
  				hex_inadport(buf, &pcbp->tt_osad);
! 				while ((i = connect(pcbp->tt_fd,
! 						(struct sockaddr*)&pcbp->tt_osad,
! 						sizeof(pcbp->tt_osad))) == -1
! 						&& errno == EINTR)
! 					;
! 				if (i == -1) {
  					pvmlogperror("pvmmctl() connect");
  
  				} else {
***************
*** 1022,1029 ****
  						BZERO((char*)&uns, sizeof(uns));
  						uns.sun_family = AF_UNIX;
  						strcpy(uns.sun_path, buf);
! 						if (connect(pcbp->tt_fd, (struct sockaddr*)&uns,
! 								sizeof(uns)) == -1) {
  							pvmlogperror("pvmmctl() connect");
  							ackd = 1;
  
--- 1031,1041 ----
  						BZERO((char*)&uns, sizeof(uns));
  						uns.sun_family = AF_UNIX;
  						strcpy(uns.sun_path, buf);
! 						while ((i = connect(pcbp->tt_fd, (struct sockaddr*)&uns,
! 								sizeof(uns))) == -1
! 								&& errno == EINTR)
! 							;
! 						if (i == -1) {
  							pvmlogperror("pvmmctl() connect");
  							ackd = 1;
  
***************
*** 1047,1055 ****
  					} else {
  						pcbp->tt_osad.sin_family = AF_INET;
  						hex_inadport(buf, &pcbp->tt_osad);
! 						if (connect(pcbp->tt_fd,
  								(struct sockaddr*)&pcbp->tt_osad,
! 								sizeof(pcbp->tt_osad)) == -1) {
  							pvmlogperror("pvmmctl() connect");
  							ackd = 1;
  
--- 1059,1070 ----
  					} else {
  						pcbp->tt_osad.sin_family = AF_INET;
  						hex_inadport(buf, &pcbp->tt_osad);
! 						while ((i = connect(pcbp->tt_fd,
  								(struct sockaddr*)&pcbp->tt_osad,
! 								sizeof(pcbp->tt_osad))) == -1
! 								&& errno == EINTR)
! 							;
! 						if (i == -1) {
  							pvmlogperror("pvmmctl() connect");
  							ackd = 1;
  
*** ../netlib/pvm3.3.6/src/lpvmgen.c	Wed Nov 09 10:58:39 1994
--- src/lpvmgen.c	Wed Feb 01 16:10:22 1995
***************
*** 32,37 ****
--- 32,40 ----
   *	Libpvm generic functions.
   *
  $Log: lpvmgen.c,v $
+  * Revision 1.7  1995/02/01  21:10:33  manchek
+  * pvm_hostsync didn't free its message buffers
+  *
   * Revision 1.6  1994/11/07  21:36:33  manchek
   * flush messages on pvm_exit.
   * function prototype for SCO
***************
*** 118,124 ****
  
  static int def_match();
  
! static char rcsid[] = "$Id: lpvmgen.c,v 1.6 1994/11/07 21:36:33 manchek Exp $";
  static char pvmtxt[512];				/* scratch for error log */
  static int (*recv_match)() = def_match;
  
--- 121,127 ----
  
  static int def_match();
  
! static char rcsid[] = "$Id: lpvmgen.c,v 1.7 1995/02/01 21:10:33 manchek Exp $";
  static char pvmtxt[512];				/* scratch for error log */
  static int (*recv_match)() = def_match;
  
***************
*** 2034,2040 ****
  					*delta = myta;
  				}
  			}
! 		}
  	}
  
  	if (cc < 0)
--- 2037,2046 ----
  					*delta = myta;
  				}
  			}
! 			pvm_freebuf(pvm_setrbuf(rbf));
! 		} else
! 			pvm_setrbuf(rbf);
! 		pvm_freebuf(pvm_setsbuf(sbf));
  	}
  
  	if (cc < 0)
*** ../netlib/pvm3.3.6/src/lpvmmimd.c	Wed Dec 21 16:56:53 1994
--- src/lpvmmimd.c	Wed Feb 01 16:11:34 1995
***************
*** 32,37 ****
--- 32,40 ----
   *	Libpvm core for MPP environment.
   *
  $Log: lpvmmimd.c,v $
+  * Revision 1.8  1995/02/01  21:11:45  manchek
+  * error 4 is now PvmOverflow
+  *
   * Revision 1.7  1994/12/20  16:39:05  manchek
   * added pvmshowtaskid variable
   *
***************
*** 121,127 ****
  		"Error 1",
  	"Bad parameter",
  	"Count mismatch",
! 		"Error 4",				/* not used */
  	"End of buffer",
  	"No such host",
  	"No such file",
--- 124,130 ----
  		"Error 1",
  	"Bad parameter",
  	"Count mismatch",
! 	"Value too large",
  	"End of buffer",
  	"No such host",
  	"No such file",
***************
*** 220,226 ****
   **           **
   ***************/
  
! static char rcsid[] = "$Id: lpvmmimd.c,v 1.7 1994/12/20 16:39:05 manchek Exp $";
  static int debugmask = 0;				/* which debugging info */
  static char pvmtxt[512];					/* scratch for error log */
  static struct umbuf *rxfrag = 0;		/* not-assembled incm msgs */
--- 223,229 ----
   **           **
   ***************/
  
! static char rcsid[] = "$Id: lpvmmimd.c,v 1.8 1995/02/01 21:11:45 manchek Exp $";
  static int debugmask = 0;				/* which debugging info */
  static char pvmtxt[512];					/* scratch for error log */
  static struct umbuf *rxfrag = 0;		/* not-assembled incm msgs */
*** ../netlib/pvm3.3.6/src/lpvmpack.c	Wed Nov 09 10:58:40 1994
--- src/lpvmpack.c	Wed Feb 01 16:22:31 1995
***************
*** 32,37 ****
--- 32,41 ----
   *	Typed packing/unpacking, message buffer manip.
   *
  $Log: lpvmpack.c,v $
+  * Revision 1.6  1995/02/01  21:22:27  manchek
+  * new function enc_xdr_ulong.
+  * added overflow tests to enc_xdr_long, enc_xdr_ulong, return PvmOverflow
+  *
   * Revision 1.5  1994/11/09  15:01:58  manchek
   * pvm_pkstr and pvm_packf(%s) must fail with PvmNotImpl if PvmDataInPlace
   * is used.
***************
*** 101,107 ****
   **           **
   ***************/
  
! static char rcsid[] = "$Id: lpvmpack.c,v 1.5 1994/11/09 15:01:58 manchek Exp $";
  static char pvmtxt[512];				/* scratch for error log */
  
  
--- 105,111 ----
   **           **
   ***************/
  
! static char rcsid[] = "$Id: lpvmpack.c,v 1.6 1995/02/01 21:22:27 manchek Exp $";
  static char pvmtxt[512];				/* scratch for error log */
  
  
***************
*** 856,861 ****
--- 860,869 ----
  
  	for (np = (long*)vp; cnt-- > 0; np += std)
  		if (!xdr_long(xob, np)) {
+ 			if ((*np & ~(long)0x7fffffff) != ~(long)0x7fffffff) {
+ 				cc = PvmOverflow;
+ 				break;
+ 			}
  			up->ub_frag->fr_rlink->fr_len = xdr_getpos(xob);
  			if (cc = enc_xdr_step())
  				break;
***************
*** 871,876 ****
--- 879,914 ----
  
  
  static int
+ enc_xdr_ulong(vp, cnt, std, siz)
+ 	void *vp;
+ 	int cnt, std, siz;
+ {
+ 	struct umbuf *up = midtobuf(pvmsbufmid);
+ 	XDR *xob = &up->ub_encxdr;
+ 	register unsigned long *np;
+ 	int cc = 0;
+ 
+ 	for (np = (unsigned long*)vp; cnt-- > 0; np += std)
+ 		if (!xdr_u_long(xob, np)) {
+ 			if (*np & ~(long)0xffffffff) {
+ 				cc = PvmOverflow;
+ 				break;
+ 			}
+ 			up->ub_frag->fr_rlink->fr_len = xdr_getpos(xob);
+ 			if (cc = enc_xdr_step())
+ 				break;
+ 			else
+ 				if (!xdr_u_long(xob, np)) {
+ 					cc = PvmNoMem;
+ 					break;
+ 				}
+ 		}
+ 	up->ub_frag->fr_rlink->fr_len = xdr_getpos(xob);
+ 	return cc;
+ }
+ 
+ 
+ static int
  enc_xdr_float(vp, cnt, std, siz)
  	void *vp;
  	int cnt, std, siz;
***************
*** 1632,1638 ****
  #else
  		enc_xdr_short, dec_xdr_ushort,
  		enc_xdr_int, dec_xdr_uint,
! 		enc_xdr_long, dec_xdr_ulong,
  #endif
  		enc_xdr_float, dec_xdr_float,
  		enc_xdr_double, dec_xdr_double,
--- 1670,1676 ----
  #else
  		enc_xdr_short, dec_xdr_ushort,
  		enc_xdr_int, dec_xdr_uint,
! 		enc_xdr_ulong, dec_xdr_ulong,
  #endif
  		enc_xdr_float, dec_xdr_float,
  		enc_xdr_double, dec_xdr_double,
***************
*** 2546,2552 ****
  		if (pvmsbufmid <= 0)
  			cc = PvmNoBuf;
  		else
! 			cc = (midtobuf(pvmsbufmid)->ub_codef->enc_int)
  					((void*)np, cnt, std, sizeof(int));
  
  	if (x) {
--- 2584,2590 ----
  		if (pvmsbufmid <= 0)
  			cc = PvmNoBuf;
  		else
! 			cc = (midtobuf(pvmsbufmid)->ub_codef->enc_uint)
  					((void*)np, cnt, std, sizeof(int));
  
  	if (x) {
***************
*** 2706,2712 ****
  		if (pvmsbufmid <= 0)
  			cc = PvmNoBuf;
  		else
! 			cc = (midtobuf(pvmsbufmid)->ub_codef->enc_long)
  					((void*)np, cnt, std, sizeof(long));
  
  	if (x) {
--- 2744,2750 ----
  		if (pvmsbufmid <= 0)
  			cc = PvmNoBuf;
  		else
! 			cc = (midtobuf(pvmsbufmid)->ub_codef->enc_ulong)
  					((void*)np, cnt, std, sizeof(long));
  
  	if (x) {
***************
*** 2866,2872 ****
  		if (pvmsbufmid <= 0)
  			cc = PvmNoBuf;
  		else
! 			cc = (midtobuf(pvmsbufmid)->ub_codef->enc_short)
  					((void*)np, cnt, std, sizeof(short));
  
  	if (x) {
--- 2904,2910 ----
  		if (pvmsbufmid <= 0)
  			cc = PvmNoBuf;
  		else
! 			cc = (midtobuf(pvmsbufmid)->ub_codef->enc_ushort)
  					((void*)np, cnt, std, sizeof(short));
  
  	if (x) {
*** ../netlib/pvm3.3.6/src/lpvmshmem.c	Wed Dec 21 16:56:53 1994
--- src/lpvmshmem.c	Mon Feb 06 16:44:27 1995
***************
*** 32,37 ****
--- 32,44 ----
   *	Libpvm core for MPP environment.
   *
  $Log: lpvmshmem.c,v $
+  * Revision 1.7  1995/02/06  21:43:59  manchek
+  * pvmmctl now replies to TC_CONREQ message.
+  * better cleanup of message buffers in pvmendtask
+  *
+  * Revision 1.6  1995/02/01  21:24:47  manchek
+  * error 4 is now PvmOverflow
+  *
   * Revision 1.5  1994/12/20  16:38:44  manchek
   * added pvmshowtaskid variable
   *
***************
*** 130,135 ****
--- 137,144 ----
  extern int pvmrbufmid;				/* from pack.c */
  extern int pvmsbufmid;				/* from pack.c */
  extern int bufpageused;				/* from pvmshmem.c */
+ extern struct mhp *pvmmidh;			/* from pvmumbuf.c */
+ extern int pvmmidhsiz;				/* from pvmumbuf.c */
  
  char *pvm_errlist[] = {					/* error messages for -pvm_errno */
  		"Error 0",
***************
*** 136,142 ****
  		"Error 1",
  	"Bad parameter",
  	"Count mismatch",
! 		"Error 4",				/* not used */
  	"End of buffer",
  	"No such host",
  	"No such file",
--- 145,151 ----
  		"Error 1",
  	"Bad parameter",
  	"Count mismatch",
! 	"Value too large",
  	"End of buffer",
  	"No such host",
  	"No such file",
***************
*** 217,223 ****
   **           **
   ***************/
  
! static char rcsid[] = "$Id: lpvmshmem.c,v 1.5 1994/12/20 16:38:44 manchek Exp $";
  static char pvmtxt[512];				/* scratch for error log */
  static struct umbuf *rxfrag = 0;		/* not-assembled incm msgs */
  static struct frag *rxbuf;				/* buffer for incoming packets */
--- 226,232 ----
   **           **
   ***************/
  
! static char rcsid[] = "$Id: lpvmshmem.c,v 1.7 1995/02/06 21:43:59 manchek Exp $";
  static char pvmtxt[512];				/* scratch for error log */
  static struct umbuf *rxfrag = 0;		/* not-assembled incm msgs */
  static struct frag *rxbuf;				/* buffer for incoming packets */
***************
*** 436,477 ****
  pvmmctl(up)
  	struct umbuf *up;
  {
- 	char buf[512];          /* to convert sockaddr, misc */
  	int rbf;                /* temp rx message storage */
  
  	switch (up->ub_cod) {
  	case TC_CONREQ:
! 		sprintf(pvmtxt, "pvmmctl() TCP conn request from t%x!\n", up->ub_src);
! 		pvmlogerror(pvmtxt);
  		break;
  	case TC_CONACK:
  	case TC_TASKEXIT:
- 	case TC_NOOP:
  		sprintf(pvmtxt, "pvmmctl() unexpected TC msg from t%x!\n", up->ub_src);
  		pvmlogerror(pvmtxt);
  		break;
  	case TC_OUTPUT:
! 		rbf = pvm_setrbuf(up->ub_mid);
!         pvmclaimo();
!         pvm_setrbuf(rbf);
!         break;
  	case TC_SETTMASK:
!         pvm_upkstr(buf);
!         if (strlen(buf) + 1 == TEV_MASK_LENGTH)
!             BCOPY(buf, pvmtrcmask, TEV_MASK_LENGTH);
!         else
!             pvmlogerror("pvmmctl() bogus trace mask\n");
!         break;
  
!     default:
!         sprintf(pvmtxt, "pvmmctl() from t%x code=%d ?\n",
!                 up->ub_src, up->ub_cod);
!         pvmlogerror(pvmtxt);
!         break;
!     }
  
!     umbuf_free(up->ub_mid);
!     return 0;
  }
  		
  
--- 445,504 ----
  pvmmctl(up)
  	struct umbuf *up;
  {
  	int rbf;                /* temp rx message storage */
+ 	int sbf = 0;			/* return message to send */
+ 	struct umbuf *up2;
+ 	int ttpro;				/* protocol revision */
+ 	int ackd;				/* allow connection if 0 */
+ 	char buf[256];          /* to convert sockaddr, misc */
  
+ 	rbf = pvm_setrbuf(up->ub_mid);
+ 
  	switch (up->ub_cod) {
+ 
  	case TC_CONREQ:
! 		sbf = pvm_setsbuf(pvm_mkbuf(PvmDataFoo));
! 		ttpro = TDPROTOCOL;
! 		ackd = 1;
! 		pvm_pkint(&ttpro, 1, 1);
! 		pvm_pkint(&ackd, 1, 1);
! 		pvm_pkstr(buf);
! 		sbf = pvm_setsbuf(sbf);
! 		up2 = midtobuf(sbf);
! 		up2->ub_dst = up->ub_src;
! 		up2->ub_cod = TC_CONACK;
  		break;
+ 
  	case TC_CONACK:
  	case TC_TASKEXIT:
  		sprintf(pvmtxt, "pvmmctl() unexpected TC msg from t%x!\n", up->ub_src);
  		pvmlogerror(pvmtxt);
+ 
+ 	case TC_NOOP:
  		break;
+ 
  	case TC_OUTPUT:
! 		pvmclaimo();
! 		break;
! 
  	case TC_SETTMASK:
! 		pvm_upkstr(buf);
! 		if (strlen(buf) + 1 == TEV_MASK_LENGTH)
! 			BCOPY(buf, pvmtrcmask, TEV_MASK_LENGTH);
! 		else
! 			pvmlogerror("pvmmctl() bogus trace mask\n");
! 		break;
  
! 	default:
! 		sprintf(pvmtxt, "pvmmctl() from t%x code=%d ?\n",
! 				up->ub_src, up->ub_cod);
! 		pvmlogerror(pvmtxt);
! 	break;
! 	}
  
! 	pvm_setrbuf(rbf);
! 	umbuf_free(up->ub_mid);
! 	return sbf;
  }
  		
  
***************
*** 500,505 ****
--- 527,535 ----
  	int loopcount = 0;
  	struct msgboxhdr *inbp;		/* incoming box */
  	struct timeval tnow, tstop;
+ 	int tstk[100];				/* XXX shouldn't be a stack */
+ 	int tstkp = 0;
+ 	int sbf;					/* reply to control message */
  
  	/* XXX do we really have to do this? */
  	if ((dtid == TIDPVMD && code == TM_MCA) || dtid == TIDGID)
***************
*** 541,568 ****
  			loopcount = 0;
  		}
  
- /*
- #ifdef TEST_ADD
- 		if (inbp->mb_read != TEST_ADD(&inbp->mb_last,0))
- #else
- 		PAGELOCK(&inbp->mb_lock);		
  		if (inbp->mb_read != inbp->mb_last) {
! 			PAGEUNLOCK(&inbp->mb_lock);
! #endif
! 			if (peer_recv(&gotem) == -1)
  				return -1;
  		}
- #ifndef TEST_ADD
- 		PAGEUNLOCK(&inbp->mb_lock);
- #endif
- */
- 		if (inbp->mb_read != inbp->mb_last && peer_recv(&gotem) == -1)
- 			return -1;
  
  		if (txfp && peer_send(txup, txfp, dtid, code)) {
  			txfp = txfp->fr_link;
! 			if (!txfp->fr_buf)
! 				txfp = 0;
  		}
  
  	} while (txfp || (block && !gotem));
--- 571,604 ----
  			loopcount = 0;
  		}
  
  		if (inbp->mb_read != inbp->mb_last) {
! 			if ((sbf = peer_recv(&gotem)) == -1)
  				return -1;
+ 			if (sbf > 0) {
+ 				if (txfp)
+ 					tstk[tstkp++] = sbf;
+ 				else {
+ 					txup = midtobuf(sbf);
+ 					dtid = txup->ub_dst;
+ 					code = txup->ub_cod;
+ 					txfp = txup->ub_frag->fr_link;
+ 					txfp = txfp->fr_buf ? txfp : 0;
+ 				}
+ 			}
  		}
  
  		if (txfp && peer_send(txup, txfp, dtid, code)) {
  			txfp = txfp->fr_link;
! 			if (!txfp->fr_buf) {
! 				if (tstkp > 0) {
! 					txup = midtobuf(tstk[--tstkp]);
! 					dtid = txup->ub_dst;
! 					code = txup->ub_cod;
! 					txfp = txup->ub_frag->fr_link;
! 					txfp = txfp->fr_buf ? txfp : 0;
! 				} else
! 					txfp = 0;
! 			}
  		}
  
  	} while (txfp || (block && !gotem));
***************
*** 571,577 ****
  }
  
  
! /* receives a fragment from another process */
  int
  peer_recv(gotem)
  	int *gotem;
--- 607,624 ----
  }
  
  
! 
! /*	peer_recv()
! *
! *	Receive a message fragment from another task.
! *	Reassemble frags into messages and place on rxlist.
! *	On completing a control message, call pvmmctl(), which consumes it.
! *	Returns:
! *		0 normally,
! *		negative if error,
! *		or message handle of a reply control message to be sent.
! */
! 
  int
  peer_recv(gotem)
  	int *gotem;
***************
*** 586,591 ****
--- 633,639 ----
  	int next;					/* frag being received */
  	struct shmpkhdr *inmsgs;	/* incoming messages */
  	struct msgboxhdr *inbp;		/* incoming box */
+ 	int sbf = 0;				/* reply control message */
  
  	inbp = (struct msgboxhdr *)pvminbox;
  	inmsgs = (struct shmpkhdr *)(inbp + 1);
***************
*** 661,667 ****
  			/* XXX */
  			if (rxup->ub_cod >= (int)TC_FIRST && rxup->ub_cod <= (int)TC_LAST) {
  				rxup = rxup->ub_rlink;
! 				pvmmctl(rxup->ub_link);
  			}
  		}
  	}
--- 709,715 ----
  			/* XXX */
  			if (rxup->ub_cod >= (int)TC_FIRST && rxup->ub_cod <= (int)TC_LAST) {
  				rxup = rxup->ub_rlink;
! 				sbf = pvmmctl(rxup->ub_link);
  			}
  		}
  	}
***************
*** 671,677 ****
  #endif
  */
  	inbp->mb_read = next;
! 	return 0;
  }
  
  
--- 719,725 ----
  #endif
  */
  	inbp->mb_read = next;
! 	return sbf;
  }
  
  
***************
*** 1139,1155 ****
  	char *p;
  	int i;
  	struct shmid_ds shmds;
  
- 	if (pvmsbufmid > 0)
- 		umbuf_free(pvmsbufmid);
- 	if (pvmrbufmid > 0)
- 		umbuf_free(pvmrbufmid);
- 
  	/*
  	* hang around until all outgoing messages are received
  	* XXX this loses if the receiving task dies
  	*/
  
  	for (p = outmsgbuf, i = 0; i < bufpageused; i++, p += FRAGPAGE * pgsz) {
  		while (((struct shmpghdr *)p)->pg_ref > 0)
  			sleep(1);
--- 1187,1205 ----
  	char *p;
  	int i;
  	struct shmid_ds shmds;
+ 	struct umbuf *up;
  
  	/*
+ 	* free any left-over messages.
  	* hang around until all outgoing messages are received
  	* XXX this loses if the receiving task dies
  	*/
  
+ 	pvmsbufmid = 0;
+ 	pvmrbufmid = 0;
+ 	for (i = 1; i < pvmmidhsiz; i++)
+ 		if (up = pvmmidh[i].m_umb)
+ 			umbuf_free(up->ub_mid);
  	for (p = outmsgbuf, i = 0; i < bufpageused; i++, p += FRAGPAGE * pgsz) {
  		while (((struct shmpghdr *)p)->pg_ref > 0)
  			sleep(1);
*** ../netlib/pvm3.3.6/src/pvmd.c	Wed Dec 21 16:56:53 1994
--- src/pvmd.c	Mon Feb 06 17:40:41 1995
***************
*** 32,37 ****
--- 32,52 ----
   *	Mr. pvm daemon.
   *
  $Log: pvmd.c,v $
+  * Revision 1.25  1995/02/06  22:40:11  manchek
+  * shared memory ports call mpp_setmtu before slave_config
+  *
+  * Revision 1.24  1995/02/06  18:52:24  manchek
+  * added debugging prints for when main select in work fails (solaris)
+  *
+  * Revision 1.23  1995/02/06  05:01:28  manchek
+  * hmm
+  *
+  * Revision 1.22  1995/02/03  16:45:27  manchek
+  * touch up reap - define rus as int if we don't think struct rusage exists
+  *
+  * Revision 1.21  1995/02/01  21:31:23  manchek
+  * added clear_opq_of, called when host is deleted from table or pvmd' exits
+  *
   * Revision 1.20  1994/12/20  16:40:35  manchek
   * use O_NONBLOCK for RS6K
   *
***************
*** 264,270 ****
   **           **
   ***************/
  
! static char rcsid[] = "$Id: pvmd.c,v 1.20 1994/12/20 16:40:35 manchek Exp $";
  static struct deaddata *deads = 0;	/* circ queue of dead task data */
  static char pvmtxt[512];		/* scratch for error log */
  static int ndead = 0;			/* len of deads */
--- 279,285 ----
   **           **
   ***************/
  
! static char rcsid[] = "$Id: pvmd.c,v 1.25 1995/02/06 22:40:11 manchek Exp $";
  static struct deaddata *deads = 0;	/* circ queue of dead task data */
  static char pvmtxt[512];		/* scratch for error log */
  static int ndead = 0;			/* len of deads */
***************
*** 324,329 ****
--- 339,347 ----
  #if defined(IMA_PGON) || defined(IMA_I860) || defined(IMA_CM5)
  	mpp_init(&argc, argv);
  #endif
+ #ifdef SHMEM
+ 	mpp_setmtu();
+ #endif
  
  	for (i = j = ac = 1; i < argc; i++) {
  		if (argv[i][0] == '-') {
***************
*** 605,612 ****
--- 623,634 ----
  	int pid;
  	int es = 0;
  #ifndef NOWAIT3
+ #if defined(RUSAGE_SELF)
  	struct rusage rus;
+ #else
+ 	int rus;
  #endif
+ #endif
  
  	sig = sig;
  
***************
*** 620,633 ****
  	while ((pid = wait3(&es, WNOHANG, &rus)) > 0)
  #endif	/*NOWAIT3*/
  	{
! #ifdef NOWAIT3
  		deads[wdead].dd_ut.tv_sec = 0;
  		deads[wdead].dd_ut.tv_usec = 0;
  		deads[wdead].dd_st.tv_sec = 0;
  		deads[wdead].dd_st.tv_usec = 0;
- #else
- 		deads[wdead].dd_ut = rus.ru_utime;
- 		deads[wdead].dd_st = rus.ru_stime;
  #endif
  		deads[wdead].dd_pid = pid;
  		deads[wdead].dd_es = es;
--- 642,655 ----
  	while ((pid = wait3(&es, WNOHANG, &rus)) > 0)
  #endif	/*NOWAIT3*/
  	{
! #if !defined(NOWAIT3) && defined(RUSAGE_SELF)
! 		deads[wdead].dd_ut = rus.ru_utime;
! 		deads[wdead].dd_st = rus.ru_stime;
! #else
  		deads[wdead].dd_ut.tv_sec = 0;
  		deads[wdead].dd_ut.tv_usec = 0;
  		deads[wdead].dd_st.tv_sec = 0;
  		deads[wdead].dd_st.tv_usec = 0;
  #endif
  		deads[wdead].dd_pid = pid;
  		deads[wdead].dd_es = es;
***************
*** 805,810 ****
--- 827,855 ----
  }
  
  
+ /*	clear_opq_of()
+ *
+ *	Clear packets dst for host in opq but _not_ in host hd_opq.
+ */
+ 
+ int
+ clear_opq_of(tid)
+ 	int tid;			/* host */
+ {
+ 	struct pkt *pp, *pp2;
+ 
+ 	for (pp = opq->pk_tlink; pp != opq; pp = pp->pk_tlink) {
+ 		if (pp->pk_dst == tid && !pp->pk_link) {
+ 			pp2 = pp->pk_trlink;
+ 			LISTDELETE(pp, pk_tlink, pk_trlink);
+ 			pk_free(pp);
+ 			pp = pp2;
+ 		}
+ 	}
+ 	return 0;
+ }
+ 
+ 
  /*	work()
  *
  *	The whole sausage
***************
*** 873,881 ****
--- 918,949 ----
  		*/
  		while (rdead != wdead) {
  			if (deads[rdead].dd_pid == pprime) {
+ 				int cc;
+ 				int oslen;
+ 				struct sockaddr_in osad;
+ 				struct timeval t;
+ 				char buf[DDFRAGHDR];
+ 
  				hostfailentry(hosts->ht_hosts[0]);
+ 				clear_opq_of((int)(TIDPVMD | hosts->ht_hosts[0]->hd_hostpart));
  				pprime = 0;
  
+ 				while (1) {
+ 					FD_ZERO(&rfds);
+ 					FD_SET(ppnetsock, &rfds);
+ 					t.tv_sec = 0;
+ 					t.tv_usec = 0;
+ 					cc = select(ppnetsock + 1, &rfds, (fd_set *)0, (fd_set *)0,
+ 							&t);
+ 					if (cc == 1) {
+ 						oslen = sizeof(osad);
+ 						recvfrom(ppnetsock, buf, sizeof(buf),
+ 								0, (struct sockaddr*)&osad, &oslen);
+ 
+ 					} else if (cc != -1 || errno != EINTR)
+ 						break;
+ 				}
+ 
  			} else {
  				if (tp = task_findpid(deads[rdead].dd_pid)) {
  
***************
*** 995,1000 ****
--- 1063,1076 ----
  		if ((nrdy = select(wrk_nfds, &rfds, &wfds, (fd_set*)0, &tout)) == -1) {
  			if (errno != EINTR) {
  				pvmlogperror("work() select");
+ 				sprintf(pvmtxt, " wrk_nfds=%d\n", wrk_nfds);
+ 				pvmlogerror(pvmtxt);
+ 				print_fdset(" rfds=", wrk_nfds, &wrk_rfds);
+ 				print_fdset(" wfds=", wrk_nfds, &wrk_wfds);
+ 				sprintf(pvmtxt, " netsock=%d, ppnetsock=%d, loclsock=%d\n",
+ 						netsock, ppnetsock, loclsock);
+ 				pvmlogerror(pvmtxt);
+ 				task_dump();
  				pvmbailout(0);
  			}
  		}
***************
*** 1165,1170 ****
--- 1241,1247 ----
  			pvmlogerror(pvmtxt);
  			hd_dump(hp);
  			hostfailentry(hp);
+ 			clear_opq_of((int)(TIDPVMD | hp->hd_hostpart));
  			ht_delete(hosts, hp);
  			if (newhosts)
  				ht_delete(newhosts, hp);
***************
*** 1202,1212 ****
  					(struct sockaddr*)&hp->hd_sad, sizeof(hp->hd_sad))) == -1
  			&& errno != EINTR
  			&& errno != ENOBUFS
- #if defined(IMA_SUN4SOL2) || defined(IMA_SUNMP) || defined(IMA_UXPM)
- 			&& errno != ECHILD	/* life, don't talk to me about life... */
- #endif
  			) {
  				pvmlogperror("netoutput() sendto");
  				pvmbailout(0);
  			}
  #ifdef	STATISTICS
--- 1279,1292 ----
  					(struct sockaddr*)&hp->hd_sad, sizeof(hp->hd_sad))) == -1
  			&& errno != EINTR
  			&& errno != ENOBUFS
  			) {
  				pvmlogperror("netoutput() sendto");
+ #if defined(IMA_SUN4SOL2) || defined(IMA_SUNMP) || defined(IMA_UXPM)
+ 	/* life, don't talk to me about life... */
+ 				if (errno == ECHILD)
+ 					pvmlogerror("this message brought to you by solaris\n");
+ 				else
+ #endif
  				pvmbailout(0);
  			}
  #ifdef	STATISTICS
***************
*** 1227,1238 ****
--- 1307,1321 ----
  	*/
  		if (cc != -1) {
  			if ((pp->pk_flag & (FFFIN|FFACK)) == (FFFIN|FFACK)) {
+ 				pk_free(pp);
  				if (hp != hosts->ht_hosts[0]) {
  					hostfailentry(hp);
+ 					clear_opq_of((int)(TIDPVMD | hp->hd_hostpart));
  					ht_delete(hosts, hp);
  					if (newhosts)
  						ht_delete(newhosts, hp);
  				}
+ 				continue;
  			}
  			if (!((pp->pk_flag & FFDAT)
  					|| (pp->pk_flag & (FFFIN|FFACK)) == FFFIN)) {
***************
*** 1386,1391 ****
--- 1469,1475 ----
  			pvmlogerror(pvmtxt);
  			hd_dump(hp);
  			hostfailentry(hp);
+ 			clear_opq_of((int)(TIDPVMD | hp->hd_hostpart));
  			if (hp->hd_hostpart) {
  				ht_delete(hosts, hp);
  				if (newhosts)
*** ../netlib/pvm3.3.6/src/pvmdmp.h	Sat Jun 04 17:42:59 1994
--- src/pvmdmp.h	Wed Feb 01 16:33:16 1995
***************
*** 28,33 ****
--- 28,38 ----
  
  /*
   *	pvmdmp.h
+  *
+ $Log: pvmdmp.h,v $
+  * Revision 1.3  1995/02/01  21:32:54  manchek
+  * added nenv and envp args to mpp_load
+  *
   */
  
  #define TIMEOUT     10000       /* for select(); in usec */
***************
*** 38,44 ****
  void mpp_init __ProtoGlarp__((int *argc, char **argv));
  void mpp_free __ProtoGlarp__((int tid));
  int mpp_load __ProtoGlarp__((int flags, char *name, char **argv, int count,
!     int *tids, int ptid));
  void mpp_input __ProtoGlarp__((void));
  int mpp_mcast __ProtoGlarp__((struct pkt *pp, int *tids, int ntask));
  void mpp_output __ProtoGlarp__((struct task *tp, struct pkt *pp));
--- 43,49 ----
  void mpp_init __ProtoGlarp__((int *argc, char **argv));
  void mpp_free __ProtoGlarp__((int tid));
  int mpp_load __ProtoGlarp__((int flags, char *name, char **argv, int count,
!     int *tids, int ptid, int nenv, char **envp));
  void mpp_input __ProtoGlarp__((void));
  int mpp_mcast __ProtoGlarp__((struct pkt *pp, int *tids, int ntask));
  void mpp_output __ProtoGlarp__((struct task *tp, struct pkt *pp));
*** ../netlib/pvm3.3.6/src/pvmdshmem.c	Wed Nov 09 10:58:42 1994
--- src/pvmdshmem.c	Mon Feb 06 17:42:27 1995
***************
*** 32,37 ****
--- 32,43 ----
   * Shared-memory MPP interface.
   *
  $Log: pvmdshmem.c,v $
+  * Revision 1.5  1995/02/06  22:42:01  manchek
+  * new function mpp_setmtu, called before slave_config
+  *
+  * Revision 1.4  1995/02/01  21:35:06  manchek
+  * added nenv and envp args to mpp_load, which passes them to forkexec
+  *
   * Revision 1.3  1994/11/08  15:35:07  manchek
   * shared memory damage control
   *
***************
*** 117,123 ****
   **           **
   ***************/
  
! static char rcsid[] = "$Id: pvmdshmem.c,v 1.3 1994/11/08 15:35:07 manchek Exp $";
  static char pvmtxt[512];		/* scratch for error log */
  static char *inbox = 0;			/* incoming message header buffer */
  static int inboxsz = 0;			/* size of incoming message buffer */ 
--- 123,129 ----
   **           **
   ***************/
  
! static char rcsid[] = "$Id: pvmdshmem.c,v 1.5 1995/02/06 22:42:01 manchek Exp $";
  static char pvmtxt[512];		/* scratch for error log */
  static char *inbox = 0;			/* incoming message header buffer */
  static int inboxsz = 0;			/* size of incoming message buffer */ 
***************
*** 163,168 ****
--- 169,185 ----
  }
  */
  
+ /* XXX this is gross, but the ordering between mpp_init and slave_config
+    XXX is just too fucked right now. */
+ 
+ int
+ mpp_setmtu()
+ {
+ 	pgsz = sysconf(_SC_PAGESIZE);
+ 	ourudpmtu = pgsz - PVMPAGEHDR;
+ }
+ 
+ 
  /* XXX mpp_init() is a mess - it just returns if anything goes wrong */
  
  void
***************
*** 181,189 ****
  fclose(logfp);
  #endif
  
- 	pgsz = sysconf(_SC_PAGESIZE);
  	pvmpgsz = FRAGPAGE*pgsz;
- 	ourudpmtu = pgsz - PVMPAGEHDR;
  	inboxsz = 
  		(INBOXPAGE*pgsz - sizeof(struct msgboxhdr))/sizeof(struct shmpkhdr);
  	if (!(p = getenv("PVMBUFSIZE")) || !(shmbufsiz = strtol(p, (char**)0, 0)))
--- 198,204 ----
***************
*** 381,387 ****
  }
  
  /* fork and exec new tasks */
! mpp_load(flags, name, av, count, tids, ptid)
  	int flags;				/* exec options */
  	char *name;				/* executable */
  	char **av;				/* arg list (argv[-1] must be there) */
--- 396,402 ----
  }
  
  /* fork and exec new tasks */
! mpp_load(flags, name, av, count, tids, ptid, nenv, envp)
  	int flags;				/* exec options */
  	char *name;				/* executable */
  	char **av;				/* arg list (argv[-1] must be there) */
***************
*** 388,393 ****
--- 403,410 ----
  	int count;				/* how many */
  	int tids[];				/* array to store new tids */
  	int ptid;				/* parent task ID */
+ 	int nenv;				/* num of envars */
+ 	char **envp;			/* envars */
  {
  	int i;
  	int err = 0;
***************
*** 402,408 ****
  			if (i)
  				(void)removeshm(tids[i-1] + 1);
  
! 			if (err = forkexec(flags, av[0], av, 0, (char **)0, &tp)) {
  				tids[i] = err;
  			} else {
  				tp->t_ptid = ptid;
--- 419,425 ----
  			if (i)
  				(void)removeshm(tids[i-1] + 1);
  
! 			if (err = forkexec(flags, av[0], av, nenv, envp, &tp)) {
  				tids[i] = err;
  			} else {
  				tp->t_ptid = ptid;
*** ../netlib/pvm3.3.6/src/startup.c	Wed Nov 09 10:58:43 1994
--- src/startup.c	Mon Feb 06 16:36:50 1995
***************
*** 32,37 ****
--- 32,40 ----
   *	Exec more pvmds.  It's good for you.
   *
  $Log: startup.c,v $
+  * Revision 1.10  1995/02/06  21:35:59  manchek
+  * host table mtu set from ourudpmtu instead of UDPMAXLEN
+  *
   * Revision 1.9  1994/10/15  19:31:31  manchek
   * fixed typo in log message
   *
***************
*** 207,213 ****
   **           **
   ***************/
  
! static char rcsid[] = "$Id: startup.c,v 1.9 1994/10/15 19:31:31 manchek Exp $";
  static char pvmtxt[1024];		/* scratch for error log */
  
  
--- 210,216 ----
   **           **
   ***************/
  
! static char rcsid[] = "$Id: startup.c,v 1.10 1995/02/06 21:35:59 manchek Exp $";
  static char pvmtxt[1024];		/* scratch for error log */
  
  
***************
*** 598,604 ****
  	hp = hd_new(1);
  	hp->hd_name = STRALLOC(hn);
  	hp->hd_arch = STRALLOC(myarchname);
! 	hp->hd_mtu = UDPMAXLEN;
  	ht_insert(hosts, hp);
  	hd_unref(hp);
  
--- 601,607 ----
  	hp = hd_new(1);
  	hp->hd_name = STRALLOC(hn);
  	hp->hd_arch = STRALLOC(myarchname);
! 	hp->hd_mtu = ourudpmtu;
  	ht_insert(hosts, hp);
  	hd_unref(hp);
  
***************
*** 605,611 ****
  	hp = hd_new(0);
  	hp->hd_name = STRALLOC("pvmd'");
  	hp->hd_arch = STRALLOC(myarchname);
! 	hp->hd_mtu = UDPMAXLEN;
  	ht_insert(hosts, hp);
  	hd_unref(hp);
  
--- 608,614 ----
  	hp = hd_new(0);
  	hp->hd_name = STRALLOC("pvmd'");
  	hp->hd_arch = STRALLOC(myarchname);
! 	hp->hd_mtu = ourudpmtu;
  	ht_insert(hosts, hp);
  	hd_unref(hp);
  
***************
*** 743,749 ****
  	hp = hd_new(0);
  	hp->hd_name = STRALLOC("pvmd'");
  	hp->hd_arch = STRALLOC(myarchname);
! 	hp->hd_mtu = UDPMAXLEN;
  	hex_inadport(argv[5], &hp->hd_sad);
  	ht_insert(hosts, hp);
  	hd_unref(hp);
--- 746,752 ----
  	hp = hd_new(0);
  	hp->hd_name = STRALLOC("pvmd'");
  	hp->hd_arch = STRALLOC(myarchname);
! 	hp->hd_mtu = ourudpmtu;
  	hex_inadport(argv[5], &hp->hd_sad);
  	ht_insert(hosts, hp);
  	hd_unref(hp);
***************
*** 751,757 ****
  	hp = hd_new(lh);
  	hp->hd_name = STRALLOC(hn);
  	hp->hd_arch = STRALLOC(myarchname);
! 	hp->hd_mtu = UDPMAXLEN;
  	hex_inadport(argv[5], &hp->hd_sad);
  	ht_insert(hosts, hp);
  	hd_unref(hp);
--- 754,760 ----
  	hp = hd_new(lh);
  	hp->hd_name = STRALLOC(hn);
  	hp->hd_arch = STRALLOC(myarchname);
! 	hp->hd_mtu = ourudpmtu;
  	hex_inadport(argv[5], &hp->hd_sad);
  	ht_insert(hosts, hp);
  	hd_unref(hp);
*** ../netlib/pvm3.3.6/src/task.c	Wed Nov 09 10:58:44 1994
--- src/task.c	Mon Feb 06 13:45:50 1995
***************
*** 32,37 ****
--- 32,40 ----
   *	Task descriptors.
   *
  $Log: task.c,v $
+  * Revision 1.6  1995/02/06  18:45:45  manchek
+  * added stuff to task_dump
+  *
   * Revision 1.5  1994/11/08  15:40:59  manchek
   * shared memory cleanup.
   * check if wa_tid is zero before sending message in task_cleanup
***************
*** 99,105 ****
   **           **
   ***************/
  
! static char rcsid[] = "$Id: task.c,v 1.5 1994/11/08 15:40:59 manchek Exp $";
  static char pvmtxt[512];		/* scratch for error log */
  
  
--- 102,108 ----
   **           **
   ***************/
  
! static char rcsid[] = "$Id: task.c,v 1.6 1995/02/06 18:45:45 manchek Exp $";
  static char pvmtxt[512];		/* scratch for error log */
  
  
***************
*** 508,523 ****
  	struct pkt *pp;
  
  	pvmlogerror("task_dump()\n");
! 	pvmlogerror("     tid     ptid    flags    pid   outtid   trctid\n");
  	for (tp = locltasks->t_link; tp != locltasks; tp = tp->t_link) {
! 		sprintf(pvmtxt, "%8x %8x %8x %6d %8x %8x\n",
! 				tp->t_tid, tp->t_ptid,
! 				tp->t_flag, tp->t_pid,
! 				tp->t_outtid, tp->t_trctid);
  		pvmlogerror(pvmtxt);
! 		pvmlogerror(" txq:pkt      src      dst   flag      len      ofs\n");
  		for (pp = tp->t_txq->pk_link; pp != tp->t_txq; pp = pp->pk_link) {
! 			sprintf(pvmtxt, "%08x %8x %8x %6x %8d %8d\n",
  					pp,
  					pp->pk_src,
  					pp->pk_dst,
--- 511,534 ----
  	struct pkt *pp;
  
  	pvmlogerror("task_dump()\n");
! 	pvmlogerror("     tid     ptid flag    pid soc out     wait   outtid   trctid    sched   es\n");
  	for (tp = locltasks->t_link; tp != locltasks; tp = tp->t_link) {
! 		sprintf(pvmtxt, "%8x %8x %4x %6d %3d %3d %8d %8x %8x %8x %4x\n",
! 				tp->t_tid,
! 				tp->t_ptid,
! 				tp->t_flag,
! 				tp->t_pid,
! 				tp->t_sock,
! 				tp->t_out,
! 				(tp->t_wait ? tp->t_wait->wa_wid : 0),
! 				tp->t_outtid,
! 				tp->t_trctid,
! 				tp->t_sched,
! 				tp->t_status);
  		pvmlogerror(pvmtxt);
! 		pvmlogerror(" txq:pkt      src      dst flag    len    ofs\n");
  		for (pp = tp->t_txq->pk_link; pp != tp->t_txq; pp = pp->pk_link) {
! 			sprintf(pvmtxt, "%08x %8x %8x %4x %6d %6d\n",
  					pp,
  					pp->pk_src,
  					pp->pk_dst,
***************
*** 529,532 ****
--- 540,544 ----
  	}
  	pvmlogerror("\n");
  }
+ 
  
