Prereq: 4
*** ../netlib/pvm3.3.4/src/patchlevel.h	Sun Sep  4 16:25:24 1994
--- src/patchlevel.h	Sat Oct 15 14:32:25 1994
***************
*** 1,3 ****
  
! #define PATCHLEVEL 4
  
--- 1,3 ----
  
! #define PATCHLEVEL 335
  
*** ../netlib/pvm3.3.4/Makefile	Fri Jun  3 15:55:49 1994
--- Makefile	Wed Nov  9 10:41:32 1994
***************
*** 6,11 ****
--- 6,13 ----
  #  c: console - pvm
  #  f: fortran lib - libfpvm3.a
  #  g: groups - pvmgs, libgpvm3.a
+ #  l: manual page links
+ #  e: examples
  #  m: xep example
  #
  
***************
*** 17,29 ****
  
  default:	s c f g
  
! all:	s f c g m
  
  clean:
! 	cd src; ../lib/aimk clean
! 	cd console; ../lib/aimk clean
! 	cd libfpvm; ../lib/aimk clean
! 	cd pvmgs; ../lib/aimk clean
  
  $(LIBDIR):
  	- mkdir $(LIBDIR)
--- 19,35 ----
  
  default:	s c f g
  
! all:	s c f g l e m
  
  clean:
! 	- cd src; ../lib/aimk clean
! 	- cd console; ../lib/aimk clean
! 	- cd libfpvm; ../lib/aimk clean
! 	- cd pvmgs; ../lib/aimk clean
! 	- cd man; chmod 755 mkmanlinks; ./mkmanlinks -u
! 	- cd examples; ../lib/aimk clean
! 	- cd gexamples; ../lib/aimk clean
! 	- cd xep; ../lib/aimk clean
  
  $(LIBDIR):
  	- mkdir $(LIBDIR)
***************
*** 36,41 ****
--- 42,48 ----
  
  ## build pvmd, libpvm ##
  s:
+ 	@ echo "building in src"
  	cd src; ../lib/aimk install
  
  s.hack:
***************
*** 43,62 ****
  
  ## build libfpvm ##
  f:
  	cd libfpvm; ../lib/aimk install
  
  ## build groups ##
  g:
  	cd pvmgs; ../lib/aimk install
  
  ## build pvm console ##
  c:
  	cd console; ../lib/aimk install
  
  c.hack:
  	cd console.hack; ../lib/aimk install
  
  ## build xep example ##
  m:
! 	cd xep; ../lib/aimk
  
--- 50,84 ----
  
  ## build libfpvm ##
  f:
+ 	@ echo "building libfpvm"
  	cd libfpvm; ../lib/aimk install
  
  ## build groups ##
  g:
+ 	@ echo "building group server and library"
  	cd pvmgs; ../lib/aimk install
  
  ## build pvm console ##
  c:
+ 	@ echo "building console"
  	cd console; ../lib/aimk install
  
  c.hack:
  	cd console.hack; ../lib/aimk install
  
+ ## build man page links ##
+ l:
+ 	@ echo "making man page links"
+ 	cd man; chmod 755 mkmanlinks; ./mkmanlinks
+ 
  ## build xep example ##
  m:
! 	@ echo "building xep example"
! 	- cd xep; ../lib/aimk
! 
! ## build example programs ##
! e:
! 	@ echo "building examples"
! 	- cd examples; ../lib/aimk all
! 	- cd gexamples; ../lib/aimk all
  
*** ../netlib/pvm3.3.4/Readme	Fri Jun  3 15:56:04 1994
--- Readme	Sun Oct 16 05:30:43 1994
***************
*** 25,31 ****
   the National Science Foundation and the State of Tennessee.
  
  ________________________________________________________________________
! PVM
  
  PVM is a software system that enables a collection of heterogeneous
  computers to be used as a coherent and flexible concurrent computational
--- 25,31 ----
   the National Science Foundation and the State of Tennessee.
  
  ________________________________________________________________________
! WHAT IS PVM?
  
  PVM is a software system that enables a collection of heterogeneous
  computers to be used as a coherent and flexible concurrent computational
***************
*** 47,83 ****
  separately from Netlib.  To get a list of available subsets, send
  e-mail to "netlib@ORNL.GOV" with the subject:  "send index from pvm3".
  
! Extract files so that this directory is ~/pvm3 .
  
  
- BUILDING
  
  Type "make" in this directory.  Make will use aimk to build the daemon
  executable (pvmd3), C library (libpvm3.a), Fortran library (libfpvm3.a)
  and console client program (pvm).
  
! 
! INSTALLING
! 
! The libraries and executables are installed in pvm3/lib/ARCH/, where
  ARCH is the host architecture name, e.g. "CRAY".
  
! The pvm console startup script (pvm3/lib/pvm) should be in your shell
! search path.  This script determines machine architecture and runs the
! correct console program in pvm3/lib/ARCH/pvm.
  
  
- STARTING DAEMONS
  
! To start pvm, run pvm3/lib/pvm.  This starts the console task, which
! execs a pvmd if one is not already running.  More hosts can be started
! by using the console "add" command.
  
! To stop pvm, use the pvm console command "halt".
  
! For more information about the console commands, use the console "help"
! function.
  
  To start the pvmd without starting the console, run pvm3/lib/pvmd .
  A number of hosts can be started by supplying the pvmd with a host
  file.
--- 47,130 ----
  separately from Netlib.  To get a list of available subsets, send
  e-mail to "netlib@ORNL.GOV" with the subject:  "send index from pvm3".
  
! Files in the distribution unpack in directory pvm3.  The pvm3 directory
! can reside in either a private or shared disk area.  Installations for
! multiple machine architectures can coexist because compiled files are
! placed in subdirectories named for each architecture.
  
+     Directory   Contains
+     ---------------------------------------------------------------
+     bin/ARCH    System PVM executables
+     conf        Configuration files for the PVM architectures
+     console     Source for the pvm console
+     doc         Miscellaneous documentation
+     examples    Example PVM programs
+     gexamples   More example PVM programs - for group library
+     hoster      An example "hoster" program
+     include     Header files for PVM programs
+     lib         Generic system executables (scripts)
+     lib/ARCH    System executables
+     libfpvm     Source for the libfpvm Fortran library
+     man         Online manual pages (nroff format)
+     patches     Patch files, as released
+     pvmgs       Source for the libgpvm library and group nameserver
+     src         Source for the libpvm library and pvmd daemon
+     tasker      An example "tasker" program
+     xep         An example interactive X-Window program
  
  
+ BUILDING AND INSTALLING
+ 
+ Before building or running PVM, you must set environment variable PVM_ROOT
+ to the path where PVM resides, i.e. the path of this directory.  This can
+ be in a private area, for example $HOME/pvm3, or a public one, such as
+ /usr/local/pvm3.
+ 
+ If your shell is csh, add a line such as:
+ 
+     setenv PVM_ROOT $HOME/pvm3
+ 
+ to your .cshrc file.  If you use a shell that reads .profile, add the
+ following lines to that file:
+ 
+     PVM_ROOT=$HOME/pvm3
+     PVM_DPATH=$PVM_ROOT/lib/pvmd
+     export PVM_ROOT PVM_DPATH
+ 
+ The use of these variables is explained more fully in the pvm_intro man
+ page.
+ 
  Type "make" in this directory.  Make will use aimk to build the daemon
  executable (pvmd3), C library (libpvm3.a), Fortran library (libfpvm3.a)
  and console client program (pvm).
  
! The libraries and executables are installed in $PVM_ROOT/lib/ARCH/, where
  ARCH is the host architecture name, e.g. "CRAY".
  
! The scripts $PVM_ROOT/lib/pvm and $PVM_ROOT/lib/pvmd are used,
! respectively, to start the PVM console and pvmd.  They determine the
! machine architecture and run the actual programs in $PVM_ROOT/lib/ARCH.
! You can either copy these scripts to your bin directory or add
! $PVM_ROOT/lib to your shell search path.
  
+ You may wish to add $PVM_ROOT/man to your MANPATH environment variable,
+ if it's supported on your system.  This will allow you to easily read
+ the online manual pages.
  
  
! STARTING AND STOPPING PVM
  
! To start PVM, run $PVM_ROOT/lib/pvm.  This starts the console task, which
! in turn starts a pvmd if one is not already running.  More hosts can be
! started by using the console "add" command.
  
! To stop PVM, use the PVM console command "halt".  From programs, use the
! pvm_halt() function.  You can also kill the pvmd (always use a catchable
! signal).
  
+ For more information about the console commands, see the console "help"
+ function or console man page.
+ 
  To start the pvmd without starting the console, run pvm3/lib/pvmd .
  A number of hosts can be started by supplying the pvmd with a host
  file.
***************
*** 85,102 ****
  
  APPLICATION PROGRAMS
  
! C, C++ and Fortran programs should be linked with pvm3/lib/ARCH/libpvm3.a .
! Fortran programs should also be linked with pvm3/lib/ARCH/libfpvm3.a .
  Include C/C++ header file pvm3/include/pvm3.h for constants and function
! prototypes.  Fortran header file is in pvm3/include/fpvm3.h.  Executables
! should be installed in pvm3/bin/ARCH .
  
  
  CONTACT
  
  Please direct any e-mail (questions, bugs, bug fixes, etc.) to:
  
! 	pvm@msr.EPM.ORNL.GOV.
  
  A newsgroup, comp.parallel.pvm, exists for discussion about PVM.
  
--- 132,151 ----
  
  APPLICATION PROGRAMS
  
! C, C++ and Fortran programs must be linked with pvm3/lib/ARCH/libpvm3.a .
! Fortran programs must also be linked with pvm3/lib/ARCH/libfpvm3.a .
  Include C/C++ header file pvm3/include/pvm3.h for constants and function
! prototypes.  Fortran header file is in pvm3/include/fpvm3.h.
  
+ Executables should be installed in pvm3/bin/ARCH .  This path can be
+ changed; see the pvmd man page.
  
+ 
  CONTACT
  
  Please direct any e-mail (questions, bugs, bug fixes, etc.) to:
  
!     pvm@msr.EPM.ORNL.GOV.
  
  A newsgroup, comp.parallel.pvm, exists for discussion about PVM.
  
*** ../netlib/pvm3.3.4/Readme.mp	Fri Jun  3 15:56:10 1994
--- Readme.mp	Mon Nov  7 12:02:38 1994
***************
*** 32,37 ****
--- 32,38 ----
  has no effect, but turning on PvmRouteDirect in a host task could cause
  problems.
  
+ 	PVM message tags above 999999000 are reserved for internal use.
  
  
  iPSC/860
***************
*** 52,58 ****
  	To make the examples, repeat the above steps in the "examples"
  directory but use ../lib/aimk instead of make. (Note that aimk ---
  and pvmd, pvmgetarch, etc. --- is a sh script. You have to run them
! under sh instead of csh.)
  
  	To build pvmd and libpvm3.a on a remote host (Sun/SGI) instead of
  the SRM, try 
--- 53,61 ----
  	To make the examples, repeat the above steps in the "examples"
  directory but use ../lib/aimk instead of make. (Note that aimk ---
  and pvmd, pvmgetarch, etc. --- is a sh script. You have to run them
! under sh instead of csh. The i386 frontend running sysV3.2 does not 
! understand #!, so you have to put a blank line at the beginning of
! the scripts.)
  
  	To build pvmd and libpvm3.a on a remote host (Sun/SGI) instead of
  the SRM, try 
***************
*** 152,172 ****
  
  BUGS AND CAVEATS
  
! 	1. In T9 parallel applications cannot be started with 'rsh', so this
! is not a "true" PVM. The PVM daemon cannot be started from other machines,
! neither can it start pvm daemons on other machines.
! 
! 	2. The pvm function "pvm_spawn()/pvmfspawn()" creates tasks on the 
  nodes by default. The host (master) process must be run from Unix and 
  then use the "pvm_mytid()/pvmfmytid()" function to enroll in PVM.
  
! 	3. In T9 parallel applications can hang for various reasons. If this
! happens and no one else is using the machine, consult your Intel engineers.
! If you cannot start the pvm console, try running pvmd with the trace 
! function enable (i.e. pvmd -dff). You can also determine the state of 
! pvmd with the Unix command "ps".
! 
! 	4. By default PVM spawns tasks in your default partition. You can use
  the NX command-line options such as "-pn partition_name" to force it to
  run on a particular partition or "-sz number_of_nodes" to specify the
  number of nodes you want it to use. Setting the environmental variable 
--- 155,165 ----
  
  BUGS AND CAVEATS
  
! 	1. The pvm function "pvm_spawn()/pvmfspawn()" creates tasks on the 
  nodes by default. The host (master) process must be run from Unix and 
  then use the "pvm_mytid()/pvmfmytid()" function to enroll in PVM.
  
! 	2. By default PVM spawns tasks in your default partition. You can use
  the NX command-line options such as "-pn partition_name" to force it to
  run on a particular partition or "-sz number_of_nodes" to specify the
  number of nodes you want it to use. Setting the environmental variable 
***************
*** 176,196 ****
  would force it to run on the partition "pvm" using only 33 nodes (there
  must be at least that many nodes in the partition).
  
! 	6. The T9 operating system is rather fragile. To ensure your safety
  try to run only one PVM master/slaves application at a time. DO NOT spawn
  more tasks than the number of nodes allocated to PVM. If PVM appears hung,
  halt it (or kill it if necessary) and restart. Be sure to test the examples
  provided before attempting to run your own applications.
  
! 	7. There is a constant TIMEOUT in the file "pvmmimd.h" that controls 
  the frequency at which the PVM daemon probes for packets from node tasks. 
  If you want it to respond more quickly you can reduce this value. 
  Currently it is set to 10 millisecond.
  
! 	8. DO NOT use any native NX message passing calls in PVM or they
  may interfere with pvm_send()/pvm_recv().
  
! 	9. Messages printed to "stderr/stdout" by node tasks do not end up in
  the log file "/tmp/pvml.uid".
  
  
--- 169,189 ----
  would force it to run on the partition "pvm" using only 33 nodes (there
  must be at least that many nodes in the partition).
  
! 	3. The T9 operating system is rather fragile. To ensure your safety
  try to run only one PVM master/slaves application at a time. DO NOT spawn
  more tasks than the number of nodes allocated to PVM. If PVM appears hung,
  halt it (or kill it if necessary) and restart. Be sure to test the examples
  provided before attempting to run your own applications.
  
! 	4. There is a constant TIMEOUT in the file "pvmmimd.h" that controls 
  the frequency at which the PVM daemon probes for packets from node tasks. 
  If you want it to respond more quickly you can reduce this value. 
  Currently it is set to 10 millisecond.
  
! 	5. DO NOT use any native NX message passing calls in PVM or they
  may interfere with pvm_send()/pvm_recv().
  
! 	6. Messages printed to "stderr/stdout" by node tasks do not end up in
  the log file "/tmp/pvml.uid".
  
  
***************
*** 292,298 ****
  APPLICATION PROGRAMS
  
  	All PVM programs must be linked with the thread library (-lthread).
! Refer to the example Makefile (pvm3/examples/SUN4SOL2/Makefile) for 
  details.
  
  
--- 285,291 ----
  APPLICATION PROGRAMS
  
  	All PVM programs must be linked with the thread library (-lthread).
! Refer to the example Makefile (pvm3/examples/SUNMP/Makefile) for 
  details.
  
  
***************
*** 336,342 ****
  
  	All PVM programs must be linked with the mutex library (-lmutex)
  as well as the XDR library (-lsun). Refer to the example Makefile
! (pvm3/examples/SGI/Makefile) for details.
  
  
  BUGS
--- 329,335 ----
  
  	All PVM programs must be linked with the mutex library (-lmutex)
  as well as the XDR library (-lsun). Refer to the example Makefile
! (pvm3/examples/SGIMP/Makefile) for details.
  
  
  BUGS
*** ../netlib/pvm3.3.4/conf/LINUX.def	Mon Jul 18 16:06:44 1994
--- conf/LINUX.def	Sat Oct 15 14:33:41 1994
***************
*** 1,4 ****
! ARCHCFLAGS	=	-DNOSOCKOPT -DSYSVSIGNAL -DNOWAIT3 -DNOUNIXDOM -DRSHCOMMAND=\"/usr/bin/rsh\"
  ARCHDLIB	=
  ARCHDOBJ	=
  ARCHLIB	=
--- 1,4 ----
! ARCHCFLAGS	=	-DSYSVSIGNAL -DNOWAIT3 -DNOUNIXDOM -DRSHCOMMAND=\"/usr/bin/rsh\"
  ARCHDLIB	=
  ARCHDOBJ	=
  ARCHLIB	=
*** /dev/null	Wed Nov  9 10:53:20 1994
--- conf/SCO.def	Mon Oct 24 16:26:00 1994
***************
*** 0 ****
--- 1,6 ----
+ ARCHCFLAGS	=	 -DSYSVSTR -DSYSVSIGNAL -D__SCO_WAIT3__ -DNOUNIXDOM -DRSHCOMMAND=\"/usr/bin/rsh\"
+ ARCHDLIB	=	-lsocket
+ ARCHDOBJ	=
+ ARCHLIB	=	-lrpc -lsocket
+ HASRANLIB	=	
+ PVM_ARCH	=	SCO
*** /dev/null	Wed Nov  9 10:53:21 1994
--- conf/SGI64.def	Mon Oct 24 08:49:16 1994
***************
*** 0 ****
--- 1,6 ----
+ ARCHCFLAGS	=	-DSYSVSIGNAL -DRSHCOMMAND=\"/usr/bsd/rsh\" -DNOWAIT3 -64 -TENV:large_GOT=ON -woff 1174 -DHASSTDLIB
+ #ARCHDLIB	=	-lsun -lmutex
+ ARCHDOBJ	=
+ #ARCHLIB	=	-lsun -lmutex
+ HASRANLIB	=	f
+ PVM_ARCH	=	SGI64
*** /dev/null	Wed Nov  9 10:53:21 1994
--- conf/SGI64.m4	Tue Sep  6 17:38:58 1994
***************
*** 0 ****
--- 1,19 ----
+ divert(-1)
+ undefine(`len')
+ #
+ # append an underscore to FORTRAN function names
+ #
+ define(`FUNCTION',`$1_')
+ #
+ # FORTRAN character strings are passed as follows:
+ # a pointer to the base of the string is passed in the normal
+ # argument list, and the length is passed by value as an extra
+ # argument, after all of the other arguments.
+ #
+ define(`ARGS',`($1`'undivert(1))')
+ define(`SAVE',`divert(1)$1`'divert(0)')
+ define(`STRING_ARG',`$1_ptr`'SAVE(`, $1_len')')
+ define(`STRING_ARG_DECL',`char * $1_ptr; int $1_len')
+ define(`STRING_LEN',`$1_len')
+ define(`STRING_PTR',`$1_ptr')
+ divert(0)
*** /dev/null	Wed Nov  9 10:53:21 1994
--- conf/SGIMP64.def	Fri Sep  9 11:38:49 1994
***************
*** 0 ****
--- 1,6 ----
+ ARCHCFLAGS	=	-DSYSVSIGNAL -DRSHCOMMAND=\"/usr/bsd/rsh\" -DNOUNIXDOM -64 -TENV:large_GOT=ON -woff 1174 -DHASSTDLIB
+ #ARCHDLIB	=	-lsun -lmutex
+ ARCHDOBJ	=
+ #ARCHLIB	=	-lsun -lmutex
+ HASRANLIB	=	f
+ PVM_ARCH	=	SGIMP64
*** /dev/null	Wed Nov  9 10:53:21 1994
--- conf/SGIMP64.m4	Tue Sep  6 17:39:28 1994
***************
*** 0 ****
--- 1,19 ----
+ divert(-1)
+ undefine(`len')
+ #
+ # append an underscore to FORTRAN function names
+ #
+ define(`FUNCTION',`$1_')
+ #
+ # FORTRAN character strings are passed as follows:
+ # a pointer to the base of the string is passed in the normal
+ # argument list, and the length is passed by value as an extra
+ # argument, after all of the other arguments.
+ #
+ define(`ARGS',`($1`'undivert(1))')
+ define(`SAVE',`divert(1)$1`'divert(0)')
+ define(`STRING_ARG',`$1_ptr`'SAVE(`, $1_len')')
+ define(`STRING_ARG_DECL',`char * $1_ptr; int $1_len')
+ define(`STRING_LEN',`$1_len')
+ define(`STRING_PTR',`$1_ptr')
+ divert(0)
*** ../netlib/pvm3.3.4/conf/SUNMP.def	Sat Jun  4 17:52:08 1994
--- conf/SUNMP.def	Sat Oct 15 14:34:03 1994
***************
*** 4,7 ****
  ARCHLIB	=	-lnsl -lsocket -lthread
  HASRANLIB	=	f
  PVM_ARCH	=	SUNMP
- CC	=	gcc
--- 4,6 ----
*** /dev/null	Wed Nov  9 10:53:22 1994
--- conf/SX3.def	Sat Oct 22 15:41:09 1994
***************
*** 0 ****
--- 1,6 ----
+ ARCHCFLAGS = -DSYSVSIGNAL -DNOWAIT3 -DNOGETDTBLSIZ -DNOSTRCASE -DNOWAITPID -DHASSTDLIB
+ ARCHDLIB   =
+ ARCHDOBJ   =
+ ARCHLIB    =
+ HASRANLIB  =	f
+ PVM_ARCH   =	SX3
*** /dev/null	Wed Nov  9 10:53:22 1994
--- conf/SX3.m4	Fri Oct 14 12:41:47 1994
***************
*** 0 ****
--- 1,20 ----
+ divert(-1)
+ undefine(`len')
+ #
+ # append an underscore to FORTRAN function names
+ #
+ define(`FUNCTION',`$1_')
+ #
+ # FORTRAN character strings are passed as follows:
+ # a pointer to the base of the string is passed in the normal
+ # argument list, and the length is passed by value as an extra
+ # argument, after all of the other arguments.
+ #
+ define(`ARGS',`($1`'undivert(1))')
+ define(`SAVE',`divert(1)$1`'divert(0)')
+ define(`STRING_ARG',`$1_ptr`'SAVE(`, $1_len')')
+ define(`STRING_ARG_DECL',`char * $1_ptr; int $1_len')
+ define(`INT_ARG_DECL',`int * $1')
+ define(`STRING_LEN',`$1_len')
+ define(`STRING_PTR',`$1_ptr')
+ divert(0)
*** ../netlib/pvm3.3.4/conf/UXPM.def	Sun Sep  4 16:25:26 1994
--- conf/UXPM.def	Sat Oct 15 14:34:28 1994
***************
*** 1,4 ****
! ARCHCFLAGS	=	-DSYSVBFUNC -DSYSVSTR -DNOGETDTBLSIZ -DSYSVSIGNAL -DNOWAIT3 -DNOUNIXDOM
  ARCHDLIB	=	-lnsl -lsocket
  ARCHDOBJ	=
  ARCHLIB	=	-lnsl -lsocket
--- 1,4 ----
! ARCHCFLAGS	=	-DSYSVBFUNC -DSYSVSTR -DNOGETDTBLSIZ -DSYSVSIGNAL -DNOWAIT3 -DNOUNIXDOM -DRSHCOMMAND=\"/usr/bin/rsh\"
  ARCHDLIB	=	-lnsl -lsocket
  ARCHDOBJ	=
  ARCHLIB	=	-lnsl -lsocket
*** /dev/null	Wed Nov  9 10:53:24 1994
--- console/SGIMP64/Makefile	Mon Oct 24 09:56:35 1994
***************
*** 0 ****
--- 1,14 ----
+ PVM_ARCH	=	SGIMP64
+ CONFFILE	=	$(PVM_ROOT)/conf/$(PVM_ARCH).def
+ LIBDIR		=	$(PVM_ROOT)/lib/$(PVM_ARCH)
+ #
+ install:	default $(LIBDIR)
+ 		
+ default:    
+ 	make PVMLIB=-lpvm3s -f $(CONFFILE) -f ../Makefile.aimk install
+ 
+ clean:
+ 	make -f $(CONFFILE) -f ../Makefile.aimk clean
+ 	
+ $(LIBDIR):
+ 	mkdir $(LIBDIR)
*** ../netlib/pvm3.3.4/console/cmds.c	Fri Jun  3 16:01:51 1994
--- console/cmds.c	Sat Oct 15 14:39:34 1994
***************
*** 32,37 ****
--- 32,40 ----
   *	PVM console commands.
   *
  $Log: cmds.c,v $
+  * Revision 1.3  1994/10/15  18:38:56  manchek
+  * updated task flags and ps list headers
+  *
   * Revision 1.2  1994/06/03  20:01:51  manchek
   * version 3.3.0
   *
***************
*** 134,140 ****
  	{ 0, 0, 0, 0 }
  };
  
! static char rcsid[] = "$Id: cmds.c,v 1.2 1994/06/03 20:01:51 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 $";
  
  
  freealias(ap)
***************
*** 459,464 ****
--- 462,468 ----
  	"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",
  	"ps   a   task waiting authorization",
  	"ps   o   task connection being closed",
***************
*** 957,963 ****
  
  
  static char *tflgs[] = {
! 	"?", "?", "c", "a", "o", "?", "?", "?",
  	"R", "H", "T"
  };
  
--- 961,967 ----
  
  
  static char *tflgs[] = {
! 	0, "f", "c", "a", "o", 0, 0, 0,
  	"R", "H", "T"
  };
  
***************
*** 968,978 ****
  	static char buf[64];
  	int bit, i;
  
! 	sprintf(buf, "0x%x/", f);
  	i = sizeof(tflgs)/sizeof(tflgs[0]) - 1;
  	bit = 1 << i;
  	while (i >= 0) {
! 		if (f & bit) {
  			strcat(buf, tflgs[i]);
  			strcat(buf, ",");
  		}
--- 972,982 ----
  	static char buf[64];
  	int bit, i;
  
! 	sprintf(buf, "%x/", f);
  	i = sizeof(tflgs)/sizeof(tflgs[0]) - 1;
  	bit = 1 << i;
  	while (i >= 0) {
! 		if ((f & bit) && tflgs[i]) {
  			strcat(buf, tflgs[i]);
  			strcat(buf, ",");
  		}
***************
*** 988,997 ****
  	int lflg;
  {
  	if (lflg)
! 		fputs("                    HOST      TID     PTID    PID      FLAG COMMAND\n",
  			stdout);
  	else
! 		fputs("                    HOST      TID      FLAG COMMAND\n",
  			stdout);
  }
  
--- 992,1001 ----
  	int lflg;
  {
  	if (lflg)
! 		fputs("                    HOST      TID     PTID    PID   FLAG 0x COMMAND\n",
  			stdout);
  	else
! 		fputs("                    HOST      TID   FLAG 0x COMMAND\n",
  			stdout);
  }
  
*** ../netlib/pvm3.3.4/console/cons.c	Fri Jun  3 16:01:52 1994
--- console/cons.c	Sat Oct 15 14:40:54 1994
***************
*** 33,38 ****
--- 33,41 ----
   *	machine and other tasks.
   *
  $Log: cons.c,v $
+  * Revision 1.4  1994/10/15  18:40:09  manchek
+  * don't compare add-host notify source to 0x80000000
+  *
   * Revision 1.3  1994/06/03  20:01:52  manchek
   * version 3.3.0
   *
***************
*** 79,85 ****
  struct pvmhostinfo *hostlist = 0;
  struct alias *aliases = 0;
  
! static char rcsid[] = "$Id: cons.c,v 1.3 1994/06/03 20:01:52 manchek Exp $";
  
  
  main(argc, argv)
--- 82,88 ----
  struct pvmhostinfo *hostlist = 0;
  struct alias *aliases = 0;
  
! static char rcsid[] = "$Id: cons.c,v 1.4 1994/10/15 18:40:09 manchek Exp $";
  
  
  main(argc, argv)
***************
*** 321,327 ****
  	while ((cc = pvm_nrecv(-1, -1)) > 0) {
  		pvm_bufinfo(cc, &len, &cod, &src);
  
! 		if (cod == 0 && src == 0x80000000) {
  			pvm_upkint(&n, 1, 1);
  			dtids = TALLOC(n, int, "");
  			pvm_upkint(dtids, n, 1);
--- 324,330 ----
  	while ((cc = pvm_nrecv(-1, -1)) > 0) {
  		pvm_bufinfo(cc, &len, &cod, &src);
  
! 		if (cod == 0) {
  			pvm_upkint(&n, 1, 1);
  			dtids = TALLOC(n, int, "");
  			pvm_upkint(dtids, n, 1);
*** ../netlib/pvm3.3.4/console/myalloc.h	Fri Jun  3 16:01:53 1994
--- console/myalloc.h	Mon Nov  7 15:53:51 1994
***************
*** 32,37 ****
--- 32,40 ----
   *	Malloc defines.
   *
  $Log: myalloc.h,v $
+  * Revision 1.3  1994/11/07  20:53:43  manchek
+  * include stdlib if available
+  *
   * Revision 1.2  1994/06/03  20:01:53  manchek
   * version 3.3.0
   *
***************
*** 40,45 ****
--- 43,51 ----
   *
   */
  
+ #ifdef HASSTDLIB
+ #include <stdlib.h>
+ #endif
  
  #define	MY_ALLOC(n,g)		malloc((unsigned)(n))
  #define	MY_REALLOC(p,n)		realloc((char*)(p),(unsigned)(n))
*** ../netlib/pvm3.3.4/doc/arches	Sun Sep  4 16:25:26 1994
--- doc/arches	Wed Oct 26 09:15:00 1994
***************
*** 1,6 ****
  
! PVM version 3.3 Architecture list
! 26 Aug 1994
  
  ________________________________________________________________________
  
--- 1,6 ----
  
! PVM version 3.3 Architecture list for this distribution
! 26 October 1994
  
  ________________________________________________________________________
  
***************
*** 36,48 ****
  POWER4    IBM Power-4
  RS6K      IBM/RS6000
  RT        IBM/RT
  SGI       Silicon Graphics IRIS            [2]
  SGI5      Silicon Graphics IRIS OS >= 5.0  [2]
! SGIMP     Silicon Graphics IRIS multiprocessor
  SUN3      Sun 3
  SUN4      Sun 4, 4c, sparc, etc.
  SUN4SOL2  Sun 4 running Solaris
  SUNMP     Sun 4 multiprocessor
  SYMM      Sequent Symmetry
  TITN      Stardent Titan                   [1]
  UVAX      DEC/Microvax
--- 36,52 ----
  POWER4    IBM Power-4
  RS6K      IBM/RS6000
  RT        IBM/RT
+ SCO       80[34]86 running SCO Unix
  SGI       Silicon Graphics IRIS            [2]
  SGI5      Silicon Graphics IRIS OS >= 5.0  [2]
! SGIMP     Silicon Graphics IRIS multiprocessor with OS >= 5.0
! SGI64     Silicon Graphics IRIS OS >= 6.0
! SGIMP64   Silicon Graphics IRIS multiprocessor with OS >= 6.0
  SUN3      Sun 3
  SUN4      Sun 4, 4c, sparc, etc.
  SUN4SOL2  Sun 4 running Solaris
  SUNMP     Sun 4 multiprocessor
+ SX3       NEC SX-3
  SYMM      Sequent Symmetry
  TITN      Stardent Titan                   [1]
  UVAX      DEC/Microvax
***************
*** 51,63 ****
  
  Notes:
  
! [4]	We've heard of trouble when using -O2 optimization or higher.
  
  [3] Native-mode port available.
  
! [2]	Add "-lsun" to loader libs when using libpvm.
! 	If using YP, may have to add "-lsun" to ARCHDLIBS in Makefile.
  
! [1]	Doesn't have rexec(); pvmd startup is limited to rsh, hence pw
! 	option is not allowed in the hostfile.
  
--- 55,67 ----
  
  Notes:
  
! [4] We've heard of trouble when using -O2 optimization or higher.
  
  [3] Native-mode port available.
  
! [2] Add "-lsun" to loader libs when using libpvm.
!     If using YP, may have to add "-lsun" to ARCHDLIBS in Makefile.
  
! [1] Doesn't have rexec(); pvmd startup is limited to rsh, hence pw
!     option is not allowed in the hostfile.
  
*** ../netlib/pvm3.3.4/examples/CUBE/Makefile	Sat Jun  4 18:40:45 1994
--- examples/CUBE/Makefile	Mon Nov  7 12:02:39 1994
***************
*** 26,32 ****
  F77     =	if77
  FFLAGS	=	-O
  FLIBS	=	$(PVMDIR)/lib/$(PVM_ARCH)/libfpvm3pe.a
! GLIBS	=	$(PVM_ROOT)/lib/$(PVM_ARCH)/libgpvm3.a
  
  
  default:	
--- 26,32 ----
  F77     =	if77
  FFLAGS	=	-O
  FLIBS	=	$(PVMDIR)/lib/$(PVM_ARCH)/libfpvm3pe.a
! GLIBS	=	$(PVM_ROOT)/lib/$(PVM_ARCH)/libgpvm3pe.a
  
  
  default:	
*** ../netlib/pvm3.3.4/examples/Makefile.aimk	Fri Jul  1 11:27:15 1994
--- examples/Makefile.aimk	Mon Oct 24 17:06:06 1994
***************
*** 14,24 ****
  #
  
  SDIR	=	..
! BDIR	=	$(HOME)/pvm3/bin
  XDIR	=	$(BDIR)/$(PVM_ARCH)
  
  CC	=	cc
! CFLAGS	=	-g -I$(PVM_ROOT)/include
  LIBS	=	-lpvm3 $(ARCHLIB)
  GLIBS	=	-lgpvm3
  
--- 14,26 ----
  #
  
  SDIR	=	..
! #BDIR	=	$(HOME)/pvm3/bin
! BDIR	=	$(SDIR)/../bin
  XDIR	=	$(BDIR)/$(PVM_ARCH)
  
  CC	=	cc
! OPTIONS	=	-O
! CFLAGS	=	$(OPTIONS) -I$(PVM_ROOT)/include $(ARCHCFLAGS)
  LIBS	=	-lpvm3 $(ARCHLIB)
  GLIBS	=	-lgpvm3
  
***************
*** 103,105 ****
--- 105,112 ----
  fgexample: $(SDIR)/gexample.f $(XDIR)
  	$(F77) $(FFLAGS) -o gexample $(SDIR)/gexample.f $(LFLAGS) $(FLIBS) $(GLIBS) $(LIBS)
  	mv gexample $(XDIR)
+ 
+ nntime:	$(SDIR)/nntime.c $(XDIR)
+ 	$(CC) $(CFLAGS) -D$(PVM_ARCH) -DPVM -o nntime $(SDIR)/nntime.c $(LFLAGS) $(LIBS)
+ 	mv nntime $(XDIR)
+ 
*** ../netlib/pvm3.3.4/examples/Readme	Fri Mar 18 12:35:11 1994
--- examples/Readme	Wed Nov  9 09:22:40 1994
***************
*** 55,60 ****
--- 55,61 ----
  	aimk master slave         C version of master/slave example
  	aimk fmaster fslave       FORTRAN version of master/slave example
  	aimk spmd                 C version of SPMD example
+ 	(aimk spmdh spmd          on Paragon/CM5/I860)
  	aimk fspmd                FORTRAN version of SPMD example
  	aimk testall              FORTRAN interface tester
      aimk gexample             C version of reduce example
***************
*** 77,87 ****
  simply execute any of the following at any UNIX prompt in the VM
  	hello
  	master1
! 	spmd
  	testall
      gexample
  	timing
      hitc
  
  Step 3 Stop PVM
  When the user is through with the virtual machine 
--- 78,89 ----
  simply execute any of the following at any UNIX prompt in the VM
  	hello
  	master1
! 	spmd (spmdh on Paragon/CM5/I860)
  	testall
      gexample
  	timing
      hitc
+ 	nntime (on Paragon/CM5/I860, from pvm console: spawn -2 nntime)
  
  Step 3 Stop PVM
  When the user is through with the virtual machine 
*** ../netlib/pvm3.3.4/examples/SGIMP/Makefile	Mon May  9 22:00:27 1994
--- examples/SGIMP/Makefile	Mon Oct 24 10:42:44 1994
***************
*** 1,85 ****
  #
! # Custom section
! # Set PVM_ARCH to your architecture type (SUN4, HP9K, RS6K, SGI, etc)
! # if PVM_ARCH = BSD386 then set ARCHLIB = -lrpc
! # if PVM_ARCH = SGI    then set ARCHLIB = -lsun
! # if PVM_ARCH = I860   then set ARCHLIB = -lrpc -lsocket
! # if PVM_ARCH = IPSC2  then set ARCHLIB = -lrpc -lsocket
  # otherwise leave ARCHLIB blank
  #
- # PVM_ARCH and ARCHLIB are set for you if you use 'aimk'.
- #
- PVM_ARCH	=	SGIMP
- ARCHLIB		=	-lsun -lmutex
- # END of custom section - leave this line here
- #
- PVMDIR	=	../..
- PVMLIB	=	$(PVMDIR)/lib/$(PVM_ARCH)/libpvm3.a
  SDIR	=	..
! BDIR	=	$(PVMDIR)/bin
  XDIR	=	$(BDIR)/$(PVM_ARCH)
  
  CC	=	cc
! CFLAGS	=	-O -I../../include
! LIBS	=	$(PVMLIB) $(ARCHLIB)
  
! F77     =	f77
  FFLAGS	=	-g
! FLIBS	=	$(PVMDIR)/lib/$(PVM_ARCH)/libfpvm3.a $(LIBS)
  
  default:	hello hello_other
  
  $(XDIR):
  	- mkdir $(BDIR)
  	- mkdir $(XDIR)
  
! clean:
! 	rm -f *.o timing_slave timing spmd fspmd master slave fmaster fslave testall
! 
! hello: $(SDIR)/hello.c  $(XDIR)
! 	$(CC) $(CFLAGS) -o hello $(SDIR)/hello.c $(LIBS)
  	mv hello $(XDIR)
  
! hello_other: $(SDIR)/hello_other.c  $(XDIR)
! 	$(CC) $(CFLAGS) -o hello_other $(SDIR)/hello_other.c $(LIBS)
  	mv hello_other $(XDIR)
  
! timing_slave: $(SDIR)/timing_slave.c  $(XDIR)
! 	$(CC) $(CFLAGS) -o timing_slave $(SDIR)/timing_slave.c  $(LIBS)
  	mv timing_slave $(XDIR)
  
! timing: $(SDIR)/timing.c  $(XDIR)
! 	$(CC) $(CFLAGS) -o timing $(SDIR)/timing.c $(LIBS)
  	mv timing $(XDIR)
  
! spmd: $(SDIR)/spmd.c  $(XDIR)
! 	$(CC) $(CFLAGS) -o spmd $(SDIR)/spmd.c $(LIBS)
  	mv spmd $(XDIR)
  
! fspmd: $(SDIR)/spmd.f  $(XDIR)
! 	$(F77) $(FFLAGS) -o spmd $(SDIR)/spmd.f $(FLIBS)
  	mv spmd $(XDIR)
  
! master: $(SDIR)/master1.c  $(XDIR)
! 	$(CC) $(CFLAGS) -o master1 $(SDIR)/master1.c  $(LIBS)
  	mv master1 $(XDIR)
  
! slave: $(SDIR)/slave1.c  $(XDIR)
! 	$(CC) $(CFLAGS) -o slave1 $(SDIR)/slave1.c  $(LIBS)
  	mv slave1 $(XDIR)
  
! fmaster: $(SDIR)/master1.f  $(XDIR)
! 	$(F77) $(FFLAGS) -o master1 $(SDIR)/master1.f $(FLIBS)
  	mv master1 $(XDIR)
  
! fslave: $(SDIR)/slave1.f  $(XDIR)
! 	$(F77) $(FFLAGS) -o slave1 $(SDIR)/slave1.f $(FLIBS)
  	mv slave1 $(XDIR)
  
! testall: $(SDIR)/testall.f  $(XDIR)
! 	$(F77) $(FFLAGS) -o testall $(SDIR)/testall.f $(FLIBS)
  	mv testall $(XDIR)
  
! nntime:	$(SDIR)/nntime.c  $(XDIR)
! 	$(CC) $(CFLAGS) -D$(PVM_ARCH) -DPVM -o nntime $(SDIR)/nntime.c $(LIBS)
  	mv nntime $(XDIR)
--- 1,108 ----
+ ARCHCFLAGS	=	-DSYSVSIGNAL -DRSHCOMMAND=\"/usr/bsd/rsh\" -DNOUNIXDOM
+ ARCHLIB	=	-lsun -lmutex
+ PVM_ARCH	=	SGIMP
  #
! # Custom makefile for PVM example programs.
! #
! # Set PVM_ROOT to the path where PVM includes and libraries are installed.
! # Set PVM_ARCH to your architecture type (SUN4, HP9K, RS6K, SGI, etc.)
! # Set ARCHLIB to any special libs needed on PVM_ARCH (-lrpc, -lsocket, etc.)
  # otherwise leave ARCHLIB blank
  #
  SDIR	=	..
! #BDIR	=	$(HOME)/pvm3/bin
! BDIR	=	$(SDIR)/../bin
  XDIR	=	$(BDIR)/$(PVM_ARCH)
  
  CC	=	cc
! OPTIONS	=	-O
! CFLAGS	=	$(OPTIONS) -I$(PVM_ROOT)/include $(ARCHCFLAGS)
! LIBS	=	-lpvm3 $(ARCHLIB)
! GLIBS	=	-lgpvm3
  
! F77	=	f77
  FFLAGS	=	-g
! FLIBS	=	-lfpvm3
  
+ LFLAGS	=	-L$(PVM_ROOT)/lib/$(PVM_ARCH)
+ 
  default:	hello hello_other
  
+ all: c-all f-all
+ 
+ c-all:	gexample hello hello_other master slave spmd timing timing_slave
+ 
+ f-all:	fgexample fmaster fslave fspmd hitc hitc_slave testall
+ 
+ clean:
+ 	rm -f *.o gexample hello hello_other hitc hitc_slave master1 slave1 \
+ 		spmd testall timing timing_slave
+ 
  $(XDIR):
  	- mkdir $(BDIR)
  	- mkdir $(XDIR)
  
! hello: $(SDIR)/hello.c $(XDIR)
! 	$(CC) $(CFLAGS) -o hello $(SDIR)/hello.c $(LFLAGS) $(LIBS)
  	mv hello $(XDIR)
  
! hello_other: $(SDIR)/hello_other.c $(XDIR)
! 	$(CC) $(CFLAGS) -o hello_other $(SDIR)/hello_other.c $(LFLAGS) $(LIBS)
  	mv hello_other $(XDIR)
  
! timing_slave: $(SDIR)/timing_slave.c $(XDIR)
! 	$(CC) $(CFLAGS) -o timing_slave $(SDIR)/timing_slave.c $(LFLAGS) $(LIBS)
  	mv timing_slave $(XDIR)
  
! timing: $(SDIR)/timing.c $(XDIR)
! 	$(CC) $(CFLAGS) -o timing $(SDIR)/timing.c $(LFLAGS) $(LIBS)
  	mv timing $(XDIR)
  
! spmd: $(SDIR)/spmd.c $(XDIR)
! 	$(CC) $(CFLAGS) -o spmd $(SDIR)/spmd.c $(LFLAGS) $(GLIBS) $(LIBS)
  	mv spmd $(XDIR)
  
! fspmd: $(SDIR)/spmd.f $(XDIR)
! 	$(F77) $(FFLAGS) -o spmd $(SDIR)/spmd.f $(LFLAGS) $(FLIBS) $(GLIBS) $(LIBS)
  	mv spmd $(XDIR)
  
! master: $(SDIR)/master1.c $(XDIR)
! 	$(CC) $(CFLAGS) -o master1 $(SDIR)/master1.c $(LFLAGS) $(LIBS)
  	mv master1 $(XDIR)
  
! slave: $(SDIR)/slave1.c $(XDIR)
! 	$(CC) $(CFLAGS) -o slave1 $(SDIR)/slave1.c $(LFLAGS) $(LIBS)
  	mv slave1 $(XDIR)
  
! fmaster: $(SDIR)/master1.f $(XDIR)
! 	$(F77) $(FFLAGS) -o master1 $(SDIR)/master1.f $(LFLAGS) $(FLIBS) $(LIBS)
  	mv master1 $(XDIR)
  
! fslave: $(SDIR)/slave1.f $(XDIR)
! 	$(F77) $(FFLAGS) -o slave1 $(SDIR)/slave1.f $(LFLAGS) $(FLIBS) $(LIBS)
  	mv slave1 $(XDIR)
  
! testall: $(SDIR)/testall.f $(XDIR)
! 	$(F77) $(FFLAGS) -o testall $(SDIR)/testall.f $(LFLAGS) $(FLIBS) $(LIBS)
  	mv testall $(XDIR)
  
! hitc: $(SDIR)/hitc.f $(XDIR)
! 	$(F77) $(FFLAGS) -o hitc $(SDIR)/hitc.f $(LFLAGS) $(FLIBS) $(LIBS)
! 	mv hitc $(XDIR)
! 
! hitc_slave: $(SDIR)/hitc_slave.f $(XDIR)
! 	$(F77) $(FFLAGS) -o hitc_slave $(SDIR)/hitc_slave.f $(LFLAGS) $(FLIBS) $(LIBS)
! 	mv hitc_slave $(XDIR)
! 
! gexample: $(SDIR)/gexample.c $(XDIR)
! 	$(CC) $(CFLAGS) -o gexample $(SDIR)/gexample.c $(LFLAGS) $(GLIBS) $(LIBS)
! 	mv gexample $(XDIR)
! 
! fgexample: $(SDIR)/gexample.f $(XDIR)
! 	$(F77) $(FFLAGS) -o gexample $(SDIR)/gexample.f $(LFLAGS) $(FLIBS) $(GLIBS) $(LIBS)
! 	mv gexample $(XDIR)
! 
! nntime:	$(SDIR)/nntime.c $(XDIR)
! 	$(CC) $(CFLAGS) -D$(PVM_ARCH) -DPVM -o nntime $(SDIR)/nntime.c $(LFLAGS) $(LIBS)
  	mv nntime $(XDIR)
+ 
*** /dev/null	Wed Nov  9 10:53:28 1994
--- examples/SGIMP64/Makefile	Mon Oct 24 10:42:48 1994
***************
*** 0 ****
--- 1,108 ----
+ ARCHCFLAGS	=	-DSYSVSIGNAL -DRSHCOMMAND=\"/usr/bsd/rsh\" -DNOUNIXDOM -64 -TENV:large_GOT=ON -woff 1174 -DHASSTDLIB
+ #ARCHLIB	=	-lsun -lmutex
+ PVM_ARCH	=	SGIMP64
+ #
+ # Custom makefile for PVM example programs.
+ #
+ # Set PVM_ROOT to the path where PVM includes and libraries are installed.
+ # Set PVM_ARCH to your architecture type (SUN4, HP9K, RS6K, SGI, etc.)
+ # Set ARCHLIB to any special libs needed on PVM_ARCH (-lrpc, -lsocket, etc.)
+ # otherwise leave ARCHLIB blank
+ #
+ SDIR	=	..
+ #BDIR	=	$(HOME)/pvm3/bin
+ BDIR	=	$(SDIR)/../bin
+ XDIR	=	$(BDIR)/$(PVM_ARCH)
+ 
+ CC	=	cc
+ OPTIONS	=	-O
+ CFLAGS	=	$(OPTIONS) -I$(PVM_ROOT)/include $(ARCHCFLAGS)
+ LIBS	=	-lpvm3 $(ARCHLIB)
+ GLIBS	=	-lgpvm3
+ 
+ F77	=	f77
+ FFLAGS	=	-g
+ FLIBS	=	-lfpvm3
+ 
+ LFLAGS	=	-L$(PVM_ROOT)/lib/$(PVM_ARCH)
+ 
+ default:	hello hello_other
+ 
+ all: c-all f-all
+ 
+ c-all:	gexample hello hello_other master slave spmd timing timing_slave
+ 
+ f-all:	fgexample fmaster fslave fspmd hitc hitc_slave testall
+ 
+ clean:
+ 	rm -f *.o gexample hello hello_other hitc hitc_slave master1 slave1 \
+ 		spmd testall timing timing_slave
+ 
+ $(XDIR):
+ 	- mkdir $(BDIR)
+ 	- mkdir $(XDIR)
+ 
+ hello: $(SDIR)/hello.c $(XDIR)
+ 	$(CC) $(CFLAGS) -o hello $(SDIR)/hello.c $(LFLAGS) $(LIBS)
+ 	mv hello $(XDIR)
+ 
+ hello_other: $(SDIR)/hello_other.c $(XDIR)
+ 	$(CC) $(CFLAGS) -o hello_other $(SDIR)/hello_other.c $(LFLAGS) $(LIBS)
+ 	mv hello_other $(XDIR)
+ 
+ timing_slave: $(SDIR)/timing_slave.c $(XDIR)
+ 	$(CC) $(CFLAGS) -o timing_slave $(SDIR)/timing_slave.c $(LFLAGS) $(LIBS)
+ 	mv timing_slave $(XDIR)
+ 
+ timing: $(SDIR)/timing.c $(XDIR)
+ 	$(CC) $(CFLAGS) -o timing $(SDIR)/timing.c $(LFLAGS) $(LIBS)
+ 	mv timing $(XDIR)
+ 
+ spmd: $(SDIR)/spmd.c $(XDIR)
+ 	$(CC) $(CFLAGS) -o spmd $(SDIR)/spmd.c $(LFLAGS) $(GLIBS) $(LIBS)
+ 	mv spmd $(XDIR)
+ 
+ fspmd: $(SDIR)/spmd.f $(XDIR)
+ 	$(F77) $(FFLAGS) -o spmd $(SDIR)/spmd.f $(LFLAGS) $(FLIBS) $(GLIBS) $(LIBS)
+ 	mv spmd $(XDIR)
+ 
+ master: $(SDIR)/master1.c $(XDIR)
+ 	$(CC) $(CFLAGS) -o master1 $(SDIR)/master1.c $(LFLAGS) $(LIBS)
+ 	mv master1 $(XDIR)
+ 
+ slave: $(SDIR)/slave1.c $(XDIR)
+ 	$(CC) $(CFLAGS) -o slave1 $(SDIR)/slave1.c $(LFLAGS) $(LIBS)
+ 	mv slave1 $(XDIR)
+ 
+ fmaster: $(SDIR)/master1.f $(XDIR)
+ 	$(F77) $(FFLAGS) -o master1 $(SDIR)/master1.f $(LFLAGS) $(FLIBS) $(LIBS)
+ 	mv master1 $(XDIR)
+ 
+ fslave: $(SDIR)/slave1.f $(XDIR)
+ 	$(F77) $(FFLAGS) -o slave1 $(SDIR)/slave1.f $(LFLAGS) $(FLIBS) $(LIBS)
+ 	mv slave1 $(XDIR)
+ 
+ testall: $(SDIR)/testall.f $(XDIR)
+ 	$(F77) $(FFLAGS) -o testall $(SDIR)/testall.f $(LFLAGS) $(FLIBS) $(LIBS)
+ 	mv testall $(XDIR)
+ 
+ hitc: $(SDIR)/hitc.f $(XDIR)
+ 	$(F77) $(FFLAGS) -o hitc $(SDIR)/hitc.f $(LFLAGS) $(FLIBS) $(LIBS)
+ 	mv hitc $(XDIR)
+ 
+ hitc_slave: $(SDIR)/hitc_slave.f $(XDIR)
+ 	$(F77) $(FFLAGS) -o hitc_slave $(SDIR)/hitc_slave.f $(LFLAGS) $(FLIBS) $(LIBS)
+ 	mv hitc_slave $(XDIR)
+ 
+ gexample: $(SDIR)/gexample.c $(XDIR)
+ 	$(CC) $(CFLAGS) -o gexample $(SDIR)/gexample.c $(LFLAGS) $(GLIBS) $(LIBS)
+ 	mv gexample $(XDIR)
+ 
+ fgexample: $(SDIR)/gexample.f $(XDIR)
+ 	$(F77) $(FFLAGS) -o gexample $(SDIR)/gexample.f $(LFLAGS) $(FLIBS) $(GLIBS) $(LIBS)
+ 	mv gexample $(XDIR)
+ 
+ nntime:	$(SDIR)/nntime.c $(XDIR)
+ 	$(CC) $(CFLAGS) -D$(PVM_ARCH) -DPVM -o nntime $(SDIR)/nntime.c $(LFLAGS) $(LIBS)
+ 	mv nntime $(XDIR)
+ 
*** ../netlib/pvm3.3.4/examples/SUNMP/Makefile	Mon May 16 23:04:22 1994
--- examples/SUNMP/Makefile	Mon Oct 24 10:42:52 1994
***************
*** 1,85 ****
  #
! # Custom section
! # Set PVM_ARCH to your architecture type (SUN4, HP9K, RS6K, SGI, etc)
! # if PVM_ARCH = BSD386 then set ARCHLIB = -lrpc
! # if PVM_ARCH = SGI    then set ARCHLIB = -lsun
! # if PVM_ARCH = I860   then set ARCHLIB = -lrpc -lsocket
! # if PVM_ARCH = IPSC2  then set ARCHLIB = -lrpc -lsocket
  # otherwise leave ARCHLIB blank
  #
- # PVM_ARCH and ARCHLIB are set for you if you use 'aimk'.
- #
- PVM_ARCH	=	SGIMP
- ARCHLIB		=	-lnsl -lsocket -lthread
- # END of custom section - leave this line here
- #
- PVMDIR	=	../..
- PVMLIB	=	$(PVMDIR)/lib/$(PVM_ARCH)/libpvm3.a
  SDIR	=	..
! BDIR	=	$(PVMDIR)/bin
  XDIR	=	$(BDIR)/$(PVM_ARCH)
  
! CC	=	gcc
! CFLAGS	=	-O -I../../include
! LIBS	=	$(PVMLIB) $(ARCHLIB)
  
! F77     =	f77
  FFLAGS	=	-g
! FLIBS	=	$(PVMDIR)/lib/$(PVM_ARCH)/libfpvm3.a $(LIBS)
  
  default:	hello hello_other
  
  $(XDIR):
  	- mkdir $(BDIR)
  	- mkdir $(XDIR)
  
! clean:
! 	rm -f *.o timing_slave timing spmd fspmd master slave fmaster fslave testall
! 
! hello: $(SDIR)/hello.c  $(XDIR)
! 	$(CC) $(CFLAGS) -o hello $(SDIR)/hello.c $(LIBS)
  	mv hello $(XDIR)
  
! hello_other: $(SDIR)/hello_other.c  $(XDIR)
! 	$(CC) $(CFLAGS) -o hello_other $(SDIR)/hello_other.c $(LIBS)
  	mv hello_other $(XDIR)
  
! timing_slave: $(SDIR)/timing_slave.c  $(XDIR)
! 	$(CC) $(CFLAGS) -o timing_slave $(SDIR)/timing_slave.c  $(LIBS)
  	mv timing_slave $(XDIR)
  
! timing: $(SDIR)/timing.c  $(XDIR)
! 	$(CC) $(CFLAGS) -o timing $(SDIR)/timing.c $(LIBS)
  	mv timing $(XDIR)
  
! spmd: $(SDIR)/spmd.c  $(XDIR)
! 	$(CC) $(CFLAGS) -o spmd $(SDIR)/spmd.c $(LIBS)
  	mv spmd $(XDIR)
  
! fspmd: $(SDIR)/spmd.f  $(XDIR)
! 	$(F77) $(FFLAGS) -o spmd $(SDIR)/spmd.f $(FLIBS)
  	mv spmd $(XDIR)
  
! master: $(SDIR)/master1.c  $(XDIR)
! 	$(CC) $(CFLAGS) -o master1 $(SDIR)/master1.c  $(LIBS)
  	mv master1 $(XDIR)
  
! slave: $(SDIR)/slave1.c  $(XDIR)
! 	$(CC) $(CFLAGS) -o slave1 $(SDIR)/slave1.c  $(LIBS)
  	mv slave1 $(XDIR)
  
! fmaster: $(SDIR)/master1.f  $(XDIR)
! 	$(F77) $(FFLAGS) -o master1 $(SDIR)/master1.f $(FLIBS)
  	mv master1 $(XDIR)
  
! fslave: $(SDIR)/slave1.f  $(XDIR)
! 	$(F77) $(FFLAGS) -o slave1 $(SDIR)/slave1.f $(FLIBS)
  	mv slave1 $(XDIR)
  
! testall: $(SDIR)/testall.f  $(XDIR)
! 	$(F77) $(FFLAGS) -o testall $(SDIR)/testall.f $(FLIBS)
  	mv testall $(XDIR)
  
! nntime:	$(SDIR)/nntime.c  $(XDIR)
! 	$(CC) $(CFLAGS) -D$(PVM_ARCH) -DPVM -o nntime $(SDIR)/nntime.c $(LIBS)
  	mv nntime $(XDIR)
--- 1,108 ----
+ ARCHCFLAGS	=	-DSYSVBFUNC -DSYSVSTR -DNOGETDTBLSIZ -DSYSVSIGNAL -DNOWAIT3 -DNOUNIXDOM
+ ARCHLIB	=	-lnsl -lsocket -lthread
+ PVM_ARCH	=	SUNMP
  #
! # Custom makefile for PVM example programs.
! #
! # Set PVM_ROOT to the path where PVM includes and libraries are installed.
! # Set PVM_ARCH to your architecture type (SUN4, HP9K, RS6K, SGI, etc.)
! # Set ARCHLIB to any special libs needed on PVM_ARCH (-lrpc, -lsocket, etc.)
  # otherwise leave ARCHLIB blank
  #
  SDIR	=	..
! #BDIR	=	$(HOME)/pvm3/bin
! BDIR	=	$(SDIR)/../bin
  XDIR	=	$(BDIR)/$(PVM_ARCH)
  
! CC	=	cc
! OPTIONS	=	-O
! CFLAGS	=	$(OPTIONS) -I$(PVM_ROOT)/include $(ARCHCFLAGS)
! LIBS	=	-lpvm3 $(ARCHLIB)
! GLIBS	=	-lgpvm3
  
! F77	=	f77
  FFLAGS	=	-g
! FLIBS	=	-lfpvm3
  
+ LFLAGS	=	-L$(PVM_ROOT)/lib/$(PVM_ARCH)
+ 
  default:	hello hello_other
  
+ all: c-all f-all
+ 
+ c-all:	gexample hello hello_other master slave spmd timing timing_slave
+ 
+ f-all:	fgexample fmaster fslave fspmd hitc hitc_slave testall
+ 
+ clean:
+ 	rm -f *.o gexample hello hello_other hitc hitc_slave master1 slave1 \
+ 		spmd testall timing timing_slave
+ 
  $(XDIR):
  	- mkdir $(BDIR)
  	- mkdir $(XDIR)
  
! hello: $(SDIR)/hello.c $(XDIR)
! 	$(CC) $(CFLAGS) -o hello $(SDIR)/hello.c $(LFLAGS) $(LIBS)
  	mv hello $(XDIR)
  
! hello_other: $(SDIR)/hello_other.c $(XDIR)
! 	$(CC) $(CFLAGS) -o hello_other $(SDIR)/hello_other.c $(LFLAGS) $(LIBS)
  	mv hello_other $(XDIR)
  
! timing_slave: $(SDIR)/timing_slave.c $(XDIR)
! 	$(CC) $(CFLAGS) -o timing_slave $(SDIR)/timing_slave.c $(LFLAGS) $(LIBS)
  	mv timing_slave $(XDIR)
  
! timing: $(SDIR)/timing.c $(XDIR)
! 	$(CC) $(CFLAGS) -o timing $(SDIR)/timing.c $(LFLAGS) $(LIBS)
  	mv timing $(XDIR)
  
! spmd: $(SDIR)/spmd.c $(XDIR)
! 	$(CC) $(CFLAGS) -o spmd $(SDIR)/spmd.c $(LFLAGS) $(GLIBS) $(LIBS)
  	mv spmd $(XDIR)
  
! fspmd: $(SDIR)/spmd.f $(XDIR)
! 	$(F77) $(FFLAGS) -o spmd $(SDIR)/spmd.f $(LFLAGS) $(FLIBS) $(GLIBS) $(LIBS)
  	mv spmd $(XDIR)
  
! master: $(SDIR)/master1.c $(XDIR)
! 	$(CC) $(CFLAGS) -o master1 $(SDIR)/master1.c $(LFLAGS) $(LIBS)
  	mv master1 $(XDIR)
  
! slave: $(SDIR)/slave1.c $(XDIR)
! 	$(CC) $(CFLAGS) -o slave1 $(SDIR)/slave1.c $(LFLAGS) $(LIBS)
  	mv slave1 $(XDIR)
  
! fmaster: $(SDIR)/master1.f $(XDIR)
! 	$(F77) $(FFLAGS) -o master1 $(SDIR)/master1.f $(LFLAGS) $(FLIBS) $(LIBS)
  	mv master1 $(XDIR)
  
! fslave: $(SDIR)/slave1.f $(XDIR)
! 	$(F77) $(FFLAGS) -o slave1 $(SDIR)/slave1.f $(LFLAGS) $(FLIBS) $(LIBS)
  	mv slave1 $(XDIR)
  
! testall: $(SDIR)/testall.f $(XDIR)
! 	$(F77) $(FFLAGS) -o testall $(SDIR)/testall.f $(LFLAGS) $(FLIBS) $(LIBS)
  	mv testall $(XDIR)
  
! hitc: $(SDIR)/hitc.f $(XDIR)
! 	$(F77) $(FFLAGS) -o hitc $(SDIR)/hitc.f $(LFLAGS) $(FLIBS) $(LIBS)
! 	mv hitc $(XDIR)
! 
! hitc_slave: $(SDIR)/hitc_slave.f $(XDIR)
! 	$(F77) $(FFLAGS) -o hitc_slave $(SDIR)/hitc_slave.f $(LFLAGS) $(FLIBS) $(LIBS)
! 	mv hitc_slave $(XDIR)
! 
! gexample: $(SDIR)/gexample.c $(XDIR)
! 	$(CC) $(CFLAGS) -o gexample $(SDIR)/gexample.c $(LFLAGS) $(GLIBS) $(LIBS)
! 	mv gexample $(XDIR)
! 
! fgexample: $(SDIR)/gexample.f $(XDIR)
! 	$(F77) $(FFLAGS) -o gexample $(SDIR)/gexample.f $(LFLAGS) $(FLIBS) $(GLIBS) $(LIBS)
! 	mv gexample $(XDIR)
! 
! nntime:	$(SDIR)/nntime.c $(XDIR)
! 	$(CC) $(CFLAGS) -D$(PVM_ARCH) -DPVM -o nntime $(SDIR)/nntime.c $(LFLAGS) $(LIBS)
  	mv nntime $(XDIR)
+ 
*** ../netlib/pvm3.3.4/examples/gexample.c	Fri Mar 18 12:35:11 1994
--- examples/gexample.c	Mon Oct 24 12:09:39 1994
***************
*** 5,11 ****
   *
  */
  #include <stdio.h>
! #include <malloc.h>
  #include "pvm3.h"
  #define min(u,v) ( (u) < (v) ? (u) : (v) )
  #define max(u,v) ( (u) > (v) ? (u) : (v) )
--- 5,13 ----
   *
  */
  #include <stdio.h>
! #ifdef HASSTDLIB
! #include <stdlib.h>
! #endif
  #include "pvm3.h"
  #define min(u,v) ( (u) < (v) ? (u) : (v) )
  #define max(u,v) ( (u) > (v) ? (u) : (v) )
***************
*** 18,25 ****
  extern void calcprod();
  main()
  {
! int mytid, myinst, gsize, nproc,maxmax;
! int dimension, ninst, error;
  int tids[32]; int *subblock, *colsum;
  double *colprod;
  int blksize,nextra,mysrow,i,j,sumsqr,itemp;
--- 20,29 ----
  extern void calcprod();
  main()
  {
! int mytid, myinst, gsize, nproc = 0;
! int maxmax;
! int dimension = 0;
! int ninst, error;
  int tids[32]; int *subblock, *colsum;
  double *colprod;
  int blksize,nextra,mysrow,i,j,sumsqr,itemp;
*** ../netlib/pvm3.3.4/examples/hello.c	Sun Sep  4 16:25:26 1994
--- examples/hello.c	Sat Oct 15 14:41:42 1994
***************
*** 21,26 ****
--- 21,27 ----
  		printf("can't start hello_other\n");
  
  	pvm_exit();
+ 	exit(0);
  }
  
  
*** ../netlib/pvm3.3.4/examples/hello_other.c	Thu Aug  5 12:54:38 1993
--- examples/hello_other.c	Sat Oct 15 14:42:03 1994
***************
*** 15,19 ****
--- 15,20 ----
  	pvm_send(ptid, 1);
  
  	pvm_exit();
+ 	exit(0);
  }
  
*** ../netlib/pvm3.3.4/examples/hitc_slave.f	Thu Mar 10 10:24:03 1994
--- examples/hitc_slave.f	Sat Oct 15 14:42:17 1994
***************
*** 30,35 ****
--- 30,36 ----
        do 20 i=1,n
          do 10 j=1,n
            amt(i,j) = random()
+           bmt(i,j) = cmplx(0.d0,0.d0)
    10    continue
    20  continue
  
***************
*** 88,95 ****
  c
  c  level 2  blas
  c
!         call zgeru(nrmatr,i,m1,td,1,bd,1,bmt,nrmatr)
!         call zgeru(nrmatr,nrmatr-i+1,m1,td,1,ad(i),1,amt(1,i),nrmatr)
  c
   16      continue
  c
--- 89,96 ----
  c
  c  level 2  blas
  c
!         call zgeru(nrmatr,i,m1,td,1,bd,1,bmt,iprmtr)
!         call zgeru(nrmatr,nrmatr-i+1,m1,td,1,ad(i),1,amt(1,i),iprmtr)
  c
   16      continue
  c
***************
*** 318,320 ****
--- 319,322 ----
        random = seed/fmd
        return
        end
+ 
*** ../netlib/pvm3.3.4/examples/nntime.c	Tue May 17 00:48:44 1994
--- examples/nntime.c	Mon Nov  7 12:02:39 1994
***************
*** 152,158 ****
  		}
  
  	if (i == size)
! 		printf("%d doubles received correctly\n\n\n", i);
  }
  
  #endif
--- 152,158 ----
  		}
  
  	if (i == size)
! 		printf("t%x: %d doubles received correctly\n\n\n", mytid, i);
  }
  
  #endif
***************
*** 173,181 ****
  		for (n = 0; n < MAXSIZE; n++)
  			data[n] = n*n;
  #ifdef PVM
  		pvm_recv(-1, 0);
  		pvm_upkstr(str);
! 		printf("%s\n", str);
  		pvm_upkdouble(data, MAXSIZE, 1);
  		validate(data, MAXSIZE);
  		pvm_initsend(ENCODE);
--- 173,182 ----
  		for (n = 0; n < MAXSIZE; n++)
  			data[n] = n*n;
  #ifdef PVM
+ #ifdef PACK
  		pvm_recv(-1, 0);
  		pvm_upkstr(str);
! 		printf("t%x: %s\n", mytid, str);
  		pvm_upkdouble(data, MAXSIZE, 1);
  		validate(data, MAXSIZE);
  		pvm_initsend(ENCODE);
***************
*** 183,191 ****
  		pvm_pkstr(str);
  		pvm_pkdouble(data, MAXSIZE, 1);
  		pvm_send(hertid, 0);
  		pvm_freebuf(pvm_setsbuf(0));
  		pvm_freebuf(pvm_setrbuf(0));
! #endif
  	
  /*
  #ifdef SUNMP
--- 184,200 ----
  		pvm_pkstr(str);
  		pvm_pkdouble(data, MAXSIZE, 1);
  		pvm_send(hertid, 0);
+ #else
+ 		pvm_precv(-1, 0, data, MAXSIZE, PVM_DOUBLE, (int*)0, (int*)0, (int*)0);
+ 		validate(data, MAXSIZE);
+ 		pvm_psend(hertid, 0, data, MAXSIZE, PVM_DOUBLE);
+ #endif /*PACK*/
+ 		
+ /*
  		pvm_freebuf(pvm_setsbuf(0));
  		pvm_freebuf(pvm_setrbuf(0));
! */
! #endif /*PVM*/
  	
  /*
  #ifdef SUNMP
***************
*** 196,210 ****
  		for (size = 1; size <= MAXSIZE; size *= 10) 
  			for (n = 0; n < SAMPLE; n++) {
  #ifdef PVM
  				pvm_recv(-1, 0);
  				pvm_initsend(ENCODE);
  				pvm_pkdouble(data, size, 1);
  				pvm_send(hertid, 0);
! /*
  				pvm_precv(-1, -1, data, MAXSIZE, PVM_DOUBLE, (int*)0, 
  					(int*)0, (int*)0);
  				pvm_psend(hertid, size, data, size, PVM_DOUBLE);
! */
  #else /*PVM*/
  #if defined(PGON_NODE) || defined(I860_NODE)
  				crecv(-1, (char *)data, MAXSIZE*sizeof(double));
--- 205,220 ----
  		for (size = 1; size <= MAXSIZE; size *= 10) 
  			for (n = 0; n < SAMPLE; n++) {
  #ifdef PVM
+ #ifdef PACK
  				pvm_recv(-1, 0);
  				pvm_initsend(ENCODE);
  				pvm_pkdouble(data, size, 1);
  				pvm_send(hertid, 0);
! #else
  				pvm_precv(-1, -1, data, MAXSIZE, PVM_DOUBLE, (int*)0, 
  					(int*)0, (int*)0);
  				pvm_psend(hertid, size, data, size, PVM_DOUBLE);
! #endif /*PACK*/
  #else /*PVM*/
  #if defined(PGON_NODE) || defined(I860_NODE)
  				crecv(-1, (char *)data, MAXSIZE*sizeof(double));
***************
*** 223,228 ****
--- 233,239 ----
  		for (n = 0; n < MAXSIZE; n++)
  			data[n] = n*n;
  #ifdef PVM
+ #ifdef PACK
  		pvm_initsend(ENCODE);
  		sprintf(str, "%d doubles from t%x", MAXSIZE, mytid);
  		pvm_pkstr(str);
***************
*** 230,240 ****
  		pvm_send(hertid, 0);
  		pvm_recv(-1, 0);
  		pvm_upkstr(str);
! 		printf("%s\n", str);
  		pvm_upkdouble(data, MAXSIZE, 1);
  		validate(data, MAXSIZE);
  		pvm_freebuf(pvm_setsbuf(0));
  		pvm_freebuf(pvm_setrbuf(0));
  #endif
  
  		/* do timing measurements */
--- 241,257 ----
  		pvm_send(hertid, 0);
  		pvm_recv(-1, 0);
  		pvm_upkstr(str);
! 		printf("t%x: %s\n", mytid, str);
  		pvm_upkdouble(data, MAXSIZE, 1);
+ #else
+ 		pvm_psend(hertid, 0, data, MAXSIZE, PVM_DOUBLE);
+ 		pvm_precv(-1, 0, data, MAXSIZE, PVM_DOUBLE, (int*)0, (int*)0, (int*)0);
+ #endif /*PACK*/
  		validate(data, MAXSIZE);
+ /*
  		pvm_freebuf(pvm_setsbuf(0));
  		pvm_freebuf(pvm_setrbuf(0));
+ */
  #endif
  
  		/* do timing measurements */
***************
*** 253,267 ****
  			TIMER_START;
  			for (n = 0; n < SAMPLE; n++) {
  #ifdef PVM
  				pvm_initsend(ENCODE);
  				pvm_pkdouble(data, size, 1);
  				pvm_send(hertid, 0);
  				pvm_recv(-1, 0);
! /*
  				pvm_psend(hertid, size, data, size, PVM_DOUBLE);
  				pvm_precv(-1, -1, data, MAXSIZE, PVM_DOUBLE, (int*)0, 
  					(int*)0, (int*)0);
! */
  #else /*PVM*/
  #if defined(PGON_NODE) || defined(I860_NODE)
  				csend(size, (char *)data, size*sizeof(double), hertid, 0);
--- 270,285 ----
  			TIMER_START;
  			for (n = 0; n < SAMPLE; n++) {
  #ifdef PVM
+ #ifdef PACK
  				pvm_initsend(ENCODE);
  				pvm_pkdouble(data, size, 1);
  				pvm_send(hertid, 0);
  				pvm_recv(-1, 0);
! #else
  				pvm_psend(hertid, size, data, size, PVM_DOUBLE);
  				pvm_precv(-1, -1, data, MAXSIZE, PVM_DOUBLE, (int*)0, 
  					(int*)0, (int*)0);
! #endif /*PACK*/
  #else /*PVM*/
  #if defined(PGON_NODE) || defined(I860_NODE)
  				csend(size, (char *)data, size*sizeof(double), hertid, 0);
***************
*** 277,283 ****
  			TIMER_STOP;
  			t = 1000000*TIMER_ELAPSED/SAMPLE;
  			printf("Roundtrip T = %d (us)  (%.4f MB/s)      Data size: %d\n",
! 				t, 8.0*(float)size/(float)t, sizeof(double)*size);
  		}
  
  #endif /*TIMER_CLEAR*/
--- 295,301 ----
  			TIMER_STOP;
  			t = 1000000*TIMER_ELAPSED/SAMPLE;
  			printf("Roundtrip T = %d (us)  (%.4f MB/s)      Data size: %d\n",
! 				t, 2.0*8.0*(float)size/(float)t, sizeof(double)*size);
  		}
  
  #endif /*TIMER_CLEAR*/
*** ../netlib/pvm3.3.4/examples/testall.f	Thu Mar 10 10:24:04 1994
--- examples/testall.f	Mon Oct 24 10:50:53 1994
***************
*** 25,30 ****
--- 25,31 ----
        character*16  hosts(10)
        character*16  aout(10)
        character*8   archs(10)
+       character   buffer*20
  
        print *,'Testing PVM 3 Fortran Routines'
        print *,' '
***************
*** 325,331 ****
        CALL PVMFSEND( tids(2), 44, info )
        CALL PVMFRECV( tids(2), 44, info )
  
!       CALL PVMFUNPACK( STRING,  'Pack Test',  9, 1, info )
        if( info .lt. 0 ) print *,'Error in pvmfunpack (STRING)'
        CALL PVMFUNPACK( BYTE1,     i4data,    64, 1, info )
        if( info .lt. 0 ) print *,'Error in pvmfunpack (BYTE1)'
--- 326,332 ----
        CALL PVMFSEND( tids(2), 44, info )
        CALL PVMFRECV( tids(2), 44, info )
  
!       CALL PVMFUNPACK( STRING,    buffer,     9, 1, info )
        if( info .lt. 0 ) print *,'Error in pvmfunpack (STRING)'
        CALL PVMFUNPACK( BYTE1,     i4data,    64, 1, info )
        if( info .lt. 0 ) print *,'Error in pvmfunpack (BYTE1)'
***************
*** 412,418 ****
           CALL PVMFSEND( parentid, 65, info )
        else if( msgtag .eq. 44 ) then
           nitem = 100
!          CALL PVMFUNPACK( STRING,  'Pack Test',  9, 1, info )
           CALL PVMFUNPACK( BYTE1,     i4data,    64, 1, info )
           CALL PVMFUNPACK( INTEGER2,  i2data, nitem, 1, info )
           CALL PVMFUNPACK( INTEGER4,  i4data, nitem, 1, info )
--- 413,419 ----
           CALL PVMFSEND( parentid, 65, info )
        else if( msgtag .eq. 44 ) then
           nitem = 100
!          CALL PVMFUNPACK( STRING,    buffer,     9, 1, info )
           CALL PVMFUNPACK( BYTE1,     i4data,    64, 1, info )
           CALL PVMFUNPACK( INTEGER2,  i2data, nitem, 1, info )
           CALL PVMFUNPACK( INTEGER4,  i4data, nitem, 1, info )
*** ../netlib/pvm3.3.4/examples/timing_slave.c	Thu Mar 10 10:24:04 1994
--- examples/timing_slave.c	Sat Oct 15 14:42:34 1994
***************
*** 41,46 ****
--- 41,47 ----
  	while (1) {
  		bufid = pvm_recv(-1, -1);
  		pvm_bufinfo(bufid, (int*)0, (int*)0, &dtid);
+ 		pvm_freebuf(pvm_getrbuf());  /* for shared memory refcount hang */
  		pvm_send(dtid, 2);
  /*
  		printf("echo %d\n", ++n);
*** ../netlib/pvm3.3.4/gexamples/Makefile	Fri Jul  1 11:27:16 1994
--- gexamples/Makefile	Mon Oct 24 17:06:52 1994
***************
*** 18,25 ****
  PVMLDIR	=	$(PVM_ROOT)/lib/$(PVM_ARCH)
  PVMLIB	=	-lgpvm3 -lpvm3
  CFLAGS	=	-g -I$(PVMIDIR) -L$(PVMLDIR) $(ARCHCFLAGS)
! BDIR	=	$(HOME)/pvm3/bin
  XDIR	=	$(BDIR)/$(PVM_ARCH)
  
  all: gexamp tst thb tnb ge tjl tjf gs
  
--- 18,29 ----
  PVMLDIR	=	$(PVM_ROOT)/lib/$(PVM_ARCH)
  PVMLIB	=	-lgpvm3 -lpvm3
  CFLAGS	=	-g -I$(PVMIDIR) -L$(PVMLDIR) $(ARCHCFLAGS)
! #BDIR	=	$(HOME)/pvm3/bin
! BDIR	=	../bin
  XDIR	=	$(BDIR)/$(PVM_ARCH)
+ F77		=	f77
+ FFLAGS	=	-g
+ PVMFLIB	=	-lfpvm3 $(PVMLIB)
  
  all: gexamp tst thb tnb ge tjl tjf gs
  
***************
*** 58,63 ****
  	$(CC) $(CFLAGS) -o tjf tjf.o $(PVMLIB)
  	cp tjf $(XDIR)
  
  clean:
! 	rm -f *.o tst thb tnb tjl tjf ge gexamp gs joinleave
  
--- 62,75 ----
  	$(CC) $(CFLAGS) -o tjf tjf.o $(PVMLIB)
  	cp tjf $(XDIR)
  
+ trsg: trsg.o
+ 	$(CC) $(CFLAGS) -o trsg trsg.o $(PVMLIB)
+ 	cp trsg $(XDIR)
+ 
+ frsg: frsg.o
+ 	$(F77) $(FFLAGS) -o frsg frsg.o $(PVMFLIB)
+ 	cp frsg $(XDIR)
+ 
  clean:
! 	rm -f *.o tst thb tnb tjl tjf ge gexamp gs joinleave trsg frsg
  
*** /dev/null	Wed Nov  9 10:53:31 1994
--- gexamples/Makefile.aimk	Wed Nov  9 10:18:16 1994
***************
*** 0 ****
--- 1,76 ----
+ #
+ # Makefile for PVM group library example programs.
+ #
+ # Set PVM_ROOT to the path where PVM includes and libraries are installed.
+ # Set PVM_ARCH to your architecture type (SUN4, HP9K, RS6K, SGI, etc.)
+ # Set ARCHLIB to any special libs needed on PVM_ARCH (-lrpc, -lsocket, etc.)
+ # otherwise leave ARCHLIB blank
+ #
+ # PVM_ARCH and ARCHLIB are set for you if you use "$PVM_ROOT/lib/aimk"
+ # instead of "make".
+ #
+ 
+ #PVM_ROOT	=
+ #PVM_ARCH	=
+ #ARCHCFLAGS	=
+ 
+ PVMIDIR	=	$(PVM_ROOT)/include
+ PVMLDIR	=	$(PVM_ROOT)/lib/$(PVM_ARCH)
+ PVMLIB	=	-lgpvm3 -lpvm3 $(ARCHLIB)
+ CFLAGS	=	-g -I$(PVMIDIR) -L$(PVMLDIR) $(ARCHCFLAGS)
+ SDIR	=	..
+ #BDIR	=	$(HOME)/pvm3/bin
+ BDIR	=	../../bin
+ XDIR	=	$(BDIR)/$(PVM_ARCH)
+ F77		=	f77
+ FFLAGS	=	-g
+ PVMFLIB	=	-lfpvm3 $(PVMLIB)
+ 
+ all: gexamp tst thb tnb ge tjl tjf gs
+ 
+ joinleave: $(SDIR)/joinleave.c
+ 	$(CC) $(CFLAGS) -o joinleave $(SDIR)/joinleave.c $(PVMLIB)
+ 
+ tst: $(SDIR)/tst.c
+ 	$(CC) $(CFLAGS) -o tst $(SDIR)/tst.c $(PVMLIB)
+ 	cp tst $(XDIR)
+ 
+ gs: $(SDIR)/gs.c
+ 	$(CC) $(CFLAGS) -o gs $(SDIR)/gs.c $(PVMLIB)
+ 	cp gs $(XDIR)
+ 
+ ge: $(SDIR)/ge.c
+ 	$(CC) $(CFLAGS) -o ge $(SDIR)/ge.c $(PVMLIB)
+ 	cp ge $(XDIR)
+ 
+ gexamp: $(SDIR)/gexamp.c
+ 	$(CC) $(CFLAGS) -o gexamp $(SDIR)/gexamp.c $(PVMLIB)
+ 	cp gexamp $(XDIR)
+ 
+ thb: $(SDIR)/thb.c
+ 	$(CC) $(CFLAGS) -o thb $(SDIR)/thb.c $(PVMLIB)
+ 	cp thb $(XDIR)
+ 
+ tnb: $(SDIR)/tnb.c
+ 	$(CC) $(CFLAGS) -o tnb $(SDIR)/tnb.c $(PVMLIB)
+ 	cp tnb $(XDIR)
+ 
+ tjl: $(SDIR)/tjl.c
+ 	$(CC) $(CFLAGS) -o tjl $(SDIR)/tjl.c $(PVMLIB)
+ 	cp tjl $(XDIR)
+ 
+ tjf: $(SDIR)/tjf.c
+ 	$(CC) $(CFLAGS) -o tjf $(SDIR)/tjf.c $(PVMLIB)
+ 	cp tjf $(XDIR)
+ 
+ trsg: $(SDIR)/trsg.c
+ 	$(CC) $(CFLAGS) -o trsg $(SDIR)/trsg.c $(PVMLIB)
+ 	cp trsg $(XDIR)
+ 
+ frsg: $(SDIR)/frsg.c
+ 	$(F77) $(FFLAGS) -o frsg $(SDIR)/frsg.c $(PVMFLIB)
+ 	cp frsg $(XDIR)
+ 
+ clean:
+ 	rm -f *.o tst thb tnb tjl tjf ge gexamp gs joinleave trsg frsg
+ 
*** /dev/null	Wed Nov  9 10:53:31 1994
--- gexamples/frsg.f	Sat Oct 15 15:54:34 1994
***************
*** 0 ****
--- 1,219 ----
+ c*----------------------------------------------------------------------
+ c* Example of group Reduce, Scatter, and Gather functions - J.M. Donato
+ c* 
+ c* This example calculates the sum of squares of the first N integers
+ c* in three different ways where 
+ c*
+ c*   N = (number of processors)*(number of elements per row)
+ c*
+ c* Note:  This is obviously not an efficient way to compute the 
+ c*        sum of squares, but it is a cutesy example and test case.
+ c*----------------------------------------------------------------------
+ 
+       program main
+ 
+       implicit none
+       include '../include/fpvm3.h'
+ 
+       external PvmMin
+       external PvmMax
+       external PvmSum
+       external PvmProduct
+       external MaxWithLoc
+ 
+       integer MAXNDATA, MAXNPROCS
+       character*10 GROUP, TASK_NAME
+       parameter (MAXNDATA = 20, MAXNPROCS = 16, 
+      &           GROUP = 'grp_frsg', TASK_NAME = 'frsg')
+ 
+       integer myginst, i, j, gsize, count, nprocs, msgtag, datatype,
+      &  buffer, info, info_product, info_user,
+      &  tids(MAXNPROCS), myrow(MAXNDATA), matrix(MAXNDATA*MAXNPROCS),
+      &  midpoint, bigN, Sum1, Sum2, SumSquares, rootginst,
+      &  PSum, PartSums(MAXNPROCS), dupls(MAXNDATA)
+ 
+       double precision values(2)
+ 
+       data Sum1/0/, Sum2/0/
+ 
+ c*  join the group 
+       call PvmfJoinGroup(GROUP, myginst)       
+ 
+ c* I am the first group member, get input, start up copies of myself 
+       if ( myginst.eq.0 ) then 
+ 
+         call PvmfMyTid(tids(1))
+ 
+         print *, '\ *** Example: PVM Reduce, Scatter, and Gather *** ',
+      &           '\ Number of processors to use (1-', MAXNPROCS,')? : '
+         read *, nprocs
+         if (nprocs.gt.MAXNPROCS) nprocs = MAXNPROCS
+         print *, ' Number of elements per row to use (1-', 
+      &             MAXNDATA, ')? : '
+         read *, count
+         if (count.gt.MAXNDATA) count = MAXNDATA
+         print *, ' INPUT values: nprocs = ', nprocs, ', count = ', count
+ 
+         if ( nprocs.gt.1 ) then 
+           call PvmfSpawn(TASK_NAME, PvmDefault, '*', 
+      &                   nprocs-1, tids(2), info)
+ 
+ c*  wait until they have all started, then send input values 
+           call PvmfGsize(GROUP, gsize)
+ 9000      continue
+           if ( gsize.lt.nprocs) then
+             call sleep(1) 
+             call PvmfGsize(GROUP, gsize)
+             go to 9000
+           end if
+ 
+           call PvmfInitsend(PvmDataDefault, buffer)
+           call PvmfPack(INTEGER4, nprocs, 1, 1, info)
+           call PvmfPack(INTEGER4, count,  1, 1, info)
+           msgtag = 17
+           call PvmfBcast(GROUP, msgtag, info)
+         end if
+ 
+       else
+ c*  receive the input values if child node
+         msgtag = 17
+         call PvmfRecv(-1, msgtag, info)
+         call PvmfUnpack(INTEGER4, nprocs, 1, 1, info)
+         call PvmfUnpack(INTEGER4, count,  1, 1, info)
+       end if
+   
+ c*  determine the group root 
+       rootginst = 0
+ 
+ c*  init the matrix values on the root processor 
+       if ( myginst.eq.rootginst ) then
+         do j=1, nprocs
+           do i=1, count
+             matrix((j-1)*count + i) = (j-1)*count + i
+           end do
+         end do
+       end if
+ 
+ c*  scatter rows of matrix to each processor 
+       msgtag = 19
+       call PvmfScatter(myrow, matrix, count, INTEGER4, msgtag, 
+      &                 GROUP, rootginst, info)
+ 
+ c*  this should end up squaring each value on each processor 
+       do i=1, count
+         dupls(i) = myginst*count + i 
+       end do
+       datatype = INTEGER4
+       call PvmProduct(datatype, myrow, dupls, count, info_product)
+       if ((myginst.eq.rootginst).and.(info_product.lt.0))
+      &    print *, ' ERROR: ', info_product, ' on PvmProduct call '
+ 
+ c*  do partial sum on each proc 
+       do i=1, count
+         PSum = PSum + myrow(i)
+       end do
+ 
+ c*  gather partial sums to the rootginst 
+       msgtag = 21
+       call PvmfGather(PartSums, PSum, 1, INTEGER4, msgtag, 
+      &                GROUP, rootginst, info)
+ 
+ c*  do a global sum over myrow, the result goes to rootginst 
+       msgtag = 23
+       call PvmfReduce(PvmSum, myrow, count, INTEGER4, msgtag, 
+      &                GROUP, rootginst, info)
+ 
+ c*  init values and include location information on each processor 
+       midpoint = nprocs/2
+       values(1) = -(myginst - midpoint)*(myginst-midpoint) + count
+       values(2) = myginst    
+ 
+ c*  use a user-defined function in reduce, send answer to rootginst 
+       msgtag = 25
+       call PvmfReduce(MaxWithLoc, values, 2, REAL8, 
+      &                msgtag, GROUP, rootginst, info_user)
+ 
+       bigN = nprocs*count
+       if (myginst.eq.rootginst) then
+ c*  Complete the Sum of Squares using different methods 
+         do i=1, nprocs
+           Sum1 = Sum1 + PartSums(i) 
+         end do
+         do i=1, count 
+           Sum2 = Sum2 + myrow(i)    
+         end do
+         SumSquares = bigN*(bigN+1)*(2*bigN+1)/6
+         if ( (Sum1.eq.SumSquares) .and. (Sum2.eq.SumSquares)) then
+           print *, '\ Test OK: Sum of Squares of first ', bigN, 
+      &             ' integers is ', Sum1
+         else
+           print *, '\ ERROR: The Sum of Squares of the first ', bigN, 
+      &             ' integers \ was calculated by Sum1 as ', Sum1,
+      &             ' and by Sum2 as ', Sum2,
+      &             ' for both it should have been ', SumSquares
+         end if
+ 
+         if (info_user.lt.0) 
+      &    print *, ' ERROR: ', info_user, ' on User Reduce Function'
+ 
+         if ((values(1).ne.count) .or. (values(2).ne.midpoint)) then
+           print *, ' ERROR: Should have (', count, ', ', midpoint,
+      &             '), but have (', values(1), ',', values(2)
+         else
+           print *, ' Test Ok: Received (', values(1), ',', 
+      &              values(2), ') '
+         end if
+ 
+       end if
+        
+ 
+ c*  sync up again, leave group, exit pvm 
+       call PvmfBarrier(GROUP, nprocs, info)   
+       call PvmfLvgroup(GROUP, info)
+       call PvmfExit(info)
+ 
+       stop
+       end
+ 
+ 
+ c*
+ c* This function returns the elementwise maximum of two vectors 
+ c* along with location information.
+ c*
+ c* The first num/2 values of x and y are the data values to compare.
+ c* The second num/2 values of x and y are location information
+ c* which is kept with the maximum value determined.
+ c*
+ c* In the case of a tie in data values, the smaller location 
+ c* is kept to insure the associativity of the operation.
+ c*
+ 
+       subroutine MaxWithLoc(datatype, x, y, num, info)
+       implicit none
+       integer datatype, num, info
+       double precision x(*), y(*)
+ 
+       include '../include/fpvm3.h'
+ 
+       integer i, count
+       count = num/2
+ 
+       if (datatype.ne.REAL8) then
+         info = PvmBadParam 
+         return
+       end if
+ 
+       do i=1, count
+         if (y(i).gt.x(i)) then
+           x(i)       = y(i)
+           x(i+count) = y(i+count)
+         elseif (y(i).eq.x(i)) then
+           x(i+count) = min(x(i+count), y(i+count))
+         end if
+       end do
+ 
+       info = PvmOk
+       return
+       end
+ 
+ 
*** /dev/null	Wed Nov  9 10:53:33 1994
--- gexamples/trsg.c	Sat Oct 15 15:54:46 1994
***************
*** 0 ****
--- 1,182 ----
+ /*
+  * Example of group Reduce, Scatter, and Gather functions - J.M. Donato
+  * 
+  * This example calculates the sum of squares of the first N integers
+  * in three different ways where 
+  *
+  *   N = (number of processors)*(number of elements per row)
+  *
+  * Note:  This is obviously not an efficient way to compute the 
+  *        sum of squares, but it is a cutesy example and test case.
+  */
+ 
+ #include <stdio.h>
+ #include "pvm3.h"
+ 
+ #define MAXNDATA  20
+ #define MAXNPROCS 16
+ #define TASK_NAME "trsg"
+ 
+ #define min(x,y) ( ((x)<(y))? (x) : (y) )
+ #define max(x,y) ( ((x)>(y))? (x) : (y) )
+ 
+ extern void PvmMin();
+ extern void PvmMax();
+ extern void PvmSum();
+ extern void PvmProduct();
+ 
+ void MaxWithLoc();
+ 
+ main()
+ {
+   int myginst, i, j, gsize, count, nprocs, msgtag, datatype; 
+   int info_product, info_user; 
+   int  tids[MAXNPROCS], myrow[MAXNDATA], matrix[MAXNDATA*MAXNPROCS]; 
+   float values[2];
+   int midpoint, bigN, Sum1=0, Sum2=0, SumSquares, rootginst; 
+   int PSum, PartSums[MAXNPROCS], dupls[MAXNDATA];
+   char *gname = "group_rsg";
+ 
+   /* join the group */
+   myginst = pvm_joingroup(gname);
+   pvm_setopt(PvmAutoErr, 1);
+ 
+   /* I am the first group member, get input, start up copies of myself */
+   if ( myginst == 0 )       
+   {
+     printf("\n *** Example use of PVM Reduce, Scatter, and Gather *** ");
+     printf("\n Number of processors to use (1-%d)? : ", MAXNPROCS);
+     scanf("%d", &nprocs);
+     if (nprocs > MAXNPROCS) nprocs = MAXNPROCS;
+     printf(" Number of elements per row to use (1-%d)? : ", MAXNDATA);
+     scanf("%d", &count);
+     if (count > MAXNDATA) count = MAXNDATA;
+     printf(" INPUT values: nprocs = %d, count = %d \n", nprocs, count);
+ 
+     tids[0] = pvm_mytid();
+ 
+     if (nprocs > 1)
+       pvm_spawn(TASK_NAME, (char**)0, 0, "", nprocs-1, &tids[1]);
+ 
+     /* wait until they have all started, then send input values */
+     while (gsize = pvm_gsize(gname) < nprocs) sleep(1);
+     pvm_initsend(PvmDataDefault);
+     pvm_pkint(&nprocs, 1, 1);
+     pvm_pkint(&count,  1, 1);
+     pvm_bcast(gname, msgtag=17);
+   }
+   else
+   {
+     /* receive the input values */
+     pvm_recv(-1, msgtag=17);
+     pvm_upkint(&nprocs, 1, 1);
+     pvm_upkint(&count,  1, 1);
+   }
+   
+   rootginst = 0;  /* determine the group root */
+ 
+   /* init the matrix values on the root processor */
+   if (myginst == rootginst) 
+     for (j=0; j<nprocs; j++)
+       for (i=0; i<count; i++)
+         matrix[j*count + i] = j*count + i + 1;
+ 
+   /* scatter rows of matrix to each processor */
+   pvm_scatter(myrow, matrix, count, PVM_INT, msgtag=19, gname, rootginst);
+ 
+   /* this should end up squaring each value on each processor */
+   for (i=0; i<count; i++) dupls[i] = (myginst*count + i + 1);
+   datatype = PVM_INT;
+   PvmProduct(&datatype, myrow, dupls, &count, &info_product);
+   if ((myginst == rootginst) && (info_product < 0))
+       printf(" ERROR: %d on PvmProduct call \n", info_product);
+ 
+   /* do partial sum on each proc */
+   for (i=0; i<count; i++) PSum += myrow[i];
+ 
+   /* gather partial sums to the rootginst */
+   pvm_gather(PartSums, &PSum, 1, PVM_INT, msgtag=21, gname, rootginst);
+ 
+   /* do a global sum over myrow, the result goes to rootginst */
+   pvm_reduce(PvmSum, myrow, count, PVM_INT, msgtag=23, gname, rootginst);
+ 
+   /* init values and include location information on each processor */
+   midpoint = nprocs/2;
+   values[0] = -(myginst - midpoint)*(myginst-midpoint) + count;
+   values[1] = myginst;    /* location information */
+ 
+   /* use a user-defined function in reduce, send answer to rootginst */
+   info_user = pvm_reduce(MaxWithLoc, values, 2, PVM_FLOAT, 
+                          msgtag=25, gname, rootginst);
+ 
+   bigN = nprocs*count;
+   if (myginst == rootginst)
+   {
+     /* Complete the Sum of Squares using different methods */
+     for (i=0; i<nprocs; i++) Sum1 += PartSums[i]; 
+     for (i=0; i<count;  i++) Sum2 += myrow[i];    
+     SumSquares = bigN*(bigN+1)*(2*bigN+1)/6;
+     if ( (Sum1 == SumSquares) && (Sum2 == SumSquares))
+       printf("\n Test OK: Sum of Squares of first %d integers is %d \n",
+              bigN, Sum1);
+     else
+       printf("\n %s%d%s%d%s%d,\n%s%d \n", 
+              "ERROR: The Sum of Squares of the first ", bigN, 
+              " integers \n was calculated by Sum1 as ", Sum1,
+              " and by Sum2 as ", Sum2,
+              " for both it should have been ", SumSquares);
+ 
+     if (info_user < 0) 
+       printf(" ERROR: %d on Reduce with User Function\n", info_user);
+ 
+     if ((values[0] != count) || (values[1] != midpoint)) 
+       printf(" ERROR: Should have (%f, %f), but have (%f, %f): \n",
+                count, midpoint, values[0], values[1]);
+     else
+       printf(" Test Ok: Received (%f, %f): ", values[0], values[1]);
+     printf("\n");
+   }
+ 
+   /* sync up again, leave group, exit pvm */
+   pvm_barrier(gname, nprocs);   
+   pvm_lvgroup(gname);
+   pvm_exit();
+   exit(1);
+ 
+ } /* end main() */
+ 
+ 
+ /*
+   This function returns the elementwise maximum of two vectors 
+   along with location information.
+  
+   The first num/2 values of x and y are the data values to compare.
+   The second num/2 values of x and y are location information
+   which is kept with the maximum value determined.
+ 
+   In the case of a tie in data values, the smaller location 
+   is kept to insure the associativity of the operation.
+ */
+ 
+ void MaxWithLoc(datatype, x, y, num, info)
+ int *datatype, *num, *info;
+ float *x, *y;
+ {
+   int i, count;
+   count = (*num) / 2;
+ 
+   if (*datatype != PVM_FLOAT) { *info = PvmBadParam; return; }
+ 
+   for (i=0; i<count; i++)
+     if (y[i] > x[i])
+     {
+       x[i]       = y[i];
+       x[i+count] = y[i+count];
+     }
+     else
+       if (y[i] == x[i]) x[i+count] = min(x[i+count], y[i+count]);
+ 
+   *info = PvmOk;
+   return;
+ 
+ }  /* end MaxWithLoc() */
*** ../netlib/pvm3.3.4/include/fpvm3.h	Fri Mar 11 11:49:08 1994
--- include/fpvm3.h	Thu Oct 27 07:21:16 1994
***************
*** 50,56 ****
        integer PvmNoData, PvmNoHost, PvmNoFile, PvmNoMem
        integer PvmBadMsg, PvmNoBuf, PvmNoSuchBuf
        integer PvmNullGroup, PvmDupGroup, PvmNoGroup
!       integer PvmNotInGroup, PvmNoinst, PvmHostFail, PvmNoParent
        integer PvmNotImpl, PvmDSysErr, PvmBadVersion, PvmOutOfRes
        integer PvmDupHost, PvmCantStart, PvmAlready, PvmNoTask
        integer PvmNoEntry, PvmDupEntry
--- 50,56 ----
        integer PvmNoData, PvmNoHost, PvmNoFile, PvmNoMem
        integer PvmBadMsg, PvmNoBuf, PvmNoSuchBuf
        integer PvmNullGroup, PvmDupGroup, PvmNoGroup
!       integer PvmNotInGroup, PvmNoInst, PvmHostFail, PvmNoParent
        integer PvmNotImpl, PvmDSysErr, PvmBadVersion, PvmOutOfRes
        integer PvmDupHost, PvmCantStart, PvmAlready, PvmNoTask
        integer PvmNoEntry, PvmDupEntry
*** ../netlib/pvm3.3.4/include/pvm3.h	Thu May 26 15:53:56 1994
--- include/pvm3.h	Tue Oct 18 06:49:33 1994
***************
*** 194,200 ****
  /*
  int pvm_catchout	__ProtoGlarp__(( FILE * ));
  */
- int pvm_catchout();
  int pvm_config		__ProtoGlarp__(( int *, int *,
  										struct pvmhostinfo ** ));
  int pvm_delete		__ProtoGlarp__(( char *, int ));
--- 194,199 ----
*** ../netlib/pvm3.3.4/lib/pvmd	Sun Sep  4 16:25:27 1994
--- lib/pvmd	Mon Oct 24 09:12:31 1994
***************
*** 39,45 ****
  
  export PVM_ARCH
  # make a joyful noise.
! case "x$PVM_ARCH" in xSGI | xSGIMP )
  	trap '' 2
  ;;esac
  exec $PVM_ROOT/lib/$PVM_ARCH/pvmd3 $@
--- 39,45 ----
  
  export PVM_ARCH
  # make a joyful noise.
! case "x$PVM_ARCH" in xSGI | xSGI5 | xSGIMP | xSGI64 | xSGIMP64 )
  	trap '' 2
  ;;esac
  exec $PVM_ROOT/lib/$PVM_ARCH/pvmd3 $@
*** ../netlib/pvm3.3.4/lib/pvmgetarch	Sun Sep  4 16:25:27 1994
--- lib/pvmgetarch	Tue Nov  8 16:27:04 1994
***************
*** 10,16 ****
  #   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, SYMM, TITN, UVAX, VAX,
  #   UNKNOWN
  # Need to do:
  #   BAL, CSPP, IPSC2, VCM2
--- 10,16 ----
  #   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
***************
*** 54,59 ****
--- 54,60 ----
  	*,mips )                ARCH=MIPS ;;
  	*,CRAY-2 )              ARCH=CRAY2 ;;
  	Linux,i[34]86 )         ARCH=LINUX ;;
+ 	SUPER-UX,SX-3 )         ARCH=SX3 ;;
  	esac
  fi
  
***************
*** 103,108 ****
--- 104,125 ----
  	fi
  fi
  
+ if [ "$ARCH" = UNKNOWN ]; then
+ 	if [ -f /bin/uname -o -f /usr/bin/uname ]; then
+ 		if [ -f /bin/uname ]; then
+ 			os="`/bin/uname -s`"
+ 			ht="`/bin/uname -m`"
+ 		else
+ 			os="`/usr/bin/uname -s`"
+ 			ht="`/usr/bin/uname -m`"
+ 		fi
+ 
+ 		case "$os,$ht" in
+ 		*,i[34]86 )             ARCH=SCO ;;
+ 		esac
+ 	fi
+ fi
+ 
  if [ "$ARCH" = SUN4 ]; then
  	rel="`/bin/uname -r`"
  	case "$rel" in
***************
*** 110,116 ****
  	esac
  fi
  if [ "$ARCH" = SUN4SOL2 ]; then
! 	nproc="`mpstat | wc -l`"
  	if [ $nproc -gt 2 ]; then ARCH=SUNMP; fi
  fi
  if [ "$ARCH" = ALPHA ]; then
--- 127,133 ----
  	esac
  fi
  if [ "$ARCH" = SUN4SOL2 ]; then
! 	nproc="`/bin/mpstat | wc -l`"
  	if [ $nproc -gt 2 ]; then ARCH=SUNMP; fi
  fi
  if [ "$ARCH" = ALPHA ]; then
***************
*** 125,135 ****
  	rel="`/bin/uname -r`"
  	case "$rel" in
  	5.* )   ARCH=SGI5 ;;
  	esac
  fi
  if [ "$ARCH" = SGI5 ]; then
  	nproc="`mpadmin -n | wc -w`"
! 	if [ $nproc -gt 1 ]; then ARCH=SGIMP; fi
  fi
  if [ "$ARCH" = SUN4 -a -f /dev/cm ]; then ARCH=CM2; fi
  if [ "$ARCH" = SUN4 -a -f /dev/cmni ]; then ARCH=CM5; fi
--- 142,157 ----
  	rel="`/bin/uname -r`"
  	case "$rel" in
  	5.* )   ARCH=SGI5 ;;
+ 	6.* )   ARCH=SGI64 ;;
  	esac
  fi
+ if [ "$ARCH" = SGI64 ]; then
+ 	nproc="`mpadmin -n | wc -w`"
+ 	if [ $nproc -gt 1 -a "$SGIMP" = ON ]; then ARCH=SGIMP64; fi
+ fi
  if [ "$ARCH" = SGI5 ]; then
  	nproc="`mpadmin -n | wc -w`"
! 	if [ $nproc -gt 1 -a "$SGIMP" = ON ]; then ARCH=SGIMP; fi
  fi
  if [ "$ARCH" = SUN4 -a -f /dev/cm ]; then ARCH=CM2; fi
  if [ "$ARCH" = SUN4 -a -f /dev/cmni ]; then ARCH=CM5; fi
*** ../netlib/pvm3.3.4/libfpvm/CSPP/Makefile	Sun Sep  4 16:25:27 1994
--- libfpvm/CSPP/Makefile	Tue Nov  8 16:22:12 1994
***************
*** 73,78 ****
--- 73,79 ----
  
  install:	libfpvm3.a $(PVMLDIR)
  	mv libfpvm3.a $(PVMLDIR)
+ 	case x$(HASRANLIB) in xt ) echo ranlib; ranlib $(PVMLDIR)/libfpvm3.a ;; esac
  
  $(PVMLDIR):
  	- mkdir $(PVMLDIR)
*** ../netlib/pvm3.3.4/libfpvm/CUBE/Makefile	Wed Jul  7 20:36:56 1993
--- libfpvm/CUBE/Makefile	Tue Nov  8 16:22:43 1994
***************
*** 7,12 ****
--- 7,13 ----
  default:    
  	make PVM_ARCH=I860 AR_FRONT=ar860 -f $(CONFFILE) -f ../Makefile.mimd default
  	mv libfpvm3.a $(LIBDIR)/libfpvm3pe.a
+ 	case x$(HASRANLIB) in xt ) echo ranlib; ranlib $(PVMLDIR)/libfpvm3pe.a ;; esac
  
  clean:
  	make -f $(CONFFILE) -f ../Makefile.mimd clean
*** ../netlib/pvm3.3.4/libfpvm/HPPA/Makefile	Fri May  6 11:35:16 1994
--- libfpvm/HPPA/Makefile	Tue Nov  8 16:22:53 1994
***************
*** 73,78 ****
--- 73,79 ----
  
  install:	libfpvm3.a $(PVMLDIR)
  	mv libfpvm3.a $(PVMLDIR)
+ 	case x$(HASRANLIB) in xt ) echo ranlib; ranlib $(PVMLDIR)/libfpvm3.a ;; esac
  
  $(PVMLDIR):
  	- mkdir $(PVMLDIR)
*** ../netlib/pvm3.3.4/libfpvm/I860/Makefile	Wed Jul  7 20:40:55 1993
--- libfpvm/I860/Makefile	Tue Nov  8 16:23:10 1994
***************
*** 5,10 ****
--- 5,11 ----
  #
  install:	default $(LIBDIR)
  	mv libfpvm3.a $(LIBDIR)
+ 	case x$(HASRANLIB) in xt ) echo ranlib; ranlib $(LIBDIR)/libfpvm3.a ;; esac
  		
  default:    
  	make -f $(CONFFILE) -f ../Makefile.mimd libfpvm3.a 
*** ../netlib/pvm3.3.4/libfpvm/Makefile.aimk	Fri May  6 11:34:08 1994
--- libfpvm/Makefile.aimk	Tue Nov  8 15:55:39 1994
***************
*** 65,70 ****
--- 65,71 ----
  
  install:	libfpvm3.a $(PVMLDIR)
  	mv libfpvm3.a $(PVMLDIR)
+ 	case x$(HASRANLIB) in xt ) echo ranlib; ranlib $(PVMLDIR)/libfpvm3.a ;; esac
  
  $(PVMLDIR):
  	- mkdir $(PVMLDIR)
*** ../netlib/pvm3.3.4/libfpvm/Makefile.mimd	Tue Jun 21 15:40:23 1994
--- libfpvm/Makefile.mimd	Tue Nov  8 15:56:05 1994
***************
*** 63,68 ****
--- 63,69 ----
  
  install:	libfpvm3.a $(PVMLDIR)
  	mv libfpvm3.a $(PVMLDIR)
+ 	case x$(HASRANLIB) in xt ) echo ranlib; ranlib $(PVMLDIR)/libfpvm3.a ;; esac
  
  $(PVMLDIR):
  	- mkdir $(PVMLDIR)
*** ../netlib/pvm3.3.4/libfpvm/POWER4/Makefile	Sun Sep  4 16:25:28 1994
--- libfpvm/POWER4/Makefile	Tue Nov  8 16:23:23 1994
***************
*** 73,78 ****
--- 73,79 ----
  
  install:	libfpvm3.a $(PVMLDIR)
  	mv libfpvm3.a $(PVMLDIR)
+ 	case x$(HASRANLIB) in xt ) echo ranlib; ranlib $(PVMLDIR)/libfpvm3.a ;; esac
  
  $(PVMLDIR):
  	- mkdir $(PVMLDIR)
*** ../netlib/pvm3.3.4/libfpvm/RS6K/Makefile	Sun Sep  4 16:25:28 1994
--- libfpvm/RS6K/Makefile	Tue Nov  8 16:23:31 1994
***************
*** 73,78 ****
--- 73,79 ----
  
  install:	libfpvm3.a $(PVMLDIR)
  	mv libfpvm3.a $(PVMLDIR)
+ 	case x$(HASRANLIB) in xt ) echo ranlib; ranlib $(PVMLDIR)/libfpvm3.a ;; esac
  
  $(PVMLDIR):
  	- mkdir $(PVMLDIR)
*** ../netlib/pvm3.3.4/man/man1/pvm_intro.1	Fri Jul  1 11:27:16 1994
--- man/man1/pvm_intro.1	Tue Oct 18 06:42:16 1994
***************
*** 166,171 ****
--- 166,174 ----
  If you set it to the absolute or relative path of the pvmd startup
  script (for example /usr/local/pvm3/lib/pvmd or pvm3/lib/pvmd),
  the script will automatically set PVM_ROOT.
+ Note that for this to work,
+ you must set it to run the pvmd script,
+ not the pvmd3 executable itself.
  .PP
  
  The following environment variables are used by PVM internally.
*** ../netlib/pvm3.3.4/man/man3/libpvm.3	Sun Sep  4 16:25:29 1994
--- man/man3/libpvm.3	Sat Oct 15 14:47:53 1994
***************
*** 178,181 ****
  .PP
  
  .SH SEE ALSO
! aimk(1PVM), pvm(1PVM), pvm_intro(1PVM), pvmd3(1PVM)
--- 178,184 ----
  .PP
  
  .SH SEE ALSO
! aimk(1PVM),
! pvm(1PVM),
! pvm_intro(1PVM),
! pvmd3(1PVM)
*** ../netlib/pvm3.3.4/man/man3/pvm_config.3	Sun Sep  4 16:25:29 1994
--- man/man3/pvm_config.3	Sat Oct 15 14:47:53 1994
***************
*** 36,51 ****
  name, architecture, and relative speed.
  .br
  .IP dtid
! Integer returning pvmd task ID for this host
  .br
  .IP name
! Character string returning name of this host
  .br
  .IP arch
! Character string returning name of host architecture
  .br
  .IP speed
! Integer returning relative speed of this host. Default value is 1000.
  .br
  .IP info
  Integer status code returned by the routine.
--- 36,51 ----
  name, architecture, and relative speed.
  .br
  .IP dtid
! Integer returning pvmd task ID for host
  .br
  .IP name
! Character string returning name of host
  .br
  .IP arch
! Character string returning architecture name of host
  .br
  .IP speed
! Integer returning relative speed of host. Default value is 1000.
  .br
  .IP info
  Integer status code returned by the routine.
*** ../netlib/pvm3.3.4/man/man3/pvm_gather.3	Fri May  6 11:38:25 1994
--- man/man3/pvm_gather.3	Sat Oct 15 14:47:53 1994
***************
*** 49,54 ****
--- 49,55 ----
  .br
  .IP datatype 
  Integer specifying the type of the entries in the result and data arrays.
+ (See below for defined types.)
  .IP msgtag   
  Integer message tag supplied by the user.
  msgtag should be >= 0.  It allows the user's program to 
***************
*** 90,95 ****
--- 91,112 ----
  array.  
  The root task is identified by its instance number in the group.
  .PP
+ C and Fortran defined
+ .I datatypes
+ are:
+ .nf
+            C datatypes   FORTRAN datatypes
+          -----------------------------------
+            PVM_BYTE       BYTE1
+            PVM_SHORT      INTEGER2
+            PVM_INT        INTEGER4
+            PVM_FLOAT      REAL4
+            PVM_CPLX       COMPLEX8
+            PVM_DOUBLE     REAL8
+            PVM_DCPLX      COMPLEX16
+            PVM_LONG
+ .fi
+ .PP
  In using the scatter and gather routines, keep in mind that
  C stores multidimensional arrays in row order,
  typically starting with an initial index of 0; whereas,
***************
*** 110,116 ****
                        msgtag, "workers", rootginst);
  .sp
  Fortran:
!    CALL PVMFGATHER(GETMATRIX, MYCOLUMN, COUNT, INT4,
    &                MTAG, 'workers', ROOT, INFO)
  .fi
  
--- 127,133 ----
                        msgtag, "workers", rootginst);
  .sp
  Fortran:
!    CALL PVMFGATHER(GETMATRIX, MYCOLUMN, COUNT, INTEGER4,
    &                MTAG, 'workers', ROOT, INFO)
  .fi
  
*** ../netlib/pvm3.3.4/man/man3/pvm_mcast.3	Tue Aug 31 16:04:00 1993
--- man/man3/pvm_mcast.3	Sat Oct 15 14:47:53 1994
***************
*** 94,96 ****
--- 94,100 ----
  	PvmSysErr	pvmd not responding.
  	PvmNoBuf	no send buffer.
  .fi
+ .SH SEE ALSO
+ pvm_psend(3PVM),
+ pvm_recv(3PVM),
+ pvm_send(3PVM)
*** ../netlib/pvm3.3.4/man/man3/pvm_pack.3	Tue Jun 21 15:40:26 1994
--- man/man3/pvm_pack.3	Wed Nov  9 10:11:18 1994
***************
*** 115,120 ****
--- 115,125 ----
  .I stride
  to be 1.
  .PP
+ A null string ("") can be packed;
+ this is just a string with no characters before the terminating '\\0'.
+ However,
+ packing a null string pointer, (char *)0, is not allowed.
+ .PP
  If the packing is successful,
  .I info
  will be 0. If some error occurs then
***************
*** 211,216 ****
--- 216,227 ----
  	CALL PVMFSEND( TID, MSGTAG, INFO )
  .fi
  
+ .SH WARNINGS
+ Strings cannot be packed when using the PvmDataInPlace encoding,
+ due to limitations in the implementation.
+ Attempting to pack a string using
+ pvm_pkstr or pvm_packf
+ will cause error code PvmNotImpl to be returned.
  .SH ERRORS
  .ta 0.5i 2.0i
  .nf
***************
*** 220,223 ****
  		Try calling pvm_initsend before packing message.
  .fi
  .SH SEE ALSO
! pvm_unpack(3PVM), pvm_initsend(3PVM)
--- 231,235 ----
  		Try calling pvm_initsend before packing message.
  .fi
  .SH SEE ALSO
! pvm_unpack(3PVM),
! pvm_initsend(3PVM)
*** ../netlib/pvm3.3.4/man/man3/pvm_precv.3	Fri May  6 15:29:31 1994
--- man/man3/pvm_precv.3	Sat Oct 15 14:47:53 1994
***************
*** 115,121 ****
  .PP
  pvm_precv does not affect the state of the current receive message buffer
  (created by the other receive functions).
! 
  .SH EXAMPLES
  .nf
  C:
--- 115,138 ----
  .PP
  pvm_precv does not affect the state of the current receive message buffer
  (created by the other receive functions).
! .SH WARNINGS
! In some versions of PVM (CM5, I860 and PGON),
! messages sent using pvm_psend must be received only by pvm_precv,
! likewise those sent with pvm_send
! must be received by pvm_recv, pvm_nrecv or pvm_trecv.
! pvm_psend is not compatible with pvm_recv
! (nor pvm_send with pvm_precv).
! In addition, pvm_probe is not interoperable with pvm_psend.
! .PP
! This problem occurs
! because nonstandard message headers are used for efficiency
! in the pvm_psend function.
! In the generic Unix version of PVM,
! the calls are fully interoperable.
! .PP
! The message tag space is shared between pvm_send and pvm_psend,
! so you must be careful to avoid selecting the wrong message
! (for example by using a wildcard to match the message).
  .SH EXAMPLES
  .nf
  C:
***************
*** 137,141 ****
  	PvmSysErr	pvmd not responding.
  .fi
  .SH SEE ALSO
! pvm_nrecv(3PVM), pvm_unpack(3PVM), pvm_probe(3PVM), pvm_recv(3PVM),
! pvm_send(3PVM), pvm_trecv(3PVM), pvm_mcast(3PVM)
--- 154,158 ----
  	PvmSysErr	pvmd not responding.
  .fi
  .SH SEE ALSO
! pvm_psend(3PVM),
! pvm_recv(3PVM)
*** ../netlib/pvm3.3.4/man/man3/pvm_psend.3	Tue Jun 21 15:40:27 1994
--- man/man3/pvm_psend.3	Sat Oct 15 14:47:53 1994
***************
*** 95,101 ****
  .PP
  pvm_psend does not affect the state of the current outgoing message buffer
  (created by pvm_initsend and used by pvm_send).
! 
  .SH EXAMPLES
  .nf
  C:
--- 95,118 ----
  .PP
  pvm_psend does not affect the state of the current outgoing message buffer
  (created by pvm_initsend and used by pvm_send).
! .SH WARNINGS
! In some versions of PVM (CM5, I860 and PGON),
! messages sent using pvm_psend must be received only by pvm_precv,
! likewise those sent with pvm_send
! must be received by pvm_recv, pvm_nrecv or pvm_trecv.
! pvm_psend is not compatible with pvm_recv
! (nor pvm_send with pvm_precv).
! In addition, pvm_probe is not interoperable with pvm_psend.
! .PP
! This problem occurs
! because nonstandard message headers are used for efficiency
! in the pvm_psend function.
! In the generic Unix version of PVM,
! the calls are fully interoperable.
! .PP
! The message tag space is shared between pvm_send and pvm_psend,
! so you must be careful to avoid selecting the wrong message
! (for example by using a wildcard to match the message).
  .SH EXAMPLES
  .nf
  C:
***************
*** 114,117 ****
  	PvmSysErr	pvmd not responding.
  .fi
  .SH SEE ALSO
! pvm_initsend(3PVM), pvm_pack(3PVM), pvm_recv(3PVM), pvm_send(3PVM)
--- 131,135 ----
  	PvmSysErr	pvmd not responding.
  .fi
  .SH SEE ALSO
! pvm_precv(3PVM),
! pvm_send(3PVM)
*** ../netlib/pvm3.3.4/man/man3/pvm_reduce.3	Tue Jun 21 15:40:27 1994
--- man/man3/pvm_reduce.3	Sat Oct 15 14:47:53 1994
***************
*** 1,6 ****
  .TH REDUCE 3PVM "20 April, 1994"
  .SH NAME
! pvm_reduce \- Performs a reduce operation over members of the specified group. 
  
  .SH SYNOPSIS
  .ft B
--- 1,6 ----
  .TH REDUCE 3PVM "20 April, 1994"
  .SH NAME
! pvm_reduce \- Performs a reduction operation over members of the specified group. 
  
  .SH SYNOPSIS
  .ft B
***************
*** 19,25 ****
  .SH PARAMETERS
  .IP func 0.8i
  Function which defines the operation performed on the 
! global data. Predefined are PvmMax, PvmMin, PvmSum and PvmProduct.
  Users can define their own function.
  .br
    SYNOPSIS for func
--- 19,25 ----
  .SH PARAMETERS
  .IP func 0.8i
  Function which defines the operation performed on the 
! global data. Predefined are PvmMax, PvmMin, PvmSum, and PvmProduct.
  Users can define their own function.
  .br
    SYNOPSIS for func
***************
*** 42,48 ****
  .br
  .IP datatype 
  Integer specifying the type of the entries in the data array.
! (See below for defined types)
  .IP msgtag   
  Integer message tag supplied by the user.
  msgtag should be >= 0.  It allows the user's program to 
--- 42,48 ----
  .br
  .IP datatype 
  Integer specifying the type of the entries in the data array.
! (See below for defined types.)
  .IP msgtag   
  Integer message tag supplied by the user.
  msgtag should be >= 0.  It allows the user's program to 
***************
*** 78,89 ****
           PvmProduct 
  .fi
  
! PvmMax and PvmMin are implemented for datatypes
! byte, short, integer, long, float, double, complex, and double complex.
  For complex values the minimum [maximum] is that 
  complex pair with the minimum [maximum] modulus.
! PvmSum and PvmProduct are implemented for datatypes short, 
! integer, long, float, double, complex, and double complex.
  .PP
  C and Fortran defined 
  .I datatypes 
--- 78,88 ----
           PvmProduct 
  .fi
  
! PvmMax and PvmMin are implemented for all the dataypes listed below.
  For complex values the minimum [maximum] is that 
  complex pair with the minimum [maximum] modulus.
! PvmSum and PvmProduct are implemented for all the dataypes listed 
! below with the exception of PVM_BYTE and BYTE1.
  .PP
  C and Fortran defined 
  .I datatypes 
***************
*** 92,99 ****
             C datatypes   FORTRAN datatypes
           -----------------------------------
             PVM_BYTE       BYTE1             
!            PVM_SHORT      INT2             
!            PVM_INT        INT4            
             PVM_FLOAT      REAL4          
             PVM_CPLX       COMPLEX8      
             PVM_DOUBLE     REAL8        
--- 91,98 ----
             C datatypes   FORTRAN datatypes
           -----------------------------------
             PVM_BYTE       BYTE1             
!            PVM_SHORT      INTEGER2             
!            PVM_INT        INTEGER4            
             PVM_FLOAT      REAL4          
             PVM_CPLX       COMPLEX8      
             PVM_DOUBLE     REAL8        
***************
*** 125,131 ****
                        msgtag, "workers", rootginst);
  .sp
  Fortran:
!    CALL PVMFREDUCE(PvmMax, MYVALS, COUNT, INT4,
    &                MTAG, 'workers', ROOT, INFO)
  .fi
  
--- 124,130 ----
                        msgtag, "workers", rootginst);
  .sp
  Fortran:
!    CALL PVMFREDUCE(PvmMax, MYVALS, COUNT, INTEGER4,
    &                MTAG, 'workers', ROOT, INFO)
  .fi
  
*** ../netlib/pvm3.3.4/man/man3/pvm_scatter.3	Fri May  6 11:38:33 1994
--- man/man3/pvm_scatter.3	Sat Oct 15 14:47:53 1994
***************
*** 44,49 ****
--- 44,50 ----
  .br
  .IP datatype 
  Integer specifying the type of the entries in the result and data arrays.
+ (See below for defined types.)
  .IP msgtag   
  Integer message tag supplied by the user.
  msgtag should be >= 0.  It allows the user's program to 
***************
*** 89,94 ****
--- 90,111 ----
  array.
  The root task is identified by its instance number in the group.
  .PP
+ C and Fortran defined
+ .I datatypes
+ are:
+ .nf
+            C datatypes   FORTRAN datatypes
+          -----------------------------------
+            PVM_BYTE       BYTE1
+            PVM_SHORT      INTEGER2
+            PVM_INT        INTEGER4
+            PVM_FLOAT      REAL4
+            PVM_CPLX       COMPLEX8
+            PVM_DOUBLE     REAL8
+            PVM_DCPLX      COMPLEX16
+            PVM_LONG
+ .fi
+ .PP
  In using the scatter and gather routines, keep in mind that
  C stores multidimensional arrays in row order,
  typically starting with an initial index of 0; whereas,
***************
*** 106,112 ****
                        msgtag, "workers", rootginst);
  .sp
  Fortran:
!    CALL PVMFSCATTER(GETMYCOLUMN, MATRIX, COUNT, INT4,
    &                MTAG, 'workers', ROOT, INFO)
  .fi
  
--- 123,129 ----
                        msgtag, "workers", rootginst);
  .sp
  Fortran:
!    CALL PVMFSCATTER(GETMYCOLUMN, MATRIX, COUNT, INTEGER4,
    &                MTAG, 'workers', ROOT, INFO)
  .fi
  
*** ../netlib/pvm3.3.4/man/man3/pvm_send.3	Tue Jun 21 15:40:27 1994
--- man/man3/pvm_send.3	Sat Oct 15 14:47:54 1994
***************
*** 47,52 ****
--- 47,57 ----
  message A will arrive at task 2 before message B.
  Moreover, if both messages arrive before task 2 does a receive,
  then a wildcard receive will always return message A.
+ .PP
+ Terminating a PVM task immediately after sending a message or messages
+ from it may result in those messages being lost.
+ To be sure,
+ always call pvm_exit() before stopping.
  
  .SH EXAMPLES
  .nf
***************
*** 72,75 ****
  	PvmNoBuf	no active send buffer. Try pvm_initsend() before send.
  .fi
  .SH SEE ALSO
! pvm_initsend(3PVM), pvm_pack(3PVM), pvm_recv(3PVM)
--- 77,84 ----
  	PvmNoBuf	no active send buffer. Try pvm_initsend() before send.
  .fi
  .SH SEE ALSO
! pvm_initsend(3PVM),
! pvm_mcast(3PVM),
! pvm_pack(3PVM),
! pvm_psend(3PVM),
! pvm_recv(3PVM)
*** ../netlib/pvm3.3.4/man/man3/pvm_start_pvmd.3	Tue Jun 21 15:40:28 1994
--- man/man3/pvm_start_pvmd.3	Thu Oct 27 07:19:30 1994
***************
*** 1,4 ****
! .TH pvm_start_pvmd 3PVM "29 April, 1994"
  .SH NAME
  pvm_start_pvmd \- Starts new PVM daemon.
  
--- 1,4 ----
! .TH START_PVMD 3PVM "29 April, 1994"
  .SH NAME
  pvm_start_pvmd \- Starts new PVM daemon.
  
*** ../netlib/pvm3.3.4/man/man3/pvm_tasks.3	Sun Sep  4 16:25:29 1994
--- man/man3/pvm_tasks.3	Sat Oct 15 14:47:54 1994
***************
*** 113,116 ****
  	PvmNoHost	specified host not in virtual machine.
  .fi
  .SH SEE ALSO
! pvm_config(3PVM), pvm_tidtohost(3PVM)
--- 113,117 ----
  	PvmNoHost	specified host not in virtual machine.
  .fi
  .SH SEE ALSO
! pvm_config(3PVM),
! pvm_tidtohost(3PVM)
*** ../netlib/pvm3.3.4/man/man3/pvm_tidtohost.3	Tue Jun 21 15:40:28 1994
--- man/man3/pvm_tidtohost.3	Sat Oct 15 14:47:54 1994
***************
*** 7,13 ****
  C	int dtid = pvm_tidtohost( tid )
  .br
  
! Fortran	NOT AVAILABLE
  .fi
  
  .SH PARAMETERS
--- 7,13 ----
  C	int dtid = pvm_tidtohost( tid )
  .br
  
! Fortran	call pvmftidtoh( tid, dtid )
  .fi
  
  .SH PARAMETERS
***************
*** 33,36 ****
  	PvmSysErr	pvmd not responding.
  .fi
  .SH SEE ALSO
! pvm_config(3PVM), pvm_tasks(3PVM)
--- 33,37 ----
  	PvmSysErr	pvmd not responding.
  .fi
  .SH SEE ALSO
! pvm_config(3PVM),
! pvm_tasks(3PVM)
*** ../netlib/pvm3.3.4/man/man3/pvm_unpack.3	Tue Jun 21 15:40:28 1994
--- man/man3/pvm_unpack.3	Sat Oct 15 14:47:54 1994
***************
*** 204,210 ****
          pvm_unpackf("%*d %4lf", count, iarry, darry);
  .sp
  Fortran:
! 	CALL PVMFRECV( TID, MSGTAG );
  	CALL PVMFUNPACK( INTEGER4, NSIZE, 1, 1, INFO )
  	CALL PVMFUNPACK( STRING, STEPNAME, 8, 1, INFO )
  	CALL PVMFUNPACK( REAL4, A(5,1), NSIZE, NSIZE , INFO )
--- 204,210 ----
          pvm_unpackf("%*d %4lf", count, iarry, darry);
  .sp
  Fortran:
! 	CALL PVMFRECV( TID, MSGTAG, INFO );
  	CALL PVMFUNPACK( INTEGER4, NSIZE, 1, 1, INFO )
  	CALL PVMFUNPACK( STRING, STEPNAME, 8, 1, INFO )
  	CALL PVMFUNPACK( REAL4, A(5,1), NSIZE, NSIZE , INFO )
*** /dev/null	Wed Nov  9 10:53:54 1994
--- man/mkmanlinks	Sat Oct 15 14:48:52 1994
***************
*** 0 ****
--- 1,177 ----
+ #!/bin/sh
+ 
+ M=1
+ case $1 in
+ -u ) M=0 ;;
+ esac
+ 
+ echo "deleting links..."
+ rm -f man3/libfpvm.3 \
+  man3/pvm_getmwid.3 \
+  man3/pvm_gettmask.3 \
+  man3/pvm_packf.3 \
+  man3/pvm_pkbyte.3 \
+  man3/pvm_pkcplx.3 \
+  man3/pvm_pkdcplx.3 \
+  man3/pvm_pkdouble.3 \
+  man3/pvm_pkfloat.3 \
+  man3/pvm_pkint.3 \
+  man3/pvm_pklong.3 \
+  man3/pvm_pkshort.3 \
+  man3/pvm_pkstr.3 \
+  man3/pvm_pkuint.3 \
+  man3/pvm_pkulong.3 \
+  man3/pvm_pkushort.3 \
+  man3/pvm_unpackf.3 \
+  man3/pvm_upkbyte.3 \
+  man3/pvm_upkcplx.3 \
+  man3/pvm_upkdcplx.3 \
+  man3/pvm_upkdouble.3 \
+  man3/pvm_upkfloat.3 \
+  man3/pvm_upkint.3 \
+  man3/pvm_upklong.3 \
+  man3/pvm_upkshort.3 \
+  man3/pvm_upkstr.3 \
+  man3/pvm_upkuint.3 \
+  man3/pvm_upkulong.3 \
+  man3/pvm_upkushort.3 \
+  man3/pvmfaddhost.3 \
+  man3/pvmfadvise.3 \
+  man3/pvmfarchcode.3 \
+  man3/pvmfbarrier.3 \
+  man3/pvmfbcast.3 \
+  man3/pvmfbufinfo.3 \
+  man3/pvmfcatchout.3 \
+  man3/pvmfconfig.3 \
+  man3/pvmfdelhost.3 \
+  man3/pvmfexit.3 \
+  man3/pvmffreebuf.3 \
+  man3/pvmfgather.3 \
+  man3/pvmfgetinst.3 \
+  man3/pvmfgetopt.3 \
+  man3/pvmfgetrbuf.3 \
+  man3/pvmfgetsbuf.3 \
+  man3/pvmfgettid.3 \
+  man3/pvmfgsize.3 \
+  man3/pvmfhalt.3 \
+  man3/pvmfhostsync.3 \
+  man3/pvmfinitsend.3 \
+  man3/pvmfjoingrp.3 \
+  man3/pvmfkill.3 \
+  man3/pvmflvgrp.3 \
+  man3/pvmfmcast.3 \
+  man3/pvmfmkbuf.3 \
+  man3/pvmfmstat.3 \
+  man3/pvmfmytid.3 \
+  man3/pvmfnotify.3 \
+  man3/pvmfnrecv.3 \
+  man3/pvmfpack.3 \
+  man3/pvmfparent.3 \
+  man3/pvmfperror.3 \
+  man3/pvmfprecv.3 \
+  man3/pvmfprobe.3 \
+  man3/pvmfpsend.3 \
+  man3/pvmfpstat.3 \
+  man3/pvmfrecv.3 \
+  man3/pvmfreduce.3 \
+  man3/pvmfscatter.3 \
+  man3/pvmfsend.3 \
+  man3/pvmfsendsig.3 \
+  man3/pvmfserror.3 \
+  man3/pvmfsetopt.3 \
+  man3/pvmfsetrbuf.3 \
+  man3/pvmfsetsbuf.3 \
+  man3/pvmfspawn.3 \
+  man3/pvmftasks.3 \
+  man3/pvmftidtoh.3 \
+  man3/pvmftrecv.3 \
+  man3/pvmfunpack.3
+ 
+ if [ $M = 0 ] ; then
+ 	exit 0
+ fi
+ 
+ echo "making links..."
+ ln man3/libpvm.3 man3/libfpvm.3
+ ln man3/pvm_setmwid.3 man3/pvm_getmwid.3
+ ln man3/pvm_settmask.3 man3/pvm_gettmask.3
+ ln man3/pvm_pack.3 man3/pvm_packf.3
+ ln man3/pvm_pack.3 man3/pvm_pkbyte.3
+ ln man3/pvm_pack.3 man3/pvm_pkcplx.3
+ ln man3/pvm_pack.3 man3/pvm_pkdcplx.3
+ ln man3/pvm_pack.3 man3/pvm_pkdouble.3
+ ln man3/pvm_pack.3 man3/pvm_pkfloat.3
+ ln man3/pvm_pack.3 man3/pvm_pkint.3
+ ln man3/pvm_pack.3 man3/pvm_pklong.3
+ ln man3/pvm_pack.3 man3/pvm_pkshort.3
+ ln man3/pvm_pack.3 man3/pvm_pkstr.3
+ ln man3/pvm_pack.3 man3/pvm_pkuint.3
+ ln man3/pvm_pack.3 man3/pvm_pkulong.3
+ ln man3/pvm_pack.3 man3/pvm_pkushort.3
+ ln man3/pvm_unpack.3 man3/pvm_unpackf.3
+ ln man3/pvm_unpack.3 man3/pvm_upkbyte.3
+ ln man3/pvm_unpack.3 man3/pvm_upkcplx.3
+ ln man3/pvm_unpack.3 man3/pvm_upkdcplx.3
+ ln man3/pvm_unpack.3 man3/pvm_upkdouble.3
+ ln man3/pvm_unpack.3 man3/pvm_upkfloat.3
+ ln man3/pvm_unpack.3 man3/pvm_upkint.3
+ ln man3/pvm_unpack.3 man3/pvm_upklong.3
+ ln man3/pvm_unpack.3 man3/pvm_upkshort.3
+ ln man3/pvm_unpack.3 man3/pvm_upkstr.3
+ ln man3/pvm_unpack.3 man3/pvm_upkuint.3
+ ln man3/pvm_unpack.3 man3/pvm_upkulong.3
+ ln man3/pvm_unpack.3 man3/pvm_upkushort.3
+ ln man3/pvm_addhosts.3 man3/pvmfaddhost.3
+ ln man3/pvm_advise.3 man3/pvmfadvise.3
+ ln man3/pvm_archcode.3 man3/pvmfarchcode.3
+ ln man3/pvm_barrier.3 man3/pvmfbarrier.3
+ ln man3/pvm_bcast.3 man3/pvmfbcast.3
+ ln man3/pvm_bufinfo.3 man3/pvmfbufinfo.3
+ ln man3/pvm_catchout.3 man3/pvmfcatchout.3
+ ln man3/pvm_config.3 man3/pvmfconfig.3
+ ln man3/pvm_delhosts.3 man3/pvmfdelhost.3
+ ln man3/pvm_exit.3 man3/pvmfexit.3
+ ln man3/pvm_freebuf.3 man3/pvmffreebuf.3
+ ln man3/pvm_gather.3 man3/pvmfgather.3
+ ln man3/pvm_getinst.3 man3/pvmfgetinst.3
+ ln man3/pvm_getopt.3 man3/pvmfgetopt.3
+ ln man3/pvm_getrbuf.3 man3/pvmfgetrbuf.3
+ ln man3/pvm_getsbuf.3 man3/pvmfgetsbuf.3
+ ln man3/pvm_gettid.3 man3/pvmfgettid.3
+ ln man3/pvm_gsize.3 man3/pvmfgsize.3
+ ln man3/pvm_halt.3 man3/pvmfhalt.3
+ ln man3/pvm_hostsync.3 man3/pvmfhostsync.3
+ ln man3/pvm_initsend.3 man3/pvmfinitsend.3
+ ln man3/pvm_joingroup.3 man3/pvmfjoingrp.3
+ ln man3/pvm_kill.3 man3/pvmfkill.3
+ ln man3/pvm_lvgroup.3 man3/pvmflvgrp.3
+ ln man3/pvm_mcast.3 man3/pvmfmcast.3
+ ln man3/pvm_mkbuf.3 man3/pvmfmkbuf.3
+ ln man3/pvm_mstat.3 man3/pvmfmstat.3
+ ln man3/pvm_mytid.3 man3/pvmfmytid.3
+ ln man3/pvm_notify.3 man3/pvmfnotify.3
+ ln man3/pvm_nrecv.3 man3/pvmfnrecv.3
+ ln man3/pvm_pack.3 man3/pvmfpack.3
+ ln man3/pvm_parent.3 man3/pvmfparent.3
+ ln man3/pvm_perror.3 man3/pvmfperror.3
+ ln man3/pvm_precv.3 man3/pvmfprecv.3
+ ln man3/pvm_probe.3 man3/pvmfprobe.3
+ ln man3/pvm_psend.3 man3/pvmfpsend.3
+ ln man3/pvm_pstat.3 man3/pvmfpstat.3
+ ln man3/pvm_recv.3 man3/pvmfrecv.3
+ ln man3/pvm_reduce.3 man3/pvmfreduce.3
+ ln man3/pvm_scatter.3 man3/pvmfscatter.3
+ ln man3/pvm_send.3 man3/pvmfsend.3
+ ln man3/pvm_sendsig.3 man3/pvmfsendsig.3
+ ln man3/pvm_serror.3 man3/pvmfserror.3
+ ln man3/pvm_setopt.3 man3/pvmfsetopt.3
+ ln man3/pvm_setrbuf.3 man3/pvmfsetrbuf.3
+ ln man3/pvm_setsbuf.3 man3/pvmfsetsbuf.3
+ ln man3/pvm_spawn.3 man3/pvmfspawn.3
+ ln man3/pvm_tasks.3 man3/pvmftasks.3
+ ln man3/pvm_tidtohost.3 man3/pvmftidtoh.3
+ ln man3/pvm_trecv.3 man3/pvmftrecv.3
+ ln man3/pvm_unpack.3 man3/pvmfunpack.3
+ 
+ exit 0
+ 
*** ../netlib/pvm3.3.4/patches/Contents	Sun Sep  4 16:25:29 1994
--- patches/Contents	Wed Nov  9 10:52:43 1994
***************
*** 1,3 ****
--- 1,155 ----
+ patch #5
+ version:
+     3.3.4 -> 3.3.5
+ files:
+     patch  src/patchlevel.h
+     patch  Makefile
+     patch  Readme
+     patch  Readme.mp
+     patch  conf/LINUX.def
+     create conf/SCO.def
+     create conf/SGI64.def
+     create conf/SGI64.m4
+     create conf/SGIMP64.def
+     create conf/SGIMP64.m4
+     patch  conf/SUNMP.def
+     create conf/SX3.def
+     create conf/SX3.m4
+     patch  conf/UXPM.def
+     create console/SGIMP64/Makefile
+     patch  console/cmds.c
+     patch  console/cons.c
+     patch  console/myalloc.h
+     patch  doc/arches
+     patch  examples/CUBE/Makefile
+     patch  examples/Makefile.aimk
+     patch  examples/Readme
+     patch  examples/SGIMP/Makefile
+     create examples/SGIMP64/Makefile
+     patch  examples/SUNMP/Makefile
+     patch  examples/gexample.c
+     patch  examples/hello.c
+     patch  examples/hello_other.c
+     patch  examples/hitc_slave.f
+     patch  examples/nntime.c
+     patch  examples/testall.f
+     patch  examples/timing_slave.c
+     patch  gexamples/Makefile
+     create gexamples/Makefile.aimk
+     create gexamples/frsg.f
+     create gexamples/trsg.c
+     patch  include/fpvm3.h
+     patch  include/pvm3.h
+     patch  lib/pvmd
+     patch  lib/pvmgetarch
+     patch  libfpvm/CSPP/Makefile
+     patch  libfpvm/CUBE/Makefile
+     patch  libfpvm/HPPA/Makefile
+     patch  libfpvm/I860/Makefile
+     patch  libfpvm/Makefile.aimk
+     patch  libfpvm/Makefile.mimd
+     patch  libfpvm/POWER4/Makefile
+     patch  libfpvm/RS6K/Makefile
+     patch  man/man1/pvm_intro.1
+     patch  man/man3/libpvm.3
+     patch  man/man3/pvm_config.3
+     patch  man/man3/pvm_gather.3
+     patch  man/man3/pvm_mcast.3
+     patch  man/man3/pvm_pack.3
+     patch  man/man3/pvm_precv.3
+     patch  man/man3/pvm_psend.3
+     patch  man/man3/pvm_reduce.3
+     patch  man/man3/pvm_scatter.3
+     patch  man/man3/pvm_send.3
+     patch  man/man3/pvm_start_pvmd.3
+     patch  man/man3/pvm_tasks.3
+     patch  man/man3/pvm_tidtohost.3
+     patch  man/man3/pvm_unpack.3
+     create man/mkmanlinks
+     patch  patches/Contents
+     patch  pvmgs/Makefile.aimk
+     patch  pvmgs/Makefile.mimd
+     create pvmgs/PGON/Makefile
+     patch  pvmgs/pvm_gstat.c
+     patch  pvmgs/pvm_gsulib.c
+     patch  src/ALPHAMP/Makefile
+     patch  src/CM5/Makefile
+     patch  src/CM5/pvmhost.c
+     patch  src/CUBE/Makefile
+     patch  src/I860/Makefile
+     patch  src/I860/pvmdmimd.c
+     patch  src/Makefile.aimk
+     patch  src/Makefile.shmem
+     patch  src/PGON/Makefile
+     patch  src/PGON/pvmdmimd.c
+     patch  src/SGIMP/Makefile
+     create src/SGIMP64/Makefile
+     patch  src/SUNMP/Makefile
+     patch  src/ddpro.c
+     patch  src/global.h
+     patch  src/host.c
+     patch  src/imalloc.c
+     patch  src/lpvm.c
+     patch  src/lpvmcat.c
+     patch  src/lpvmgen.c
+     patch  src/lpvmmimd.c
+     patch  src/lpvmpack.c
+     patch  src/lpvmshmem.c
+     patch  src/pvmarchc.c
+     patch  src/pvmcruft.c
+     patch  src/pvmd.c
+     patch  src/pvmdshmem.c
+     patch  src/pvmmimd.h
+     patch  src/pvmshmem.c
+     patch  src/pvmshmem.h
+     patch  src/sdpro.c
+     patch  src/startup.c
+     patch  src/task.c
+     patch  src/task.h
+     patch  src/tdpro.c
+     patch  tasker/tasker.c
+     patch  xep/xep.c
+ what:
+     + made mkmanlinks script to make links for remaining fortran and
+       c functions.
+     + improved reduce function man pages, created new examples.
+     + added SGI64, SGIMP64 port (IRIX 6.0, 64-bit).
+     + added SX3 (NEC SX-3) architecture.
+     + added SCO (SCO Unix) architecture.
+     . warn that strings cannot be packed with DataInPlace encoding.
+     . ranlib libraries after installing.
+     . many patches to shared-memory transport code.
+     . pvmd must check that deleted hosts aren't in new host table.
+     . pvm_trecv() no longer hangs ignoring timeout after a signal is received.
+     . pvmclaimo() no longer coredumps if task gets TC_OUPUT message that
+       it didn't expect.
+     . pvm_spawn now checks count for system error code in return message.
+     . console checkmsgs() shouldn't compare message src to 0x80000000.
+     . group library disables output collection and tracing while spawning
+       group server, so it isn't traced as part of the application.
+     . pvm_gstat now prints a message if there are no groups.
+     . use PVM_FREE instead of free in iflist().
+     . TEV_BCAST1 message now includes a list of tids.
+     . clean up pvmd beprime().
+     . added TF_FORKD flag letting pvmd wait for exit of children to get status.
+     . cast message tags, e.g. TM_FIRST, so compiler doesn't complain.
+     . LINUX.def - remove -DNOSOCKOPT
+     . remove CC=gcc from SUNMP makefiles.
+     . pvmgetarch calls mpstat with full path /bin/mpstat.
+     . UXPM architecture has rsh path set to /usr/bin/rsh.
+     . fixed Readme.mp - used old architecture names.
+     . put warning in psend, precv man pages that they can't be mixed with
+       regular send on certain machines (multiprocessors).
+     . put warning in the pvm_send() man page about calling pvm_exit().
+     . pack manpage declares that packing %s as NULL is not allowed.
+     . made pvm_config man page more clear.
+     . corrected syntax in fortran example in pvm_unpack man page.
+     . tasker example needed fds=rfds; before select().
+     . fixed examples/hitc_slave.f.
+     . call pvm_freebuf in examples/timing_slave.c - unfreed buffer causes
+       shared-memory transport to hang when slave is killed.
+     . xep paints processor id bars darker on b&w display.
+     . console "ps" flags display now takes up less space.
  patch #4
  version:
      3.3.3 -> 3.3.4
*** ../netlib/pvm3.3.4/pvmgs/Makefile.aimk	Wed Sep 22 14:06:10 1993
--- pvmgs/Makefile.aimk	Tue Nov  8 15:56:30 1994
***************
*** 29,34 ****
--- 29,35 ----
  install: pvmgs libgpvm3.a pvm_gstat $(PVMXDIR) $(PVMLDIR)
  	cp pvmgs $(PVMXDIR)
  	cp pvmgs pvm_gstat libgpvm3.a $(PVMLDIR)
+ 	case x$(HASRANLIB) in xt ) echo ranlib; ranlib $(PVMLDIR)/libgpvm3.a ;; esac
  
  $(PVMXDIR):
  	- mkdir $(PVMBDIR)
*** ../netlib/pvm3.3.4/pvmgs/Makefile.mimd	Tue May 10 15:44:09 1994
--- pvmgs/Makefile.mimd	Tue Nov  8 15:56:48 1994
***************
*** 27,35 ****
  
  all:	pvmgs libgpvm3.a pvm_gstat
  
! install: pvmgs libgpvm3.a pvm_gstat $(PVMBDIR) $(PVMLDIR)
  	cp pvmgs $(PVMXDIR)
  	cp pvmgs pvm_gstat libgpvm3.a $(PVMLDIR)
  
  $(PVMXDIR):
  	- mkdir $(PVMBDIR)
--- 27,36 ----
  
  all:	pvmgs libgpvm3.a pvm_gstat
  
! install: pvmgs libgpvm3.a pvm_gstat $(PVMXDIR) $(PVMLDIR)
  	cp pvmgs $(PVMXDIR)
  	cp pvmgs pvm_gstat libgpvm3.a $(PVMLDIR)
+ 	case x$(HASRANLIB) in xt ) echo ranlib; ranlib $(PVMLDIR)/libgpvm3.a ;; esac
  
  $(PVMXDIR):
  	- mkdir $(PVMBDIR)
*** /dev/null	Wed Nov  9 10:53:55 1994
--- pvmgs/PGON/Makefile	Mon Nov  7 12:02:37 1994
***************
*** 0 ****
--- 1,15 ----
+ PVM_ARCH	=	PGON
+ #CONFFILE	=	$(PVM_ROOT)/conf/$(PVM_ARCH).def
+ CONFFILE	=	$(PVM_ROOT)/conf/PGON.def
+ LIBDIR		=	$(PVM_ROOT)/lib/$(PVM_ARCH)
+ #
+ install:	default $(LIBDIR)
+ 		
+ default:    
+ 	make -f $(CONFFILE) -f ../Makefile.mimd install
+ 
+ clean:
+ 	make -f $(CONFFILE) -f ../Makefile.mimd clean
+ 	
+ $(LIBDIR):
+ 	mkdir $(LIBDIR)
*** ../netlib/pvm3.3.4/pvmgs/pvm_gstat.c	Tue May 24 15:33:18 1994
--- pvmgs/pvm_gstat.c	Mon Oct 17 09:45:20 1994
***************
*** 37,42 ****
--- 37,44 ----
  	pvm_recv(gstid, GSLS);
  	/* get the number of groups */
  	pvm_upkint(&ng, 1, 1);
+ 	if (ng == 0)
+ 		fprintf(stdout, "no groups exist\n");
  	for (i = 0; i < ng; i++) {
                  pvm_upkint(&g.len,1,1);
                  NEWMEMGNAME(g.len+ 1,mxupklen,g.name);
*** ../netlib/pvm3.3.4/pvmgs/pvm_gsulib.c	Fri May  6 11:42:44 1994
--- pvmgs/pvm_gsulib.c	Mon Nov  7 16:10:09 1994
***************
*** 3,8 ****
--- 3,21 ----
   *
   *	Group server user library routines
   *
+ $Log: pvm_gsulib.c,v $
+  * Revision 1.4  1994/11/07  21:09:38  manchek
+  * include stdlib if available.
+  * function prototypes for SCO.
+  * remove spurious breaks after returns
+  *
+  * Revision 1.3  1994/10/15  21:57:34  manchek
+  * disable output collection and tracing while spawning group server
+  *
+  * Revision 1.2  1994/10/15  18:53:48  manchek
+  * added tids to BCAST1 trace message
+  *
+  *
   *	05 Mar 1993	Adam Beguelin adamb@cs.cmu.edu
   *	05 Mar 1993	Fixed malloc() in pvm_bcast()
   *	05 Mar 1993	pvm_barrier now returns 0 or an error
***************
*** 17,22 ****
--- 30,38 ----
   */
  
  
+ #ifdef HASSTDLIB
+ #include <stdlib.h>
+ #endif
  #include <stdio.h>
  #include "pvm3.h"
  #include "pvmgdef.h"
***************
*** 40,51 ****
  gs_getgstid()
  {
  	int info;
!         if (gstid >= 0) return (gstid);
  	info = pvm_lookup(GSNAME, 0, &gstid);
  	/* if it's not there */
  	if (info == PvmNoEntry) {
  		info = pvm_spawn("pvmgs", (char **)0, PvmMppFront,
  				(char *)0, 1, &gstid);
  		if (info != 1) {
  			if (info == 0 && gstid < 0) {
  				pvm_errno = gstid;
--- 56,74 ----
  gs_getgstid()
  {
  	int info;
! 	int otid, ttid;
! 
! 	if (gstid >= 0) return (gstid);
  	info = pvm_lookup(GSNAME, 0, &gstid);
  	/* if it's not there */
  	if (info == PvmNoEntry) {
+ 
+ 		otid = pvm_setopt(PvmOutputTid, 0);
+ 		ttid = pvm_setopt(PvmTraceTid, 0);
  		info = pvm_spawn("pvmgs", (char **)0, PvmMppFront,
  				(char *)0, 1, &gstid);
+ 		pvm_setopt(PvmOutputTid, otid);
+ 		pvm_setopt(PvmTraceTid, ttid);
  		if (info != 1) {
  			if (info == 0 && gstid < 0) {
  				pvm_errno = gstid;
***************
*** 478,494 ****
  		cc = 0;
  
  done:
! 	if (tids) free(tids);
!         if (cc < 0) pvm_errno = cc;
  
  	if (x) {
  		if (TEV_DO_TRACE(TEV_BCAST1)) {
  			pvm_pkint(&cc, 1, 1);
  			TEV_FIN;
  		}
  		pvmtoplvl = 1;
  	}
  
  	return(cc);
  }
  
--- 501,528 ----
  		cc = 0;
  
  done:
! 	if (cc < 0)
! 		pvm_errno = cc;
  
  	if (x) {
  		if (TEV_DO_TRACE(TEV_BCAST1)) {
  			pvm_pkint(&cc, 1, 1);
+ 			if (cc < 0) {
+ 				ntids = -1;
+ 				pvm_pkint(&ntids, 1, 1);
+ 
+ 			} else {
+ 				pvm_pkint(&ntids, 1, 1);
+ 				pvm_pkint(tids, ntids, 1);
+ 			}
  			TEV_FIN;
  		}
  		pvmtoplvl = 1;
  	}
  
+ 	if (tids)
+ 		free(tids);
+ 
  	return(cc);
  }
  
***************
*** 602,608 ****
--- 636,646 ----
  
  int 
  pvm_reduce(func, data, count, datatype, msgtag, gname, rootinst)
+ #ifdef	IMA_SCO
+      void (*func)(int*, void*, void*, int*, int*);
+ #else
       void (*func)();
+ #endif
       void *data;
       int count, datatype, msgtag, rootinst;
       char *gname; 
***************
*** 829,835 ****
         break;
      default:
         return(PvmBadParam);
-        break;
    }
  
    return(PvmOk);
--- 867,872 ----
***************
*** 948,954 ****
       default:
         *info = PvmBadParam;
         return;
-        break;
    }  /* end switch */
  
   *info = PvmOk;
--- 985,990 ----
***************
*** 1062,1068 ****
       default:
         *info = PvmBadParam;
         return;
-        break;
    }  /* end switch */
  
    *info = PvmOk;
--- 1098,1103 ----
***************
*** 1137,1143 ****
       default:
         *info = PvmBadParam;
         return;
-        break;
    }  /* end switch */
  
    *info = PvmOk;
--- 1172,1177 ----
***************
*** 1222,1228 ****
       default:
         *info = PvmBadParam;
         return;
-        break;
    }  /* end switch */
  
    *info = PvmOk;
--- 1256,1261 ----
***************
*** 1590,1620 ****
      case (PVM_STR):
      case (PVM_BYTE):
        return(sizeof(char));
-       break;
      case (PVM_SHORT):
        return(sizeof(short));
-       break;
      case (PVM_INT):
        return(sizeof(int));
-       break;
      case (PVM_LONG):
        return(sizeof(long));
-       break;
      case (PVM_FLOAT):
        return(sizeof(float));
-       break;
      case (PVM_DOUBLE):
        return(sizeof(double));
-       break;
      case (PVM_CPLX):
        return(2*sizeof(float));
-       break;
      case (PVM_DCPLX):
        return(2*sizeof(double));
-       break;
      default:
        return(PvmBadParam);
-       break;
      }  /* end switch (datatype) */
  
  }  /* end gs_get_datasize() */
--- 1623,1644 ----
*** ../netlib/pvm3.3.4/src/ALPHAMP/Makefile	Fri May 27 10:47:33 1994
--- src/ALPHAMP/Makefile	Tue Nov  8 16:04:32 1994
***************
*** 4,9 ****
--- 4,10 ----
  #
  install:	default $(LIBDIR)
  	mv pvmd3 libpvm3.a libpvm3s.a $(LIBDIR)
+ 	case x$(HASRANLIB) in xt ) echo ranlib; ranlib $(LIBDIR)/libpvm3.a ; ranlib $(LIBDIR)/libpvm3s.a ;; esac
  		
  default:    
  	make -f $(CONFFILE) -f ../Makefile.shmem pvmd3 libpvm3.a libpvm3s.a
*** ../netlib/pvm3.3.4/src/CM5/Makefile	Mon Aug 30 19:35:27 1993
--- src/CM5/Makefile	Tue Nov  8 16:05:16 1994
***************
*** 4,9 ****
--- 4,10 ----
  #
  install:	default $(LIBDIR)
  	mv pvmd3 libpvm3.a libpvm3pe.a pvmhost.o $(LIBDIR)
+ 	case x$(HASRANLIB) in xt ) echo ranlib; ranlib $(LIBDIR)/libpvm3.a ; ranlib $(LIBDIR)/libpvm3pe.a ;; esac
  		
  default:    
  	make -f $(CONFFILE) -f ../Makefile.mimd -f Makefile.cm5 \
*** ../netlib/pvm3.3.4/src/CM5/pvmhost.c	Fri Jun  3 16:54:29 1994
--- src/CM5/pvmhost.c	Wed Nov  9 09:26:09 1994
***************
*** 38,43 ****
--- 38,50 ----
   * 		changed mc_dsts[] to short from int.
   *
  $Log: pvmhost.c,v $
+  * Revision 1.5  1994/11/09  14:26:05  manchek
+  * more mpp fixes
+  *
+  * Revision 1.4  1994/11/07  21:15:30  manchek
+  * Send a null packet to alert precv().
+  * Handle DataInPlace properly
+  *
   * Revision 1.3  1994/06/03  20:54:29  manchek
   * version 3.3.0
   *
***************
*** 78,84 ****
  extern int pvmmyndf;
  extern int pvmtidhmask;
  
! static char rcsid[] = "$Id: pvmhost.c,v 1.3 1994/06/03 20:54:29 manchek Exp $";
  static char etext[512];         /* scratch for error log */
  static int tidnmask = TIDNODE;
  static int tidtmask = TIDPTYPE;
--- 85,91 ----
  extern int pvmmyndf;
  extern int pvmtidhmask;
  
! static char rcsid[] = "$Id: pvmhost.c,v 1.5 1994/11/09 14:26:05 manchek Exp $";
  static char etext[512];         /* scratch for error log */
  static int tidnmask = TIDNODE;
  static int tidtmask = TIDPTYPE;
***************
*** 95,104 ****
  	struct timeval tout;
  	int *socks;
  	int	dsock;					/* pvmd socket */
! 	struct frag *frpvmd = 0;	/* frag from pvmd */
! 	struct frag *topvmd = 0;	/* frag to pvmd */
! 	struct frag *frtask = 0;	/* frag from task */
! 	struct frag *totask;		/* frag being sent to task */
  	char *txcp = 0;             /* point to remainder of topvmd */
      int txtogo = 0;             /* len of remainder of topvmd */
  	int toread;					/* number of bytes to be read from pvmd */
--- 102,111 ----
  	struct timeval tout;
  	int *socks;
  	int	dsock;					/* pvmd socket */
! 	struct frag *frpvmd = 0;	/* (small) frag from pvmd */
! 	struct frag *topvmd = 0;	/* (big) frag to pvmd */
! 	struct frag *frtask = 0;	/* (big) frag from task */
! 	struct frag *totask;		/* (small) frag being sent to task */
  	char *txcp = 0;             /* point to remainder of topvmd */
      int txtogo = 0;             /* len of remainder of topvmd */
  	int toread;					/* number of bytes to be read from pvmd */
***************
*** 105,112 ****
--- 112,121 ----
  	int frtogo;					/* len of remainder of a fragment */
  	int topvmd_dst;				/* dst of fragment being sent to pvmd */ 
  	int topvmd_src;				/* src of fragment being sent to pvmd */
+ 	int len;
  	int topvmd_ff;				/* ff of fragment being sent to pvmd */
  	int	dst;					/* dst of fragment being sent to node */
+ 	int	node;					/* node number */
  	CMMD_mcb rmid;				/* msg IDs returned by async recv */
  	int n;
  	int typepart = TIDONNODE;
***************
*** 162,173 ****
  sprintf(etext, "pvmhost: recv %d", txtogo);
  pvmlogerror(etext);
  */
  			frtask = fr_new(MAXFRAGSIZE);
  			/* ready for the next message */
  			CMMD_free_mcb(rmid);
  			rmid = ASYNCRECV(frtask->fr_dat, frtask->fr_max);
  			FD_SET(dsock, &wrk_wfds);
- 			txcp = topvmd->fr_dat;
  			topvmd_dst = pvmget32(txcp);
  			topvmd_src = pvmget32(txcp + 4);
  			topvmd_ff = pvmget8(txcp + 12);
--- 171,196 ----
  sprintf(etext, "pvmhost: recv %d", txtogo);
  pvmlogerror(etext);
  */
+ 			txcp = topvmd->fr_dat;
+ 			if ((len = pvmget32(txcp + 8) + TDFRAGHDR) != txtogo) {
+ 			/* inplace data, head & body sent separately */
+ 
+ 				if (len > MAXFRAGSIZE) {
+ 					struct frag *hdr = topvmd;
+ 					
+ 					topvmd = fr_new(len);
+ 					BCOPY(hdr->fr_dat, topvmd->fr_dat, txtogo);
+ 					fr_unref(hdr);
+ 				}
+ 				CMMD_receive_block(CMMD_mcb_source(rmid), CMMD_ANY_TAG,
+ 				topvmd->fr_dat + txtogo, len - txtogo);
+ 				txtogo = len;
+ 			}
  			frtask = fr_new(MAXFRAGSIZE);
  			/* ready for the next message */
  			CMMD_free_mcb(rmid);
  			rmid = ASYNCRECV(frtask->fr_dat, frtask->fr_max);
  			FD_SET(dsock, &wrk_wfds);
  			topvmd_dst = pvmget32(txcp);
  			topvmd_src = pvmget32(txcp + 4);
  			topvmd_ff = pvmget8(txcp + 12);
***************
*** 218,224 ****
  			}
  
  			dst = pvmget32(frpvmd->fr_dat);
! 			while (CMMD_send_noblock(dst & tidnmask, PMTDN, frpvmd->fr_dat,
  			frpvmd->fr_len) == CMMD_ERRVAL) {
  				sprintf(etext, "pvmhost: can't send to t%x", dst);
  				pvmlogperror(etext);
--- 241,254 ----
  			}
  
  			dst = pvmget32(frpvmd->fr_dat);
! 			node = dst & tidnmask;
! 			/* inform precv/recv of a packed message */
! 			while (CMMD_send_noblock(node, PMTPACK, &node, 0) == CMMD_ERRVAL) {
! 				sprintf(etext, "pvmhost: can't send null msg to t%x", dst);
! 				pvmlogperror(etext);
! 				CMMD_poll_for_services();
! 			}
! 			while (CMMD_send_noblock(node, PMTPACK, frpvmd->fr_dat,
  			frpvmd->fr_len) == CMMD_ERRVAL) {
  				sprintf(etext, "pvmhost: can't send to t%x", dst);
  				pvmlogperror(etext);
***************
*** 252,257 ****
--- 282,288 ----
  					txcp -= TDFRAGHDR;
  					txtogo += TDFRAGHDR;
  					if (txtogo > pvmudpmtu)
+ 					/* big frag needs to be broken up */
  						frtogo = pvmudpmtu;
  					else {
  						frtogo = txtogo;
***************
*** 280,290 ****
   * make ntask copies of multicast fragment and send them to the nodes
   * listed in tids[]
   */
  cm_mcast(fp, nodes, ntask, tidpart)
! 	struct frag *fp;	/* fragment to send */
! 	short nodes[];		/* targets */
! 	int ntask;			/* how many of them */
! 	int tidpart;		/* hostpart + typepart */
  {
  	int i;
  	char *cp = fp->fr_dat;
--- 311,322 ----
   * make ntask copies of multicast fragment and send them to the nodes
   * listed in tids[]
   */
+ /*
  cm_mcast(fp, nodes, ntask, tidpart)
! 	struct frag *fp;	* fragment to send *
! 	short nodes[];		* targets *
! 	int ntask;			* how many of them *
! 	int tidpart;		* hostpart + typepart *
  {
  	int i;
  	char *cp = fp->fr_dat;
***************
*** 293,299 ****
  	for (i = 0; i < ntask; i++) {
  		dst = tidpart + nodes[i];
  		pvmput32(cp, dst);
! 		while (CMMD_send_noblock(nodes[i], PMTDN, fp->fr_dat,
  		fp->fr_len) == CMMD_ERRVAL) {
  			sprintf(etext, "pvmhost: cm_mcast() can't send to t%x", dst);
  			pvmlogperror(etext);
--- 325,331 ----
  	for (i = 0; i < ntask; i++) {
  		dst = tidpart + nodes[i];
  		pvmput32(cp, dst);
! 		while (CMMD_send_noblock(nodes[i], PMTPACK, fp->fr_dat,
  		fp->fr_len) == CMMD_ERRVAL) {
  			sprintf(etext, "pvmhost: cm_mcast() can't send to t%x", dst);
  			pvmlogperror(etext);
***************
*** 301,303 ****
--- 333,336 ----
  		}
  	}
  }
+ */
*** ../netlib/pvm3.3.4/src/CUBE/Makefile	Mon Dec 20 10:33:21 1993
--- src/CUBE/Makefile	Tue Nov  8 16:05:47 1994
***************
*** 4,9 ****
--- 4,10 ----
  #
  install:	default $(LIBDIR)
  	mv libpvm3pe.a $(LIBDIR)
+ 	case x$(HASRANLIB) in xt ) echo ranlib; ranlib $(LIBDIR)/libpvm3pe.a ;; esac
  		
  default:    
  	make PVM_ARCH=I860 -f $(CONFFILE) -f ../Makefile.mimd libpvm3pe.a 
*** ../netlib/pvm3.3.4/src/I860/Makefile	Mon Aug 30 19:35:58 1993
--- src/I860/Makefile	Tue Nov  8 16:06:06 1994
***************
*** 5,10 ****
--- 5,11 ----
  #
  install:	default $(LIBDIR)
  	mv pvmd3 libpvm3.a $(LIBDIR)
+ 	case x$(HASRANLIB) in xt ) echo ranlib; ranlib $(LIBDIR)/libpvm3.a ;; esac
  		
  default:    
  	make -f $(CONFFILE) -f ../Makefile.mimd pvmd3 libpvm3.a 
*** ../netlib/pvm3.3.4/src/I860/pvmdmimd.c	Fri Jun  3 16:54:44 1994
--- src/I860/pvmdmimd.c	Mon Nov  7 16:21:43 1994
***************
*** 38,43 ****
--- 38,47 ----
   *		deleted loclinput(), and merged loclinpkt() into pvmd.c
   *
  $Log: pvmdmimd.c,v $
+  * 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()
+  *
   * Revision 1.3  1994/06/03  20:54:44  manchek
   * version 3.3.0
   *
***************
*** 113,119 ****
  
  /* private */
  
! static char rcsid[] = "$Id: pvmdmimd.c,v 1.3 1994/06/03 20:54:44 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 */
--- 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 */
***************
*** 320,332 ****
  	pp->pk_dat += hdrdiff;
  	if (_crecv(-1, pp->pk_dat, (long)len) < 0)
  		pvmlogperror("mpp_input() crecv");
! 	else
  	loclinpkt(0, pp);
  }
  
  
  /* use csend() to multicast */
! /* XXX cannot mcast to multiple cubes or tasks running on frontend */
  int
  mpp_mcast(pp, tids, ntask)
  	struct pkt *pp;	/* packet to send */
--- 324,355 ----
  	pp->pk_dat += hdrdiff;
  	if (_crecv(-1, pp->pk_dat, (long)len) < 0)
  		pvmlogperror("mpp_input() crecv");
! 	else {
! 		cp = pp->pk_dat;
! 		if ((len = pvmget32(cp + 8) + TDFRAGHDR) != pp->pk_len) {
! 			struct pkt *hdr;
! 
! 			/* inplace frag, head & body sent separately */
! 			hdr = pp;
! 			pp = pk_new(len + hdrdiff);
! 			pp->pk_dat += hdrdiff;
! 			BCOPY(hdr->pk_dat, pp->pk_dat, hdr->pk_len);
! 			pp->pk_len = len;
! 			/* type is virtual node number */
! 			if (_crecv(_infonode(), pp->pk_dat + hdr->pk_len,
! 			(long)(len - hdr->pk_len)) < 0) {
! 				pvmlogperror("mpp_input() crecv body");
! 				return;
! 			}
! 			pk_free(hdr);
! 		}
  	loclinpkt(0, pp);
  }
+ }
  
  
  /* use csend() to multicast */
! /* XXX cannot mcast to multiple cubes */
  int
  mpp_mcast(pp, tids, ntask)
  	struct pkt *pp;	/* packet to send */
***************
*** 336,366 ****
  	int i;
  	int count = 0;
  	struct nodeset *sp;
! 	short cid;
  	int cubepart;
  	long *nodes = 0;
  	char *cp;
  
- 	cid = TIDTOTYPE(tids[0]);
- 	for (sp = busynodes->n_link; sp != busynodes; sp = sp->n_link)
- 		if (sp->n_cid == cid) {
- 			if (cid != qm_cubeid &&
- 			(_attachcube(sp->n_name) < 0 || _setpid(PVMDPTYPE) < 0))
- 				pvmlogperror("mpp_output() attachcube/setpid");
- 			break;
- 		}
- 	if (sp == busynodes) {
- 		sprintf(etext, "mpp_mcast() pkt from t%x scrapped (no cube)\n", 
- 		pp->pk_src);
- 		pvmlogerror(etext);
- 		return -1;
- 	}
- 
- 	cubepart = tids[0] & tidtmask;
  	nodes = TALLOC(ntask, long, "nodes");
  	for (i = 0; i < ntask; i++) {
  		if ((tids[i] & tidtmask) != cubepart 
  				|| (tids[i] & tidhmask) != myhostpart)
  			continue;
          if (!TIDISNODE(tids[i])) {      /* Arrrgh!!! */
              struct pkt *pp2;
--- 359,376 ----
  	int i;
  	int count = 0;
  	struct nodeset *sp;
! 	short cid = -1;
  	int cubepart;
  	long *nodes = 0;
  	char *cp;
  
  	nodes = TALLOC(ntask, long, "nodes");
  	for (i = 0; i < ntask; i++) {
+ /*
  		if ((tids[i] & tidtmask) != cubepart 
  				|| (tids[i] & tidhmask) != myhostpart)
+ */
+ 		if ((tids[i] & tidhmask) != myhostpart)
  			continue;
          if (!TIDISNODE(tids[i])) {      /* Arrrgh!!! */
              struct pkt *pp2;
***************
*** 380,387 ****
--- 390,417 ----
              }
  			continue;
  		}
+ 		if (cid == -1) {
+ 			cid = TIDTOTYPE(tids[i]);
+ 			cubepart = tids[i] & tidtmask;
+ 		}
+ 		if (cid != TIDTOTYPE(tids[i]))
+ 			pvmlogerror("mpp_mcast(): multiple cubes? Not implemented ...\n");
  		nodes[count++] = tids[i] & tidnmask;
  	}
+ 	for (sp = busynodes->n_link; sp != busynodes; sp = sp->n_link)
+ 		if (sp->n_cid == cid) {
+ 			if (cid != qm_cubeid &&
+ 			(_attachcube(sp->n_name) < 0 || _setpid(PVMDPTYPE) < 0))
+ 				pvmlogperror("mpp_output() attachcube/setpid");
+ 			break;
+ 		}
+ 	if (sp == busynodes) {
+ 		sprintf(etext, "mpp_mcast() pkt from t%x scrapped (no cube)\n", 
+ 		pp->pk_src);
+ 		pvmlogerror(etext);
+ 		return -1;
+ 	}
+ 
  	if (count) {
  		cp = (pp->pk_dat -= TDFRAGHDR);
          pvmput32(cp, pp->pk_dst);
***************
*** 390,400 ****
          pvmput8(cp + 12, pp->pk_flag & (FFSOM|FFEOM));
          pp->pk_len += TDFRAGHDR;
  		if (count == sp->n_size && count == (1 << (ffs(count) - 1))) {
! 			if (_csend(PMTMCAST, pp->pk_dat, (long)pp->pk_len, -1, 0) < 0)
  				pvmlogperror("mpp_mcast() global csend");
  		} else {
  			for (i = 0; i < count; i++)
! 				if (_csend(PMTMCAST, pp->pk_dat, (long)pp->pk_len, nodes[i], 0)
  						< 0)
  					pvmlogperror("mpp_mcast() csend");
  		}
--- 420,430 ----
          pvmput8(cp + 12, pp->pk_flag & (FFSOM|FFEOM));
          pp->pk_len += TDFRAGHDR;
  		if (count == sp->n_size && count == (1 << (ffs(count) - 1))) {
! 			if (_csend(PMTPACK, pp->pk_dat, (long)pp->pk_len, -1, 0) < 0)
  				pvmlogperror("mpp_mcast() global csend");
  		} else {
  			for (i = 0; i < count; i++)
! 				if (_csend(PMTPACK, pp->pk_dat, (long)pp->pk_len, nodes[i], 0)
  						< 0)
  					pvmlogperror("mpp_mcast() csend");
  		}
***************
*** 458,464 ****
  			outpkt = 0;
  		}
  	}
! 	if ((isendmid = _isend(PMTDN, cp, (long)pp->pk_len, node, 0)) < 0) {
  		sprintf(etext,"mpp_output() can't send to t%x", tp->t_tid);
  		pvmlogperror(etext);
  		pk_free(pp);
--- 488,494 ----
  			outpkt = 0;
  		}
  	}
! 	if ((isendmid = _isend(PMTPACK, cp, (long)pp->pk_len, node, 0)) < 0) {
  		sprintf(etext,"mpp_output() can't send to t%x", tp->t_tid);
  		pvmlogperror(etext);
  		pk_free(pp);
*** ../netlib/pvm3.3.4/src/Makefile.aimk	Mon Jul 18 16:06:46 1994
--- src/Makefile.aimk	Tue Nov  8 15:57:09 1994
***************
*** 58,63 ****
--- 58,64 ----
  
  install:	pvmd3 libpvm3.a $(LIBDIR)
  	mv libpvm3.a pvmd3 $(LIBDIR)
+ 	case x$(HASRANLIB) in xt ) echo ranlib; ranlib $(LIBDIR)/libpvm3.a ;; esac
  
  $(LIBDIR):
  	- mkdir $(LIBDIR)
*** ../netlib/pvm3.3.4/src/Makefile.shmem	Mon May 16 23:03:13 1994
--- src/Makefile.shmem	Mon Nov  7 16:23:34 1994
***************
*** 24,31 ****
  #
  SHELL	=	/bin/sh
  SDIR	=	..
! #CFLAGS	=	-O -I$(SDIR)/../include -DARCHCLASS=\"$(PVM_ARCH)\" -DIMA_$(PVM_ARCH) -DSHMEM $(ARCHCFLAGS)
! CFLAGS	=	-g -I$(SDIR)/../include -DARCHCLASS=\"$(PVM_ARCH)\" -DIMA_$(PVM_ARCH) -DSHMEM $(ARCHCFLAGS)
  DOBJ	=	ddpro.o pvmfrag.o host.o imalloc.o \
  			mesg.o nmdclass.o pkt.o pvmalloc.o pvmarchc.o pvmcruft.o pvmd.o \
  			pvmlog.o sdpro.o startup.o task.o tdpro.o waitc.o \
--- 24,33 ----
  #
  SHELL	=	/bin/sh
  SDIR	=	..
! OPTIONS	=	-O
! #OPTIONS	=	-g
! #OPTIONS	=	-g -DUSE_PVM_ALLOC -DSTATISTICS -DTIMESTAMPLOG
! CFLAGS	=	$(OPTIONS) -DSHMEM -I$(SDIR)/../include -DARCHCLASS=\"$(PVM_ARCH)\" -DIMA_$(PVM_ARCH) $(ARCHCFLAGS)
  DOBJ	=	ddpro.o pvmfrag.o host.o imalloc.o \
  			mesg.o nmdclass.o pkt.o pvmalloc.o pvmarchc.o pvmcruft.o pvmd.o \
  			pvmlog.o sdpro.o startup.o task.o tdpro.o waitc.o \
***************
*** 78,85 ****
  lpvmcat.o:	$(SDIR)/lpvmcat.c
  	$(CC) $(CFLAGS) -c $(SDIR)/lpvmcat.c
  lpvmshmem.o:	$(SDIR)/lpvmshmem.c
! 	$(CC) $(CFLAGS) -DLOG -c $(SDIR)/lpvmshmem.c
! #	$(CC) $(CFLAGS) -c $(SDIR)/lpvmshmem.c
  lpvmgen.o:	$(SDIR)/lpvmgen.c
  	$(CC) $(CFLAGS) -c $(SDIR)/lpvmgen.c
  lpvmpack.o:	$(SDIR)/lpvmpack.c
--- 80,86 ----
  lpvmcat.o:	$(SDIR)/lpvmcat.c
  	$(CC) $(CFLAGS) -c $(SDIR)/lpvmcat.c
  lpvmshmem.o:	$(SDIR)/lpvmshmem.c
! 	$(CC) $(CFLAGS) -c $(SDIR)/lpvmshmem.c
  lpvmgen.o:	$(SDIR)/lpvmgen.c
  	$(CC) $(CFLAGS) -c $(SDIR)/lpvmgen.c
  lpvmpack.o:	$(SDIR)/lpvmpack.c
***************
*** 101,108 ****
  pvmdabuf.o: $(SDIR)/pvmdabuf.c
  	$(CC) $(CFLAGS) -c $(SDIR)/pvmdabuf.c
  pvmdshmem.o:	$(SDIR)/pvmdshmem.c
! 	$(CC) $(CFLAGS) -DLOG -c $(SDIR)/pvmdshmem.c
! #	$(CC) $(CFLAGS) -c $(SDIR)/pvmdshmem.c
  pvmlog.o:	$(SDIR)/pvmlog.c
  	$(CC) $(CFLAGS) -c $(SDIR)/pvmlog.c
  pvmshmem.o:	$(SDIR)/pvmshmem.c
--- 102,108 ----
  pvmdabuf.o: $(SDIR)/pvmdabuf.c
  	$(CC) $(CFLAGS) -c $(SDIR)/pvmdabuf.c
  pvmdshmem.o:	$(SDIR)/pvmdshmem.c
! 	$(CC) $(CFLAGS) -c $(SDIR)/pvmdshmem.c
  pvmlog.o:	$(SDIR)/pvmlog.c
  	$(CC) $(CFLAGS) -c $(SDIR)/pvmlog.c
  pvmshmem.o:	$(SDIR)/pvmshmem.c
*** ../netlib/pvm3.3.4/src/PGON/Makefile	Mon Aug 30 19:36:14 1993
--- src/PGON/Makefile	Tue Nov  8 16:06:22 1994
***************
*** 4,9 ****
--- 4,10 ----
  #
  install:	default $(LIBDIR)
  	mv pvmd3 libpvm3.a libpvm3pe.a $(LIBDIR)
+ 	case x$(HASRANLIB) in xt ) echo ranlib; ranlib $(LIBDIR)/libpvm3.a ; ranlib $(LIBDIR)/libpvm3pe.a ;; esac
  		
  default:    
  	make -f $(CONFFILE) -f ../Makefile.mimd pvmd3 libpvm3.a libpvm3pe.a 
*** ../netlib/pvm3.3.4/src/PGON/pvmdmimd.c	Fri Jun  3 16:54:53 1994
--- src/PGON/pvmdmimd.c	Mon Nov  7 16:31:16 1994
***************
*** 92,97 ****
--- 92,103 ----
   *      deleted loclinput(), and merged loclinpkt() into pvmd.c
   *
  $Log: pvmdmimd.c,v $
+  * 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.
+  * mpp_new() should return PvmOutOfRes when it runs out of nodes.
+  * Fix a bug in the way ptype is computed in mpp_mcast()
+  *
   * Revision 1.3  1994/06/03  20:54:52  manchek
   * version 3.3.0
   *
***************
*** 156,162 ****
  
  /* private */
  
! static char rcsid[] = "$Id: pvmdmimd.c,v 1.3 1994/06/03 20:54:52 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 */
--- 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 */
***************
*** 233,238 ****
--- 239,246 ----
  			}
  		}
  	}
+ 
+ #if 0
  	if ((sp = busynodes->n_rlink) != busynodes) {
  		last = -1;
  		ptype = sp->n_ptype + 1;
***************
*** 246,252 ****
--- 254,266 ----
  			goto done;		
  	}
  	pvmlogerror("mpp_new() out of descriptors: too many spawns\n");
+ #endif /*0*/
  
+ 	if (partsize - last <= count) {
+ 		pvmlogerror("mpp_new() not enough nodes in partition\n");
+ 		return (struct nodeset *)0;
+ 	}
+ 
  done:
  	if (debugmask & PDMNODE) {
  		sprintf(etext, "mpp_new() %d nodes %d ... ptype=%d ptid=%x\n",
***************
*** 342,348 ****
          }
  
  		pids = TALLOC(partsize, long, "pids");
! 		sp = mpp_new(count, ptid);
  		nnodes = (count == partsize) ? -1 : count;
  		nodes = TALLOC(count, long, "nodes");
  		for (j = 0; j < count; j++)
--- 356,365 ----
          }
  
  		pids = TALLOC(partsize, long, "pids");
! 		if (!(sp = mpp_new(count, ptid))) {
! 			err = PvmOutOfRes;
! 			goto done;
! 		}
  		nnodes = (count == partsize) ? -1 : count;
  		nodes = TALLOC(count, long, "nodes");
  		for (j = 0; j < count; j++)
***************
*** 423,428 ****
--- 440,447 ----
  done:
  	for (j = 0; j < count; j++)
  		tids[j] = err;
+ 	if (pids)
+ 		PVM_FREE(pids);
  	return err;
  }
  
***************
*** 445,456 ****
  	pp->pk_dat += hdrdiff;
  	if (_crecv(-1, pp->pk_dat, (long)len) < 0)
  		pvmlogperror("mpp_input() crecv");
! 	else
! 	loclinpkt(0, pp);
  }
  
  
  /* use gsendx() to multicast */
  int
  mpp_mcast(pp, tids, ntask)
  	struct pkt *pp;	/* packet to send */
--- 464,494 ----
  	pp->pk_dat += hdrdiff;
  	if (_crecv(-1, pp->pk_dat, (long)len) < 0)
  		pvmlogperror("mpp_input() crecv");
! 	else {
! 		cp = pp->pk_dat;
! 		if ((len = pvmget32(cp + 8) + TDFRAGHDR) != pp->pk_len) {
! 			struct pkt *hdr;
! 
! 			/* inplace frag, head & body sent separately */
! 			hdr = pp;
! 			pp = pk_new(len + hdrdiff);
! 			pp->pk_dat += hdrdiff;
! 			BCOPY(hdr->pk_dat, pp->pk_dat, hdr->pk_len);
! 			pp->pk_len = len;
! 			if (_crecvx(PMTPACK, pp->pk_dat + hdr->pk_len, 
! 			(long)(len - hdr->pk_len), _infonode(), 0, (long*)0) < 0) {
! 				pvmlogperror("mpp_input() crecv body");
! 				return;
! 			}
! 			pk_free(hdr);
! 		}
! 		loclinpkt(0, pp);
! 	}
  }
  
  
  /* use gsendx() to multicast */
+ /* XXX can't multicast to tasks with different ptypes */
  int
  mpp_mcast(pp, tids, ntask)
  	struct pkt *pp;	/* packet to send */
***************
*** 460,488 ****
  	int i;
  	long count = 0;
  	struct nodeset *sp;
! 	long ptype;
  	int ptypepart;
  	long *nodes = 0;
  	char *cp;
  
- 	ptype = TIDTOTYPE(tids[0]);
- 	for (sp = busynodes->n_link; sp != busynodes; sp = sp->n_link)
- 		if ((sp->n_ptype & ptypemask) == ptype) {
- 			ptype = sp->n_ptype;
- 			break;
- 		}
- 	if (sp == busynodes) {
- 		sprintf(etext, "mpp_mcast() pkt from t%x scrapped (no cube)\n", 
- 		pp->pk_src);
- 		pvmlogerror(etext);
- 		return -1;
- 	}
- 
- 	ptypepart = tids[0] & tidtmask;
  	nodes = TALLOC(ntask, long, "nodes");
  	for (i = 0; i < ntask; i++) {
  		if ((tids[i] & tidtmask) != ptypepart 
  				|| (tids[i] & tidhmask) != myhostpart)
  			continue;
          if (!TIDISNODE(tids[i])) {      /* Arrrgh!!! */
              struct pkt *pp2;
--- 498,515 ----
  	int i;
  	long count = 0;
  	struct nodeset *sp;
! 	long ptype = -1;
  	int ptypepart;
  	long *nodes = 0;
  	char *cp;
  
  	nodes = TALLOC(ntask, long, "nodes");
  	for (i = 0; i < ntask; i++) {
+ /*
  		if ((tids[i] & tidtmask) != ptypepart 
  				|| (tids[i] & tidhmask) != myhostpart)
+ */
+ 		if ((tids[i] & tidhmask) != myhostpart)
  			continue;
          if (!TIDISNODE(tids[i])) {      /* Arrrgh!!! */
              struct pkt *pp2;
***************
*** 501,509 ****
                  pkt_to_task(tp, pp2);
              }
              continue;
!         }
  		nodes[count++] = tids[i] & tidnmask;
  	}
  	if (count) {
  		if (debugmask & PDMMESSAGE) {
  			sprintf(etext, "mpp_mcast() pkt from t%x len=%d to type=%ld %ld\n",
--- 528,554 ----
                  pkt_to_task(tp, pp2);
              }
              continue;
!         } 
! 		if (ptype == -1) {
! 			ptype = TIDTOTYPE(tids[i]);
! 			ptypepart = tids[i] & tidtmask;
! 		}
! 		if (ptype != TIDTOTYPE(tids[i]))
! 			pvmlogerror("mpp_mcast(): multiple ptypes? Oh no ..\n");
  		nodes[count++] = tids[i] & tidnmask;
  	}
+ 	for (sp = busynodes->n_link; sp != busynodes; sp = sp->n_link)
+ 		if ((sp->n_ptype & ptypemask) == ptype) {
+ 			ptype = sp->n_ptype;
+ 			break;
+ 		}
+ 	if (sp == busynodes) {
+ 		sprintf(etext, "mpp_mcast() pkt from t%x scrapped (no cube)\n", 
+ 		pp->pk_src);
+ 		pvmlogerror(etext);
+ 		return -1;
+ 	}
+ 
  	if (count) {
  		if (debugmask & PDMMESSAGE) {
  			sprintf(etext, "mpp_mcast() pkt from t%x len=%d to type=%ld %ld\n",
***************
*** 518,528 ****
          pp->pk_len += TDFRAGHDR;
  		if (ptype != PVMDPTYPE && _setptype(ptype) < 0)
  			pvmlogperror("mpp_mcast() setptype");
! 		if (_gsendx(PMTMCAST, pp->pk_dat, (long)pp->pk_len, nodes, count) < 0)
  			pvmlogperror("mpp_mcast() gsendx");
  		if (ptype != PVMDPTYPE)
  			_setptype(PVMDPTYPE);
- /*		}	*/
  	}
  	PVM_FREE(nodes);
  	return 0;
--- 563,575 ----
          pp->pk_len += TDFRAGHDR;
  		if (ptype != PVMDPTYPE && _setptype(ptype) < 0)
  			pvmlogperror("mpp_mcast() setptype");
! 		/* inform precv/recv of a packed message */
! 		if (_gsendx(PMTPACK, cp, 0, nodes, count) < 0)
! 			pvmlogperror("mpp_mcast() gsendx null msg");
! 		if (_gsendx(PMTPACK, pp->pk_dat, (long)pp->pk_len, nodes, count) < 0)
  			pvmlogperror("mpp_mcast() gsendx");
  		if (ptype != PVMDPTYPE)
  			_setptype(PVMDPTYPE);
  	}
  	PVM_FREE(nodes);
  	return 0;
***************
*** 557,563 ****
  
  	if (debugmask & PDMPACKET) {
  		sprintf(etext,
! 			"mpp_output() src t%x dst t%x ff %x len %d ptype=%ld\n",
  			pp->pk_src, pp->pk_dst, pp->pk_flag & (FFSOM|FFEOM),
  			pp->pk_len, ptype);
  		pvmlogerror(etext);
--- 604,610 ----
  
  	if (debugmask & PDMPACKET) {
  		sprintf(etext,
! 			"mpp_output() src t%x dst t%x ff %x len %d ptype %d\n",
  			pp->pk_src, pp->pk_dst, pp->pk_flag & (FFSOM|FFEOM),
  			pp->pk_len, ptype);
  		pvmlogerror(etext);
***************
*** 576,582 ****
  			outpkt = 0;
  		}
  	}
! 	if ((isendmid = _isend(PMTDN, cp, (long)pp->pk_len, node, ptype)) < 0) {
  		sprintf(etext,"mpp_output() can't send to t%x", tp->t_tid);
  		pvmlogperror(etext);
  		pk_free(pp);
--- 623,634 ----
  			outpkt = 0;
  		}
  	}
! 	/* inform precv/recv of a packed message */
! 	if (_csend(PMTPACK, cp, 0, node, ptype) < 0) {
! 		sprintf(etext,"mpp_output() can't send null msg to t%x", tp->t_tid);
! 		pvmlogperror(etext);
! 	}
! 	if ((isendmid = _isend(PMTPACK, cp, (long)pp->pk_len, node, ptype)) < 0) {
  		sprintf(etext,"mpp_output() can't send to t%x", tp->t_tid);
  		pvmlogperror(etext);
  		pk_free(pp);
*** ../netlib/pvm3.3.4/src/SGIMP/Makefile	Mon May  2 16:52:44 1994
--- src/SGIMP/Makefile	Tue Nov  8 16:06:32 1994
***************
*** 4,9 ****
--- 4,10 ----
  #
  install:	default $(LIBDIR)
  	mv pvmd3 libpvm3.a libpvm3s.a $(LIBDIR)
+ 	case x$(HASRANLIB) in xt ) echo ranlib; ranlib $(LIBDIR)/libpvm3.a ; ranlib $(LIBDIR)/libpvm3s.a ;; esac
  		
  default:    
  	make -f $(CONFFILE) -f ../Makefile.shmem pvmd3 libpvm3.a libpvm3s.a
*** /dev/null	Wed Nov  9 10:54:00 1994
--- src/SGIMP64/Makefile	Tue Nov  8 16:06:41 1994
***************
*** 0 ****
--- 1,16 ----
+ PVM_ARCH	=	SGIMP64
+ CONFFILE	=	$(PVM_ROOT)/conf/$(PVM_ARCH).def
+ LIBDIR		=	$(PVM_ROOT)/lib/$(PVM_ARCH)
+ #
+ install:	default $(LIBDIR)
+ 	mv pvmd3 libpvm3.a libpvm3s.a $(LIBDIR)
+ 	case x$(HASRANLIB) in xt ) echo ranlib; ranlib $(LIBDIR)/libpvm3.a ; ranlib $(LIBDIR)/libpvm3s.a ;; esac
+ 		
+ default:    
+ 	make -f $(CONFFILE) -f ../Makefile.shmem pvmd3 libpvm3.a libpvm3s.a
+ 
+ clean:
+ 	make -f $(CONFFILE) -f ../Makefile.shmem clean
+ 	
+ $(LIBDIR):
+ 	mkdir $(LIBDIR)
*** ../netlib/pvm3.3.4/src/SUNMP/Makefile	Mon May  2 16:52:32 1994
--- src/SUNMP/Makefile	Tue Nov  8 16:06:58 1994
***************
*** 4,9 ****
--- 4,10 ----
  #
  install:	default $(LIBDIR)
  	mv pvmd3 libpvm3.a libpvm3s.a $(LIBDIR)
+ 	case x$(HASRANLIB) in xt ) echo ranlib; ranlib $(LIBDIR)/libpvm3.a ; ranlib $(LIBDIR)/libpvm3s.a ;; esac
  		
  default:    
  	make -f $(CONFFILE) -f ../Makefile.shmem pvmd3 libpvm3.a libpvm3s.a
*** ../netlib/pvm3.3.4/src/ddpro.c	Mon Jul 18 16:06:47 1994
--- src/ddpro.c	Sat Oct 15 15:04:25 1994
***************
*** 32,37 ****
--- 32,42 ----
   *	Entry points for messages from network.
   *
  $Log: ddpro.c,v $
+  * 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.
+  * check newhosts when deleting host
+  *
   * Revision 1.6  1994/07/18  19:18:10  manchek
   * hostfailentry() no longer matches pvmd' to t0.
   * wa_dep wasn't propogated from hoststart to htupd
***************
*** 118,124 ****
   **           **
   ***************/
  
! static char rcsid[] = "$Id: ddpro.c,v 1.6 1994/07/18 19:18:10 manchek Exp $";
  static char pvmtxt[512];			/* scratch for error log */
  
  int dm_add();
--- 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();
***************
*** 196,202 ****
  dmname(code)
  	int code;
  {
! 	if (code < DM_FIRST || code > DM_LAST)
  		return "unknown";
  	code -= DM_FIRST;
  	return dm_names[code];
--- 201,207 ----
  dmname(code)
  	int code;
  {
! 	if (code < (int)DM_FIRST || code > (int)DM_LAST)
  		return "unknown";
  	code -= DM_FIRST;
  	return dm_names[code];
***************
*** 411,417 ****
  */
  	}
  
! 	if (c < DM_FIRST || c > DM_LAST) {
  		sprintf(pvmtxt, "netentry() message from t%x with bogus code %d\n",
  				mp->m_src, c);
  		pvmlogerror(pvmtxt);
--- 416,422 ----
  */
  	}
  
! 	if (c < (int)DM_FIRST || c > (int)DM_LAST) {
  		sprintf(pvmtxt, "netentry() message from t%x with bogus code %d\n",
  				mp->m_src, c);
  		pvmlogerror(pvmtxt);
***************
*** 874,879 ****
--- 879,918 ----
  #endif /*SHMEM*/
  		mpp_load(flags, av[0], av, count, tids, ptid);
  
+ 	for (i = 0; i < count; i++) {
+ 		if (tids[i] < 0)
+ 			break;
+ 		tp = task_find(tids[i]);
+ 		tp->t_outtid = outtid;
+ 		tp->t_outcod = outcod;
+ 		tp->t_trctid = trctid;
+ 		tp->t_trccod = trccod;
+ 		tp->t_sched = schtid;
+ 		if (trctid) {
+ 			mp2 = mesg_new(0);
+ 			mp2->m_cod = trccod;
+ 			mp2->m_dst = trctid;
+ 			gettimeofday(&now, (struct timezone*)0);
+ 			pkint(mp2, (int)now.tv_sec);
+ 			pkint(mp2, (int)now.tv_usec);
+ 			pkint(mp2, tp->t_tid);
+ 			pkint(mp2, TEV_NEWTASK);
+ 			pkint(mp2, ptid);
+ 			pkint(mp2, flags);
+ 			pkstr(mp2, av[0]);
+ 			sendmessage(mp2);
+ 		}
+ 		if (outtid) {
+ 			mp2 = mesg_new(0);
+ 			mp2->m_cod = outcod;
+ 			mp2->m_dst = outtid;
+ 			pkint(mp2, tp->t_tid);
+ 			pkint(mp2, -2);
+ 			pkint(mp2, ptid);
+ 			sendmessage(mp2);
+ 		}
+ 	}
+ 
  #else /*defined(IMA_PGON) || defined(IMA_I860) || defined(IMA_CM5) || defined(SHMEM)*/
  
  	for (i = 0; i < count; i++) {
***************
*** 1793,1803 ****
  {
  	struct waitc *wp;		/* wait context on pvmd' */
  
- 	finack_to_host(hp);
- 
  	if (!(wp = wait_get(hp, mp, WT_HOSTSTART)))
  		return 0;
  
  	startack(wp, mp);
  
  	return 0;
--- 1832,1842 ----
  {
  	struct waitc *wp;		/* wait context on pvmd' */
  
  	if (!(wp = wait_get(hp, mp, WT_HOSTSTART)))
  		return 0;
  
+ 	finack_to_host(hp);
+ 
  	startack(wp, mp);
  
  	return 0;
***************
*** 2465,2470 ****
--- 2504,2511 ----
  			}
  			hostfailentry(hp);
  			ht_delete(hosts, hp);
+ 			if (newhosts)
+ 				ht_delete(newhosts, hp);
  		}
  	}
  	return 0;
*** ../netlib/pvm3.3.4/src/global.h	Sun Sep  4 16:25:29 1994
--- src/global.h	Sat Oct 15 15:05:22 1994
***************
*** 32,37 ****
--- 32,40 ----
   *	Generic includes.
   *
  $Log: global.h,v $
+  * Revision 1.14  1994/10/15  19:05:01  manchek
+  * version 3.3.5
+  *
   * Revision 1.13  1994/09/02  15:20:38  manchek
   * version 3.3.4
   *
***************
*** 76,82 ****
  
  /* release version */
  
! #define	PVM_VER	"3.3.4"
  
  /* UDPMAXLEN should be set to the largest UDP message length
     your system can handle. */
--- 79,85 ----
  
  /* release version */
  
! #define	PVM_VER	"3.3.5"
  
  /* UDPMAXLEN should be set to the largest UDP message length
     your system can handle. */
*** ../netlib/pvm3.3.4/src/host.c	Tue Jun 21 15:40:29 1994
--- src/host.c	Sat Oct 15 15:06:07 1994
***************
*** 32,37 ****
--- 32,40 ----
   *	Host table functions.
   *
  $Log: host.c,v $
+  * Revision 1.6  1994/10/15  19:05:39  manchek
+  * must use PVM_FREE instead of free in iflist()
+  *
   * Revision 1.5  1994/06/21  18:30:55  manchek
   * HF_SPEED flag now determines whether hd_speed has been set
   *
***************
*** 111,117 ****
   **           **
   ***************/
  
! static char rcsid[] = "$Id: host.c,v 1.5 1994/06/21 18:30:55 manchek Exp $";
  static char pvmtxt[1024];			/* scratch space for error messages */
  
  
--- 114,120 ----
   **           **
   ***************/
  
! static char rcsid[] = "$Id: host.c,v 1.6 1994/10/15 19:05:39 manchek Exp $";
  static char pvmtxt[1024];			/* scratch space for error messages */
  
  
***************
*** 858,864 ****
  	char **p;
  
  	if (iplist)
! 		free(iplist);
  	iplist = TALLOC(10, struct in_addr, "ifl");
  
  	if (gethostname(hn, sizeof(hn))) {
--- 861,867 ----
  	char **p;
  
  	if (iplist)
! 		PVM_FREE(iplist);
  	iplist = TALLOC(10, struct in_addr, "ifl");
  
  	if (gethostname(hn, sizeof(hn))) {
*** ../netlib/pvm3.3.4/src/imalloc.c	Fri Jun  3 16:38:15 1994
--- src/imalloc.c	Mon Nov  7 16:33:49 1994
***************
*** 74,79 ****
--- 74,82 ----
   *
   */
  
+ #ifdef	HASSTDLIB
+ #include <stdlib.h>
+ #endif
  #include <stdio.h>
  #ifdef	SYSVSTR
  #include <string.h>
***************
*** 102,108 ****
  #endif
  
  #define	NEXTRN(x)	(x = (x) + (x) + (((x ^ (x >> 3)) & 0x2000) ? 1 : 0))
! #define	HASH(p)		(((int)(p) ^ ((int)(p) >> 8) ^ ((int)(p) >> 16) ^ ((int)(p) >> 24)) & 0xff)
  
  /* write a null-term string */
  
--- 105,111 ----
  #endif
  
  #define	NEXTRN(x)	(x = (x) + (x) + (((x ^ (x >> 3)) & 0x2000) ? 1 : 0))
! #define	HASH(p)		(((long)(p) ^ ((long)(p) >> 8) ^ ((long)(p) >> 16) ^ ((long)(p) >> 24)) & 0xff)
  
  /* write a null-term string */
  
***************
*** 128,134 ****
  #define	OBALLOC		1	/* ob was just alloced - cleared by dump() */
  #define	OBREALLOC	2	/* ob was just realloced - cleared by dump() */
  
! static char rcsid[] = "$Id: imalloc.c,v 1.2 1994/06/03 20:38:15 manchek Exp $";
  
  /* default values */
  
--- 131,137 ----
  #define	OBALLOC		1	/* ob was just alloced - cleared by dump() */
  #define	OBREALLOC	2	/* ob was just realloced - cleared by dump() */
  
! static char rcsid[] = "$Id: imalloc.c,v 1.3 1994/11/07 21:33:32 manchek Exp $";
  
  /* default values */
  
*** ../netlib/pvm3.3.4/src/lpvm.c	Sun Sep  4 16:25:29 1994
--- src/lpvm.c	Sat Oct 15 15:08:46 1994
***************
*** 32,37 ****
--- 32,41 ----
   *	Libpvm core for unix environment.
   *
  $Log: lpvm.c,v $
+  * Revision 1.13  1994/10/15  19:07:31  manchek
+  * don't use fd_sets when select returns -1; will hang reading.
+  * cast message tags for comparison as integers
+  *
   * Revision 1.12  1994/09/02  15:23:37  manchek
   * fixed segfaults in setopt when task not connected
   *
***************
*** 265,271 ****
   **           **
   ***************/
  
! static char rcsid[] = "$Id: lpvm.c,v 1.12 1994/09/02 15:23:37 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 */
--- 269,275 ----
   **           **
   ***************/
  
! static char rcsid[] = "$Id: lpvm.c,v 1.13 1994/10/15 19:07:31 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 */
***************
*** 1419,1424 ****
--- 1423,1432 ----
  		pvmlogerror(pvmtxt);
  	}
  
+ /* XXX we go an extra time through select because wantmore gets set
+    XXX inside loop.  no big deal.  also, could avoid calling gettimeofday
+    XXX if tmout is 0.0 */
+ 
  	while (txfp || topvmd->tt_rxf || wantmore) {
  
  		if (txfp || topvmd->tt_rxf) {			/* gotta block */
***************
*** 1476,1481 ****
--- 1484,1491 ----
  			sprintf(pvmtxt, "mxfer() select returns %d\n", n);
  			pvmlogerror(pvmtxt);
  		}
+ 		if (n == -1)
+ 			continue;
  
  	/*
  	* if pvmd conn has data ready, read packets
***************
*** 1497,1503 ****
  	/* pass any control messages to pvmmctl() */
  
  			while ((up = up->ub_link) != pvmrxlist) {
! 				if (up->ub_cod >= TC_FIRST && up->ub_cod <= TC_LAST) {
  					up = up->ub_rlink;
  					if ((sbf = pvmmctl(up->ub_link)) > 0) {
  						if (txfp)
--- 1507,1513 ----
  	/* pass any control messages to pvmmctl() */
  
  			while ((up = up->ub_link) != pvmrxlist) {
! 				if (up->ub_cod >= (int)TC_FIRST && up->ub_cod <= (int)TC_LAST) {
  					up = up->ub_rlink;
  					if ((sbf = pvmmctl(up->ub_link)) > 0) {
  						if (txfp)
*** ../netlib/pvm3.3.4/src/lpvmcat.c	Fri Jun  3 16:38:16 1994
--- src/lpvmcat.c	Mon Nov  7 16:34:57 1994
***************
*** 32,37 ****
--- 32,43 ----
   *	Child task output collection.
   *
  $Log: lpvmcat.c,v $
+  * Revision 1.3  1994/11/07  21:34:49  manchek
+  * cast message tag for comparison as int
+  *
+  * Revision 1.2  1994/10/15  19:10:08  manchek
+  * don't segfault if we get a TC_OUTPUT message and pvm_catchout never called
+  *
   * Revision 1.1  1994/06/03  20:38:16  manchek
   * Initial revision
   *
***************
*** 103,109 ****
   **           **
   ***************/
  
! static char rcsid[] = "$Id: lpvmcat.c,v 1.1 1994/06/03 20:38:16 manchek Exp $";
  static char pvmtxt[512];				/* scratch for error log */
  static struct tobuf *tobuflist = 0;
  static FILE *outlogff = 0;
--- 109,115 ----
   **           **
   ***************/
  
! static char rcsid[] = "$Id: lpvmcat.c,v 1.3 1994/11/07 21:34:49 manchek Exp $";
  static char pvmtxt[512];				/* scratch for error log */
  static struct tobuf *tobuflist = 0;
  static FILE *outlogff = 0;
***************
*** 175,183 ****
  {
  	struct tobuf *op;
  
! 	for (op = tobuflist->o_link; op != tobuflist; op = op->o_link) {
! 		printf("tobuf_dump() t%x\n", op->o_tid);
! 	}
  	return 0;
  }
  
--- 181,192 ----
  {
  	struct tobuf *op;
  
! 	if (tobuflist)
! 		for (op = tobuflist->o_link; op != tobuflist; op = op->o_link) {
! 			printf("tobuf_dump() t%x\n", op->o_tid);
! 		}
! 	else
! 		printf("tobuf_dump() tobuflist null\n");
  	return 0;
  }
  
***************
*** 206,211 ****
--- 215,226 ----
  	pvm_upkint(&tid, 1, 1);
  	pvm_upkint(&n, 1, 1);
  
+ 	if (!tobuflist) {
+ 		sprintf(pvmtxt, "pvmclaimo() message from task t%x\n", tid);
+ 		pvmlogerror(pvmtxt);
+ 		return 0;
+ 	}
+ 
  	if (n > 0) {	/* output printed by task */
  		if (!(op = tobuf_find(tid))) {
  			sprintf(pvmtxt, "pvmclaimo() bogus message, no task t%x\n", tid);
***************
*** 347,353 ****
  	if (ff) {
  		tobuf_init();
  		pvm_setopt(PvmOutputTid, pvm_mytid());
! 		pvm_setopt(PvmOutputCode, TC_OUTPUT);
  		outlogff = ff;
  
  	} else {
--- 362,368 ----
  	if (ff) {
  		tobuf_init();
  		pvm_setopt(PvmOutputTid, pvm_mytid());
! 		pvm_setopt(PvmOutputCode, (int)TC_OUTPUT);
  		outlogff = ff;
  
  	} else {
*** ../netlib/pvm3.3.4/src/lpvmgen.c	Fri Jun  3 16:38:16 1994
--- src/lpvmgen.c	Mon Nov  7 16:37:01 1994
***************
*** 32,37 ****
--- 32,44 ----
   *	Libpvm generic functions.
   *
  $Log: lpvmgen.c,v $
+  * Revision 1.6  1994/11/07  21:36:33  manchek
+  * flush messages on pvm_exit.
+  * function prototype for SCO
+  *
+  * Revision 1.5  1994/10/15  19:12:35  manchek
+  * check for system error in TM_SPAWN reply (cc != count)
+  *
   * Revision 1.4  1994/06/03  20:38:16  manchek
   * version 3.3.0
   *
***************
*** 111,117 ****
  
  static int def_match();
  
! static char rcsid[] = "$Id: lpvmgen.c,v 1.4 1994/06/03 20:38:16 manchek Exp $";
  static char pvmtxt[512];				/* scratch for error log */
  static int (*recv_match)() = def_match;
  
--- 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;
  
***************
*** 485,490 ****
--- 492,498 ----
  	}
  
  	if (pvmmytid != -1) {
+ 		while (pvm_nrecv(-1, -1) > 0) ;		/* XXX attempt to flush messages */
  		pvmflusho();
  		fflush(stderr);
  		fflush(stdout);
***************
*** 1236,1242 ****
--- 1244,1254 ----
  
  int (*
  pvm_recvf(new))()
+ #ifdef	IMA_SCO
+ 	int (*new)(int,int,int);
+ #else
  	int (*new)();
+ #endif
  {
  	int (*old)() = recv_match;
  	int x;
***************
*** 1509,1517 ****
  				cc = msendrecv(TIDPVMD, TM_SPAWN);
  			if (cc > 0) {
  				pvm_upkint(&cc, 1, 1);
! 				tidlist = tids ? tids : TALLOC(count, int, "xxx");
! 				pvm_upkint(tidlist, cc, 1);
! 				cc = bubble(cc, tidlist);
  				pvm_freebuf(pvm_setrbuf(rbf));
  
  			} else
--- 1521,1531 ----
  				cc = msendrecv(TIDPVMD, TM_SPAWN);
  			if (cc > 0) {
  				pvm_upkint(&cc, 1, 1);
! 				if (cc == count) {
! 					tidlist = tids ? tids : TALLOC(count, int, "xxx");
! 					pvm_upkint(tidlist, cc, 1);
! 					cc = bubble(cc, tidlist);
! 				}
  				pvm_freebuf(pvm_setrbuf(rbf));
  
  			} else
*** ../netlib/pvm3.3.4/src/lpvmmimd.c	Sun Sep  4 16:25:29 1994
--- src/lpvmmimd.c	Mon Nov  7 17:40:28 1994
***************
*** 32,37 ****
--- 32,44 ----
   *	Libpvm core for MPP environment.
   *
  $Log: lpvmmimd.c,v $
+  * Revision 1.6  1994/11/07  22:39:59  manchek
+  * Modify node_mcast() to handle DataInPlace correctly.
+  * Modify pvm_precv() to deal with packets from service nodes.  Those
+  * packets have PVM headers.
+  * Change the limit on pvmfrgsiz in pvm_setopt() to MAXFRAGSIZE.
+  * Respond to RouteDirect requests
+  *
   * Revision 1.5  1994/09/02  15:25:03  manchek
   * fixed typos in pvm_precv - rtid should be rlen
   *
***************
*** 84,89 ****
--- 91,99 ----
  #define	TDMPACKET	1		/* packet tracing */
  #define	TDMMESSAGE	2		/* message tracing */
  
+ #ifndef max
+ #define max(a,b)	((a)>(b)?(a):(b))
+ #endif
  
  char *getenv();
  
***************
*** 184,191 ****
  int nextsmid = 0;						/* index of current isend mid */
  
  long my_ptype = 0;						/* my process type */
! long my_host = -1;						/* my host node */
  int my_node = -1;						/* my node number */
  int mysetpart = 0;						/* host field & set field */
  int pvm_errno = 0;						/* last libpvm error code */
  int pvm_nerr = sizeof(pvm_errlist)
--- 194,204 ----
  int nextsmid = 0;						/* index of current isend mid */
  
  long my_ptype = 0;						/* my process type */
! long hostnode = -1;						/* host node number */
  int my_node = -1;						/* my node number */
+ #ifdef IMA_I860
+ int my_vnode = -1;						/* my virtual node number */
+ #endif
  int mysetpart = 0;						/* host field & set field */
  int pvm_errno = 0;						/* last libpvm error code */
  int pvm_nerr = sizeof(pvm_errlist)
***************
*** 203,219 ****
   **           **
   ***************/
  
! static char rcsid[] = "$Id: lpvmmimd.c,v 1.5 1994/09/02 15:25:03 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 */
- static struct frag *rxbuf;				/* buffer for incoming packets */
  static int pvmtrcmid = 0;               /* message buffer for trace */
  static int pvmtrcsbf = 0;               /* existing other buffer during trace */
  
! static int recvmask = 0x80000000 + (1 << PMTDN) + (1 << PMTNN)
! 						+ (1 << PMTMCAST);
! 								/* accept messages from pvmd or other nodes */
  static int pvmrouteopt = PvmDontRoute;	/* task-task routing style */
  
  
--- 216,229 ----
   **           **
   ***************/
  
! static char rcsid[] = "$Id: lpvmmimd.c,v 1.6 1994/11/07 22:39:59 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 */
  static int pvmtrcmid = 0;               /* message buffer for trace */
  static int pvmtrcsbf = 0;               /* existing other buffer during trace */
  
! /* static int recvmask = 0x80000000 + (1<<PMTDN) + (1<<PMTNN) + (1<<PMTMCAST);*/
  static int pvmrouteopt = PvmDontRoute;	/* task-task routing style */
  
  
***************
*** 299,311 ****
  pvmmctl(up)
      struct umbuf *up;
  {
!     char buf[512];          /* to convert sockaddr, misc */
! 	int rbf;
  
      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:
--- 309,337 ----
  pvmmctl(up)
      struct umbuf *up;
  {
!     char buf[256];          /* to convert sockaddr, misc */
! 	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 */
  
+ 	rbf = pvm_setrbuf(up->ub_mid);
+ 
      switch (up->ub_cod) {
      case TC_CONREQ:
          sprintf(pvmtxt, "pvmmctl() TCP conn request from t%x!\n", up->ub_src);
          pvmlogerror(pvmtxt);
+ 		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:
***************
*** 333,340 ****
          break;
      }
  
      umbuf_free(up->ub_mid);
!     return 0;
  }
  
  
--- 359,367 ----
          break;
      }
  
+ 	pvm_setrbuf(rbf);
      umbuf_free(up->ub_mid);
!     return sbf;
  }
  
  
***************
*** 362,368 ****
  	int gotem = 0;				/* count complete msgs downloaded */
  	struct umbuf *rxup;			/* rx message */
  	struct frag *fp;
! 	char *cp;
  	int src;
  	int dst;
  	int ff;
--- 389,395 ----
  	int gotem = 0;				/* count complete msgs downloaded */
  	struct umbuf *rxup;			/* rx message */
  	struct frag *fp;
! 	char *cp = 0;
  	int src;
  	int dst;
  	int ff;
***************
*** 370,375 ****
--- 397,404 ----
  	int block;					/* get at least one message */
  	struct timeval tnow, tstop;
  	int len;
+ 	int node;
+ 	int sbf;					/* message sent by pvmmctl() */
  
  	/* XXX do we really have to do this? */
  	if ((dtid == TIDPVMD && code == TM_MCA) || dtid == TIDGID)
***************
*** 406,457 ****
                  break;
          }
  
! 		if (MSGPROBE()) {
  #if defined(IMA_PGON) || defined(IMA_I860)
! 			fp = fr_new(_infocount());
! 			if (PVMCRECV(-1, -1, fp->fr_dat, fp->fr_max, 0, (long *)0) < 0) {
! 				pvmlogperror("mroute() PVMCRECV");
! 				return PvmSysErr;
! 			}
  #endif
  #ifdef IMA_CM5
! 			fp = fr_new(CMMD_bytes_received());
! 			if (PVMCRECV(CMMD_ANY_NODE, CMMD_ANY_TAG, fp->fr_dat, fp->fr_max, 
! 			0, 0) < 0) {
! 				pvmlogperror("mroute() PVMCRECV");
! 				return PvmSysErr;
! 			}
  #endif
! 			fp->fr_len = fp->fr_max;
! 			cp = fp->fr_dat;
! 			if ((len = pvmget32(cp + 8) + TDFRAGHDR) != fp->fr_len) {
! 				/* inplace data */
! 				rxbuf = fp;
  				fp = fr_new(len);
! 				BCOPY(rxbuf->fr_dat, fp->fr_dat, rxbuf->fr_len);
! #if defined(IMA_PGON) || defined(IMA_I860)
! 				if (PVMCRECV(-1, _infotype(), fp->fr_dat + rxbuf->fr_len, 
! 				len - rxbuf->fr_len, 0, (long *)0) < 0) {
  					pvmlogperror("mroute() PVMCRECV");
  					return PvmSysErr;
  				}
  #endif
  #ifdef IMA_CM5
! 				if (PVMCRECV(CMMD_ANY_NODE, CMMD_msg_tag(), 
! 				fp->fr_dat + rxbuf->fr_len, len - rxbuf->fr_len, 0, 0) < 0) { 
  					pvmlogperror("mroute() PVMCRECV");
  					return PvmSysErr;
  				}
- #endif
  				cp = fp->fr_dat;
- 				fp->fr_len = len;
  			} 
  
  			/* fp->fr_len = fp->fr_max; */
  			dst = pvmget32(cp);
  			src = pvmget32(cp + 4);
  			ff = pvmget8(cp + 12);
! 			fp->fr_len -= TDFRAGHDR;
  			fp->fr_dat += TDFRAGHDR;
  			if (debugmask & TDMPACKET) {
  				sprintf(pvmtxt, "mroute() src t%x len %d dst t%x\n",
--- 435,496 ----
                  break;
          }
  
! 		if (MSGPROBE(PMTPACK)) {
! 		/* 1. null msg (except I860); 2. header (inplace); 3. entire msg */
! 
  #if defined(IMA_PGON) || defined(IMA_I860)
! 			len = _infocount();
! 			node = -1;
  #endif
  #ifdef IMA_CM5
! 			len = CMMD_bytes_received();
! 			node = CMMD_ANY_NODE;
  #endif
! 			if (len)
  				fp = fr_new(len);
! 			else
! 				fp = fr_new(pvmfrgsiz);
! 			cp = fp->fr_dat;
! 			if (PVMCRECV(node, PMTPACK, cp, len, 0, 0) < 0) {
  					pvmlogperror("mroute() PVMCRECV");
  					return PvmSysErr;
  				}
+ 			if (!len || (len = pvmget32(cp + 8) + TDFRAGHDR) != fp->fr_max) {
+ 				struct frag *hdr;			/* buffer for header */
+ 
+ 				if (len) {
+ 				/* inplace data, head & body sent separately */
+ 					hdr = fp;
+ 					fp = fr_new(len);
+ 					len = hdr->fr_max;
+ 					BCOPY(hdr->fr_dat, fp->fr_dat, len);
+ 					fr_unref(hdr);
+ 				}
+ #if defined(IMA_PGON) || defined(IMA_I860)
+ 				node = _infonode();
  #endif
  #ifdef IMA_CM5
! 				node = CMMD_msg_sender();
! #endif
! #ifdef IMA_I860
! 				/* msg type is (virtual) node # */
! 				if (_crecv(node, fp->fr_dat + len, fp->fr_max - len) < 0) {
! #else
! 				if (PVMCRECV(node, PMTPACK, fp->fr_dat + len, fp->fr_max - len,
! 				0, (long*)0) < 0) {
! #endif
  					pvmlogperror("mroute() PVMCRECV");
  					return PvmSysErr;
  				}
  				cp = fp->fr_dat;
  			} 
  
  			/* fp->fr_len = fp->fr_max; */
  			dst = pvmget32(cp);
  			src = pvmget32(cp + 4);
+ 			fp->fr_len = pvmget32(cp + 8);
  			ff = pvmget8(cp + 12);
! 			/* fp->fr_len -= TDFRAGHDR; */
  			fp->fr_dat += TDFRAGHDR;
  			if (debugmask & TDMPACKET) {
  				sprintf(pvmtxt, "mroute() src t%x len %d dst t%x\n",
***************
*** 494,507 ****
  					rxup->ub_codef = enctovec(rxup->ub_enc);
  					LISTPUTBEFORE(pvmrxlist, rxup, ub_link, ub_rlink);
  					gotem++;
- 					/* XXX never tested */
                      if (rxup->ub_cod >= TC_FIRST && rxup->ub_cod <= TC_LAST) {
                          rxup = rxup->ub_rlink;
!                         pvmmctl(rxup->ub_link);
                      }
  				}
  			}
  		}
  
  	} while (block && !gotem);
  
--- 533,553 ----
  					rxup->ub_codef = enctovec(rxup->ub_enc);
  					LISTPUTBEFORE(pvmrxlist, rxup, ub_link, ub_rlink);
  					gotem++;
                      if (rxup->ub_cod >= TC_FIRST && rxup->ub_cod <= TC_LAST) {
                          rxup = rxup->ub_rlink;
! 						/* pass any control messages to pvmmctl() */
!                         if ((sbf = pvmmctl(rxup->ub_link)) > 0) {
! 							txup = midtobuf(sbf);
! 							txfp = txup->ub_frag->fr_link;
! 							if (txfp->fr_buf)
! 								/* reply to sender */
! 								node_send(txup, txfp, txup->ub_dst, 
! 									txup->ub_cod);
                      }
  				}
  			}
  		}
+ 		}
  
  	} while (block && !gotem);
  
***************
*** 522,528 ****
  	int txtogo = 0;				/* len of txfp */
  	long node;					/* destination node */
  	long ptype;					/* destination process type */
- 	long mtype;					/* message type */
  	int i;
  	int ff;
  	char dummy[TDFRAGHDR+TTMSGHDR];	/* for inplace data */
--- 568,573 ----
***************
*** 534,544 ****
  	if (TIDISNODE(dtid) && (dtid & mask) == (pvmmytid & mask)) {
  		node = dtid & pvmtidnmask;
  		ptype = my_ptype;			/* send to node directly */
- 		mtype = PMTNN;
  	} else {
! 		node = my_host;
  		ptype = PVMDPTYPE;			/* send to pvmd first */
- 		mtype = PMTND;
  	}
  
  	do {
--- 579,587 ----
  	if (TIDISNODE(dtid) && (dtid & mask) == (pvmmytid & mask)) {
  		node = dtid & pvmtidnmask;
  		ptype = my_ptype;			/* send to node directly */
  	} else {
! 		node = hostnode;
  		ptype = PVMDPTYPE;			/* send to pvmd first */
  	}
  
  	do {
***************
*** 602,622 ****
  		}
  
  		if (!txfp->fr_u.dab) {           /* inplace data */
! 
! 			if (PVMCSEND(my_node, txcp, txtogo- txfp->fr_len, node, ptype) < 0){
  				pvmlogperror("node_send() csend header");
  				return PvmSysErr;
  			}
! 			if (PVMCSEND(my_node, txfp->fr_dat, txfp->fr_len, node, ptype) < 0){
  				pvmlogperror("node_send() csend inplace data");
  				return PvmSysErr;
  			}
! 
  		} else {
  
! 			if (node != my_host) {
  				if ((outfrags[nextsmid].tf_mid =
! 				ASYNCSEND(mtype, txcp, txtogo, node, ptype)) < 0) {
  					pvmlogperror("node_send() asyncsend");
  					return PvmSysErr;
  				}
--- 645,672 ----
  		}
  
  		if (!txfp->fr_u.dab) {           /* inplace data */
! 			if (PVMCSEND(PMTPACK, txcp, txtogo- txfp->fr_len, node, ptype) < 0){
  				pvmlogperror("node_send() csend header");
  				return PvmSysErr;
  			}
! #ifdef IMA_I860
! 			/* crecv can't select msg with node #; it can only select type */
! 			if (_csend(my_vnode, txfp->fr_dat, txfp->fr_len, node, 0) < 0) {
  				pvmlogperror("node_send() csend inplace data");
  				return PvmSysErr;
  			}
! #else
! 			/* here the type field is reserved for psend/precv */
! 			if (PVMCSEND(PMTPACK, txfp->fr_dat, txfp->fr_len, node, ptype) < 0){
! 				pvmlogperror("node_send() csend inplace data");
! 				return PvmSysErr;
! 			}
! #endif
  		} else {
  
! 			if (node != hostnode) {
  				if ((outfrags[nextsmid].tf_mid =
! 				ASYNCSEND(PMTPACK, txcp, txtogo, node, ptype)) < 0) {
  					pvmlogperror("node_send() asyncsend");
  					return PvmSysErr;
  				}
***************
*** 630,636 ****
  			 	 * because the dst field is not used. But pvmd relies on
  			 	 * this value to deliever the packet.
  			 	 */
! 				if (PVMCSEND(mtype, txcp, txtogo, node, ptype) < 0) {
  					pvmlogperror("node_send() csend");
  					return PvmSysErr;
  				}
--- 680,686 ----
  			 	 * because the dst field is not used. But pvmd relies on
  			 	 * this value to deliever the packet.
  			 	 */
! 				if (PVMCSEND(PMTPACK, txcp, txtogo, node, ptype) < 0) {
  					pvmlogperror("node_send() csend");
  					return PvmSysErr;
  				}
***************
*** 657,663 ****
  	static int *tids;		/* intended recipients of multicast message */
  	static int ntask;		/* number of tids */
  	int sbf;
! 	int dummy;
  	static struct timeval ztv = { 0, 0 };
  #if defined(IMA_PGON)
  	long *nodes;
--- 707,713 ----
  	static int *tids;		/* intended recipients of multicast message */
  	static int ntask;		/* number of tids */
  	int sbf;
! 	int tmp;
  	static struct timeval ztv = { 0, 0 };
  #if defined(IMA_PGON)
  	long *nodes;
***************
*** 664,672 ****
--- 714,724 ----
  	int mask = pvmtidhmask;		/* host */
  	struct umbuf *txup;			/* tx message or null */
  	struct frag *txfp = 0;		/* cur tx frag or null */
+ 	int txtogo = 0;				/* len of txfp */
  	int ff;
  	char *txcp = 0;				/* point to remainder of txfp */
  	int len = 0;				/* len of txfp */
+ 	char dummy[TDFRAGHDR+TTMSGHDR];	/* for inplace data */
  #endif /*defined(IMA_PGON) || defined(IMA_I860)*/
  
  	/* intercept multicast info */
***************
*** 677,684 ****
  		tids = TALLOC(ntask, int, "tids");
  		pvm_upkint(tids, ntask, 1);
  		sbf = pvm_setsbuf(pvm_mkbuf(PvmDataFoo));
! 		dummy = TIDGID;
! 		pvm_pkint(&dummy, 1, 1);
  		pvm_setrbuf(pvm_setsbuf(sbf));
  		return 0;
  	}
--- 729,736 ----
  		tids = TALLOC(ntask, int, "tids");
  		pvm_upkint(tids, ntask, 1);
  		sbf = pvm_setsbuf(pvm_mkbuf(PvmDataFoo));
! 		tmp = TIDGID;
! 		pvm_pkint(&tmp, 1, 1);
  		pvm_setrbuf(pvm_setsbuf(sbf));
  		return 0;
  	}
***************
*** 701,714 ****
  			txfp = txfp->fr_buf ? txfp : 0;
  		}
  		while (txfp) {
  			txcp = txfp->fr_dat;
! 			len = txfp->fr_len;
  			ff = 0;
  			if (txfp->fr_rlink == txup->ub_frag) {
  				txcp -= TTMSGHDR;
! 				len += TTMSGHDR;
  				pvmput32(txcp, code);
! 				pvmput32(txcp + 4, txup->ub_enc);
  				ff = FFSOM;
  			}
  			if (txfp->fr_link == txup->ub_frag)
--- 753,772 ----
  			txfp = txfp->fr_buf ? txfp : 0;
  		}
  		while (txfp) {
+ 			if (txfp->fr_u.dab) 		/* packed data */
  			txcp = txfp->fr_dat;
! 			else 						/* inplace data */
! 				txcp = dummy + sizeof(dummy);
! 			txtogo = txfp->fr_len;
! 
  			ff = 0;
  			if (txfp->fr_rlink == txup->ub_frag) {
  				txcp -= TTMSGHDR;
! 				txtogo += TTMSGHDR;
  				pvmput32(txcp, code);
! 				pvmput32(txcp + 4, 
! 					(txup->ub_enc == 2 ? pvmmyndf : txup->ub_enc));
! 				pvmput32(txcp + 8, txup->ub_wid);
  				ff = FFSOM;
  			}
  			if (txfp->fr_link == txup->ub_frag)
***************
*** 716,740 ****
  			txcp -= TDFRAGHDR;
  			pvmput32(txcp, dtid);
  			pvmput32(txcp + 4, pvmmytid);
! 			pvmput32(txcp + 8, len);
  			pvmput32(txcp + 12, 0);			/* to keep putrify happy */
  			pvmput8(txcp + 12, ff);
! 			len += TDFRAGHDR;
  			if (debugmask & TDMPACKET) {
  				sprintf(pvmtxt, "node_mcast() len %d\n", txfp->fr_len);
  				pvmlogerror(pvmtxt);
  			}
  			if (count == numnodes() - 1) {
! 				if (_csend(PMTMCAST, txcp, (long)len, -1, my_ptype) < 0) {
  					pvmlogperror("node_mcast() csend");
  					return PvmSysErr;
  				}
  			} else {
! 				if (_gsendx(PMTMCAST, txcp, (long)len, nodes, count) < 0) {
  					pvmlogperror("node_mcast() gsendx");
  					return PvmSysErr;
  				}
  			}
  			txfp = txfp->fr_link;
  			if (!txfp->fr_buf)
  				txfp = 0;
--- 774,825 ----
  			txcp -= TDFRAGHDR;
  			pvmput32(txcp, dtid);
  			pvmput32(txcp + 4, pvmmytid);
! 			pvmput32(txcp + 8, txtogo);
  			pvmput32(txcp + 12, 0);			/* to keep putrify happy */
  			pvmput8(txcp + 12, ff);
! 			txtogo += TDFRAGHDR;
  			if (debugmask & TDMPACKET) {
  				sprintf(pvmtxt, "node_mcast() len %d\n", txfp->fr_len);
  				pvmlogerror(pvmtxt);
  			}
  			if (count == numnodes() - 1) {
! 				if (!txfp->fr_u.dab) {           /* inplace data */
! 					if (_csend(PMTPACK, txcp, txtogo - txfp->fr_len, -1, 
! 					my_ptype) < 0) {
! 						pvmlogperror("node_mcast() csend header");
! 						return PvmSysErr;
! 					}
! 					if (_csend(PMTPACK, txfp->fr_dat, txfp->fr_len, -1, 
! 					my_ptype) < 0){
! 						pvmlogperror("node_mcast() csend inplace data");
! 						return PvmSysErr;
! 					}
! 				} else {						/* packed */
! 					if (_csend(PMTPACK, txcp, (long)txtogo, -1, my_ptype) < 0) {
  					pvmlogperror("node_mcast() csend");
  					return PvmSysErr;
  				}
+ 				}
+ 			
  			} else {
! 				if (!txfp->fr_u.dab) {           /* inplace data */
! 					if (_gsendx(PMTPACK, txcp, txtogo - txfp->fr_len, nodes, 
! 					count) < 0) {
! 						pvmlogperror("node_mcast() gsendx header");
! 						return PvmSysErr;
! 					}
! 					if (_gsendx(PMTPACK, txfp->fr_dat, txfp->fr_len, nodes, 
! 					count) < 0) {
! 						pvmlogperror("node_send() gsendx inplace data");
! 						return PvmSysErr;
! 					}
! 				} else {
! 					if (_gsendx(PMTPACK, txcp, (long)txtogo, nodes, count) < 0){
  					pvmlogperror("node_mcast() gsendx");
  					return PvmSysErr;
  				}
  			}
+ 			}
  			txfp = txfp->fr_link;
  			if (!txfp->fr_buf)
  				txfp = 0;
***************
*** 835,841 ****
  		pvmlogperror("beatask() recv pvminfo");
  		return PvmSysErr;
  	}
! 	if ((my_host = _myhost()) < 0)
  		pvmlogperror("beatask() no controlling process");
  #endif
  
--- 920,926 ----
  		pvmlogperror("beatask() recv pvminfo");
  		return PvmSysErr;
  	}
! 	if ((hostnode = _myhost()) < 0)
  		pvmlogperror("beatask() no controlling process");
  #endif
  
***************
*** 853,859 ****
  
  	CMMD_fset_io_mode(stdout, CMMD_independent);
  	CMMD_fset_io_mode(stderr, CMMD_independent);
! 	my_host = CMMD_host_node();
  #endif
  
  	pvmmyupid = getpid();
--- 938,944 ----
  
  	CMMD_fset_io_mode(stdout, CMMD_independent);
  	CMMD_fset_io_mode(stderr, CMMD_independent);
! 	hostnode = CMMD_host_node();
  #endif
  
  	pvmmyupid = getpid();
***************
*** 871,877 ****
  #endif
  #ifdef IMA_I860
  	my_node = _mydirect();
! 	if (_csend(PMTPHYS, &my_node, sizeof(int), my_host, PVMDPTYPE) < 0)
  		pvmlogperror("beatask() can't send to host");
  #endif
  
--- 956,963 ----
  #endif
  #ifdef IMA_I860
  	my_node = _mydirect();
! 	my_vnode = _mynode();
! 	if (_csend(PMTPHYS, &my_node, sizeof(int), hostnode, PVMDPTYPE) < 0)
  		pvmlogperror("beatask() can't send to host");
  #endif
  
***************
*** 1118,1124 ****
  		break;
  
  	case PvmFragSize:
! 		if (val < TDFRAGHDR + TTMSGHDR + 4 || val > 1048576) {
  			rc = PvmBadParam;
  			err = 1;
  
--- 1204,1211 ----
  		break;
  
  	case PvmFragSize:
! /*		if (val < TDFRAGHDR + TTMSGHDR + 4 || val > 1048576) {		*/
! 		if (val < TDFRAGHDR + TTMSGHDR + 4 || val > MAXFRAGSIZE) {
  			rc = PvmBadParam;
  			err = 1;
  
***************
*** 1416,1447 ****
  		if (PVMCRECV(node, tag, (char*)cp, len, my_ptype, info) < 0) {
  			pvmlogperror("precv() PVMCRECV");
  			cc = PvmSysErr;
! 		} else {
  #ifdef IMA_PGON
! 			if (rtag)
! 				*rtag = info[0];
! 			if (rtid)
! 				*rtid = info[2] + (pvmmytid & ~pvmtidnmask);
  			if (rlen)
  				*rlen = info[1];
- #endif /*IMA_PGON*/
- #ifdef IMA_CM5
- 			if (rtag)
- 				*rtag = CMMD_msg_tag();
  			if (rtid)
! 				*rtid = CMMD_msg_sender() + (pvmmytid & ~pvmtidnmask);
  			if (rlen)
  				*rlen = CMMD_bytes_received();
! #endif /*IMA_CM5*/
! 		}
  		if (debugmask & TDMPACKET) {
! 			sprintf(pvmtxt, "pvm_precv() src t%x len %d tag %d\n",
  				node, len, tag);
  			pvmlogerror(pvmtxt);
  		}
  
! #else /*defined(IMA_PGON) || defined(IMA_CM5)*/
! 
  		rbf = pvm_setrbuf(0);
  		cc = pvm_recv(tid, tag);
  		if (cc > 0) {
--- 1503,1542 ----
  		if (PVMCRECV(node, tag, (char*)cp, len, my_ptype, info) < 0) {
  			pvmlogperror("precv() PVMCRECV");
  			cc = PvmSysErr;
! 			goto done;
! 		} 
! 
  #ifdef IMA_PGON
! 		tag = info[0];
! #endif 
! #ifdef IMA_CM5
! 		tag = CMMD_msg_tag();
! #endif 
! 		if (tag != PMTPACK) {
! 
! #ifdef IMA_PGON
  			if (rlen)
  				*rlen = info[1];
  			if (rtid)
! 				*rtid = info[2] + (pvmmytid & ~pvmtidnmask);
! #endif
! #ifdef IMA_CM5
  			if (rlen)
  				*rlen = CMMD_bytes_received();
! 			if (rtid)
! 				*rtid = CMMD_msg_sender() + (pvmmytid & ~pvmtidnmask);
! #endif
! 			if (rtag)
! 				*rtag = tag;
  		if (debugmask & TDMPACKET) {
! 				sprintf(pvmtxt, "pvm_precv() node %d len %d tag %d\n",
  				node, len, tag);
  			pvmlogerror(pvmtxt);
  		}
+ 		} else 
  
! #endif /*defined(IMA_PGON) || defined(IMA_CM5)*/
! 		{
  		rbf = pvm_setrbuf(0);
  		cc = pvm_recv(tid, tag);
  		if (cc > 0) {
***************
*** 1455,1463 ****
  			cc = 0;
  		}
  		pvm_setrbuf(rbf);
- 
- #endif /*defined(IMA_PGON) || defined(IMA_CM5)*/
  	}
  	if (cc < 0)
  		lpvmerr("pvm_precv", cc);
  	return cc;
--- 1550,1559 ----
  			cc = 0;
  		}
  		pvm_setrbuf(rbf);
  	}
+ 	}
+ 
+ done:
  	if (cc < 0)
  		lpvmerr("pvm_precv", cc);
  	return cc;
*** ../netlib/pvm3.3.4/src/lpvmpack.c	Fri Jun  3 17:15:27 1994
--- src/lpvmpack.c	Wed Nov  9 10:02:46 1994
***************
*** 32,37 ****
--- 32,41 ----
   *	Typed packing/unpacking, message buffer manip.
   *
  $Log: lpvmpack.c,v $
+  * Revision 1.5  1994/11/09  15:01:58  manchek
+  * pvm_pkstr and pvm_packf(%s) must fail with PvmNotImpl if PvmDataInPlace
+  * is used.
+  *
   * Revision 1.4  1994/06/03  21:15:12  manchek
   * oops, missed a bcopy
   *
***************
*** 97,103 ****
   **           **
   ***************/
  
! static char rcsid[] = "$Id: lpvmpack.c,v 1.4 1994/06/03 21:15:12 manchek Exp $";
  static char pvmtxt[512];				/* scratch for error log */
  
  
--- 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 */
  
  
***************
*** 2964,2969 ****
--- 2968,2974 ----
  	int cc;
  	long ad;
  	int x;
+ 	struct umbuf *up;
  
  	if (x = pvmtoplvl) {
  		pvmtoplvl = 0;
***************
*** 2976,2986 ****
  
  	if (pvmsbufmid <= 0)
  		cc = PvmNoBuf;
! 	else
! 		if (!(cc = (midtobuf(pvmsbufmid)->ub_codef->enc_int)
! 				((void*)&l, 1, 1, sizeof(int))))
! 			cc = (midtobuf(pvmsbufmid)->ub_codef->enc_byte)
! 					((void*)cp, l, 1, 1);
  
  	if (x) {
  		if (TEV_DO_TRACE(TEV_PKSTR1)) {
--- 2981,2996 ----
  
  	if (pvmsbufmid <= 0)
  		cc = PvmNoBuf;
! 	else {
! 		up = midtobuf(pvmsbufmid);
! 		if (up->ub_enc == 2)	/* oops, can't do this without a lot of grief */
! 			cc = PvmNotImpl;
! 		else
! 			if (!(cc = (up->ub_codef->enc_int)
! 					((void*)&l, 1, 1, sizeof(int))))
! 				cc = (up->ub_codef->enc_byte)
! 						((void*)cp, l, 1, 1);
! 	}
  
  	if (x) {
  		if (TEV_DO_TRACE(TEV_PKSTR1)) {
***************
*** 3041,3046 ****
--- 3051,3057 ----
  	int vh, vl, vu;			/* short, long, unsigned variety */
  	int isv;				/* param is a value not address */
  	struct encvec *codef;
+ 	struct umbuf *up;
  	char tc, *cp;			/* each type and a pointer */
  	short th, *hp;
  	int tn, *np;
***************
*** 3069,3075 ****
  		goto hork;
  	}
  
! 	codef = midtobuf(pvmsbufmid)->ub_codef;
  
  	while (*p) {
  		if (*p++ == '%') {
--- 3080,3087 ----
  		goto hork;
  	}
  
! 	up = midtobuf(pvmsbufmid);
! 	codef = up->ub_codef;
  
  	while (*p) {
  		if (*p++ == '%') {
***************
*** 3214,3226 ****
  				break;
  
  			case 's':
! 				cp = va_arg(ap, char *);
! 				cnt = strlen(cp) + 1;
! 				if (!(cc = (codef->enc_int) ((void*)&cnt, 1, 1, sizeof(int))))
! 					cc = (codef->enc_byte) ((void*)cp, cnt, 1, 1);
  #ifdef	DEBUGPACKF
! 				printf("string\n");
  #endif
  				break;
  
  			default:
--- 3226,3242 ----
  				break;
  
  			case 's':
! 				if (up->ub_enc == 2)	/* oops, can't do this */
! 					cc = PvmNotImpl;
! 				else {
! 					cp = va_arg(ap, char *);
! 					cnt = strlen(cp) + 1;
! 					if (!(cc = (codef->enc_int) ((void*)&cnt, 1, 1, sizeof(int))))
! 						cc = (codef->enc_byte) ((void*)cp, cnt, 1, 1);
  #ifdef	DEBUGPACKF
! 					printf("string\n");
  #endif
+ 				}
  				break;
  
  			default:
*** ../netlib/pvm3.3.4/src/lpvmshmem.c	Fri Jul  1 11:27:18 1994
--- src/lpvmshmem.c	Mon Nov  7 17:44:47 1994
***************
*** 32,37 ****
--- 32,43 ----
   *	Libpvm core for MPP environment.
   *
  $Log: lpvmshmem.c,v $
+  * Revision 1.4  1994/11/07  22:42:39  manchek
+  * general damage control and cleanup:
+  * initialize variables
+  * send null packets to wake up pvmd instead of reconnecting
+  * clean up on catching SIGTERM
+  *
   * Revision 1.3  1994/06/30  21:35:40  manchek
   * typo in peer_recv()
   *
***************
*** 57,62 ****
--- 63,69 ----
  #else
  #include <strings.h>
  #endif
+ #include <signal.h>
  #include <errno.h>
  #include <sys/ipc.h>
  #include <sys/shm.h>
***************
*** 170,176 ****
  int pvmudpmtu = MAXFRAGSIZE;			/* max fragment size */
  int pvmfrgsiz = MAXFRAGSIZE;			/* message frag length (to pack) */
  int pvm_useruid = -1;					/* user's uid */
! int shmbufsiz;							/* shared-memory buffer size */
  
  int pvm_errno = 0;						/* last libpvm error code */
  int pvm_nerr = sizeof(pvm_errlist)
--- 177,183 ----
  int pvmudpmtu = MAXFRAGSIZE;			/* max fragment size */
  int pvmfrgsiz = MAXFRAGSIZE;			/* message frag length (to pack) */
  int pvm_useruid = -1;					/* user's uid */
! int shmbufsiz = 0;						/* shared-memory buffer size */
  
  int pvm_errno = 0;						/* last libpvm error code */
  int pvm_nerr = sizeof(pvm_errlist)
***************
*** 188,201 ****
  Pvmtmask pvmtrcmask;                    /* trace bitmask */
  Pvmtmask pvmctrcmask;                   /* child trace bitmask */
  
! int pgsz;								/* system page size */
! int pvmpgsz;							/* PVM virtual page size */
! char *outmsgbuf;						/* my outgoing message buffer */
! int outbufsz;							/* how many frags in outgoing msg buf */
! struct pidtid *pidtids;					/* pid -> tid table */
! struct shmpghdr *globinfo;				/* global task info */
! char *infopage;							/* proto, NDF, pid-tid table */
! int maxpidtid;							/* size of pid-tid table */
  
  
  /***************
--- 195,211 ----
  Pvmtmask pvmtrcmask;                    /* trace bitmask */
  Pvmtmask pvmctrcmask;                   /* child trace bitmask */
  
! int pgsz = 0;							/* system page size */
! int pvmpgsz = 0;						/* PVM virtual page size */
! char *outmsgbuf = 0;					/* my outgoing message buffer */
! int outbufsz = 0;						/* how many frags in outgoing msg buf */
! struct pidtid *pidtids = 0;				/* pid -> tid table */
! #ifdef IMA_POWER4
! struct shmpghdr *globinfo = 0;			/* global task info */
! #endif
! char *infopage = 0;						/* proto, NDF, pid-tid table */
! int maxpidtid = 0;						/* size of pid-tid table */
! int debugmask = 0;						/* which debugging info */
  
  
  /***************
***************
*** 203,210 ****
   **           **
   ***************/
  
! static char rcsid[] = "$Id: lpvmshmem.c,v 1.3 1994/06/30 21:35:40 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 */
  static struct frag *rxbuf;				/* buffer for incoming packets */
--- 213,219 ----
   **           **
   ***************/
  
! static char rcsid[] = "$Id: lpvmshmem.c,v 1.4 1994/11/07 22:42:39 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,234 ****
  static struct sockaddr_in pvmdsad;		/* address of pvmd socket */
  static int pvmdsock = -1;				/* pvmd socket descriptor */
  
! static FILE  *logfp;					/* my own log file */
  
  static int pvmrouteopt = PvmDontRoute;	/* task-task routing style */
  
  
  /**************************
--- 235,246 ----
  static struct sockaddr_in pvmdsad;		/* address of pvmd socket */
  static int pvmdsock = -1;				/* pvmd socket descriptor */
  
! #ifdef LOG
! static FILE  *logfp = 0;				/* my own log file */
! #endif
  
  static int pvmrouteopt = PvmDontRoute;	/* task-task routing style */
+ static void (*pvmoldtermhdlr)() = 0;
  
  
  /**************************
***************
*** 352,362 ****
  }
  
  
! /* wake up pvmd */
  void
  prodpvmd()
  {
! 	/* int dummy = 1;	*/
  
  	if (pvmdsock == -1) {
  		if ((pvmdsock = socket(AF_INET, SOCK_STREAM, 0)) == -1) {
--- 364,379 ----
  }
  
  
! /*	prodpvmd()
! *
! *	wake up the pvmd, which is sleeping on sockets and not shared memory.
! *	XXX this sucks.
! */
! 
  void
  prodpvmd()
  {
! 	static char dummy[TDFRAGHDR];
  
  	if (pvmdsock == -1) {
  		if ((pvmdsock = socket(AF_INET, SOCK_STREAM, 0)) == -1) {
***************
*** 363,377 ****
  			pvmlogperror("prodpvmd() socket");
  			return;
  		}
! 		if (connect(pvmdsock, (struct sockaddr*)&pvmdsad, sizeof(pvmdsad)) 
  		== -1) {
  			pvmlogperror("prodpvmd() connect");
  			return;
  		}
  	} else {
! 	/*	write(dsock, &dummy, sizeof(int)); 	*/
! 		(void)close(pvmdsock);
! 		pvmdsock = -1;
  	}
  }
  
--- 380,394 ----
  			pvmlogperror("prodpvmd() socket");
  			return;
  		}
! 		if (connect(pvmdsock, (struct sockaddr*)&pvmdsad, sizeof(pvmdsad))
  		== -1) {
  			pvmlogperror("prodpvmd() connect");
  			return;
  		}
+ 		BZERO(dummy, sizeof(dummy));
+ 
  	} else {
! 		write(pvmdsock, &dummy, TDFRAGHDR);
  	}
  }
  
***************
*** 513,519 ****
  				break;
  		}
  
- 		/* if (block && !gotem && !txfp) { */
  		if (loopcount++ > BUSYWAIT && !txfp && tstop.tv_sec == -1) {
  			inbp->mb_sleep = 1;
  			(void)peer_wait();
--- 530,535 ----
***************
*** 523,529 ****
  
  /*
  #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) {
--- 539,545 ----
  
  /*
  #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) {
***************
*** 574,580 ****
  	src = inmsgs[next].ph_src;
  	fp = fr_new(0);
  	if ((src & ~pvmtidhmask) != TIDPVMD) {
! 		if (!(pp = peer_conn(src)) || pp == (struct peer *)-1) {
  			sprintf(pvmtxt, "mroute() can't connect to src t%x\n", 
  				inmsgs[next].ph_src);
  			pvmlogerror(pvmtxt);
--- 590,596 ----
  	src = inmsgs[next].ph_src;
  	fp = fr_new(0);
  	if ((src & ~pvmtidhmask) != TIDPVMD) {
! 		if (!(pp = peer_conn(src)) || pp == (struct peer *)-1L) {
  			sprintf(pvmtxt, "mroute() can't connect to src t%x\n", 
  				inmsgs[next].ph_src);
  			pvmlogerror(pvmtxt);
***************
*** 639,645 ****
  			LISTPUTBEFORE(pvmrxlist, rxup, ub_link, ub_rlink);
  			(*gotem)++;
  			/* XXX */
! 			if (rxup->ub_cod >= TC_FIRST && rxup->ub_cod <= TC_LAST) {
  				rxup = rxup->ub_rlink;
  				pvmmctl(rxup->ub_link);
  			}
--- 655,661 ----
  			LISTPUTBEFORE(pvmrxlist, rxup, ub_link, ub_rlink);
  			(*gotem)++;
  			/* XXX */
! 			if (rxup->ub_cod >= (int)TC_FIRST && rxup->ub_cod <= (int)TC_LAST) {
  				rxup = rxup->ub_rlink;
  				pvmmctl(rxup->ub_link);
  			}
***************
*** 674,679 ****
--- 690,696 ----
  	struct peer *pp;
  	struct shmpkhdr *dmsgs;	
  	struct msgboxhdr *dboxp;	/* receiving box of peer */
+ 	int onemsg = 1;
  
  	if (!txfp->fr_u.dab) {
  		pvmlogerror("InPlace not implemented!\n");
***************
*** 680,693 ****
  		return 0;
  	}
  #ifdef IMA_POWER4
! 	if ((dtid & ~pvmtidhmask) != TIDPVMD) {		/* to another task */
  #else
  	if ((dtid & pvmtidhmask) == (pvmmytid & pvmtidhmask)
! 	&& (dtid & ~pvmtidhmask) != TIDPVMD) {		/* to local task */
  #endif
  		if (!(pp = peer_conn(dtid)))
  			return 0;
! 		if (pp != (struct peer *)-1)
  			dboxp = (struct msgboxhdr *)pp->p_buf;
  		else
  			dboxp = (struct msgboxhdr *)pvmdinbox;
--- 697,711 ----
  		return 0;
  	}
  #ifdef IMA_POWER4
! 	if ((dtid & ~pvmtidhmask) != TIDPVMD)		/* to another task */
  #else
  	if ((dtid & pvmtidhmask) == (pvmmytid & pvmtidhmask)
! 	&& (dtid & ~pvmtidhmask) != TIDPVMD)		/* to local task */
  #endif
+ 	{
  		if (!(pp = peer_conn(dtid)))
  			return 0;
! 		if (pp != (struct peer *)-1L)
  			dboxp = (struct msgboxhdr *)pp->p_buf;
  		else
  			dboxp = (struct msgboxhdr *)pvmdinbox;
***************
*** 735,740 ****
--- 753,759 ----
  	pvmput8(txcp + 12, ff);
  	len += TDFRAGHDR;
  
+ /* XXX oh really, just kill me.  this tests whether the pg is private  -b */
  	if ((loc = txcp - outmsgbuf) > outbufsz*pvmpgsz || loc < 0) {
  
  		cp = 0;
***************
*** 741,748 ****
  		do {
  			if (cp)
  				da_unref(cp);
! 			/* if (debugmask & TDMPACKET) */
! 				pvmlogerror("peer_send(): outgoing buffer full\n");
  			cp = da_new(len	+ (DDFRAGHDR > TDFRAGHDR ? 
  				DDFRAGHDR - TDFRAGHDR : 0));
  		} while ((loc = cp - outmsgbuf) > outbufsz*pvmpgsz || loc < 0);	
--- 760,770 ----
  		do {
  			if (cp)
  				da_unref(cp);
! 			if (onemsg) {
! 				onemsg = 0;
! 				if (debugmask & TDMPACKET)
! 					pvmlogerror("peer_send(): outgoing buffer full\n");
! 			}
  			cp = da_new(len	+ (DDFRAGHDR > TDFRAGHDR ? 
  				DDFRAGHDR - TDFRAGHDR : 0));
  		} while ((loc = cp - outmsgbuf) > outbufsz*pvmpgsz || loc < 0);	
***************
*** 770,789 ****
  	da_ref(txfp->fr_buf);
  	PAGELOCK(&dboxp->mb_lock);
  	next = (dboxp->mb_last + 1) % pvminboxsz;
- /*
- #ifdef TEST_ADD
- 	while (next == TEST_ADD(&dboxp->mb_read,0)) {
- #else
- */
  	PAGEUNLOCK(&dboxp->mb_lock);
! 	while (next == dboxp->mb_read) {	/* full */
! 		;
! /*
! #endif
! 		PAGEUNLOCK(&dboxp->mb_lock);
! 		PAGELOCK(&dboxp->mb_lock);
! */
! 	}
  	PAGELOCK(&dboxp->mb_lock);
  	dmsgs[next].ph_src = pvmmytid;
  	dmsgs[next].ph_dst = dtid;
--- 792,799 ----
  	da_ref(txfp->fr_buf);
  	PAGELOCK(&dboxp->mb_lock);
  	next = (dboxp->mb_last + 1) % pvminboxsz;
  	PAGEUNLOCK(&dboxp->mb_lock);
! 	while (next == dboxp->mb_read) ;	/* full */
  	PAGELOCK(&dboxp->mb_lock);
  	dmsgs[next].ph_src = pvmmytid;
  	dmsgs[next].ph_dst = dtid;
***************
*** 906,911 ****
--- 916,932 ----
  }
  
  
+ static void
+ catch_kill(sig)
+ 	int sig;
+ {
+ 	if (pvmoldtermhdlr)
+ 		pvmoldtermhdlr(sig);
+ 	pvmendtask();
+ 	exit(sig);
+ }
+ 
+ 
  /*	pvmbeatask()
  *
  *	Initialize libpvm, config process as a task.
***************
*** 934,942 ****
  		struct semid_ds *buf;
  		ushort *array;
  	} sunion;
  
- char fname[32];
- 
  	if (pvmmytid != -1)
  		return 0;
  
--- 955,964 ----
  		struct semid_ds *buf;
  		ushort *array;
  	} sunion;
+ #ifdef LOG
+ 	char fname[32];
+ #endif
  
  	if (pvmmytid != -1)
  		return 0;
  
***************
*** 972,977 ****
--- 994,1001 ----
  	pvminboxsz = 
  		(INBOXPAGE*pgsz - sizeof(struct msgboxhdr))/sizeof(struct shmpkhdr);
  
+ 	pvmoldtermhdlr = signal(SIGTERM, catch_kill);
+ 
  	/*
  	*	initialize received-message list and fragment reassembly list
  	*/
***************
*** 991,997 ****
  		pvmlogperror("pvmbeatask() shmget: can't connect to pvmd");
  		return PvmSysErr;
  	}
! 	if ((pvmdinbox = (char *)shmat(bufid, 0, 0)) == (char *)-1) {
  		pvmlogperror("pvmbeatask() shmat pvmd");
  		return PvmSysErr;
  	}
--- 1015,1021 ----
  		pvmlogperror("pvmbeatask() shmget: can't connect to pvmd");
  		return PvmSysErr;
  	}
! 	if ((pvmdinbox = (char *)shmat(bufid, 0, 0)) == (char *)-1L) {
  		pvmlogperror("pvmbeatask() shmat pvmd");
  		return PvmSysErr;
  	}
***************
*** 1078,1088 ****
  		return PvmSysErr;
  	}
  #endif /*IMA_POWER4*/
! 	if ((pvminbox = (char *)shmat(myshmbufid, 0, 0)) == (char *)-1) {
  		pvmlogperror("pvmbeatask() shmat");
  		return PvmSysErr;
  	}
! #ifdef IMA_SGIMP
  	if ((mysemid = semget((key_t)pvmmytid, 1, IPC_CREAT|IPC_EXCL|PERMS)) == -1){
  		pvmlogperror("pvmbeatask() semget: can't create semaphore");
  		return PvmSysErr;
--- 1102,1112 ----
  		return PvmSysErr;
  	}
  #endif /*IMA_POWER4*/
! 	if ((pvminbox = (char *)shmat(myshmbufid, 0, 0)) == (char *)-1L) {
  		pvmlogperror("pvmbeatask() shmat");
  		return PvmSysErr;
  	}
! #if defined(IMA_SGIMP) || defined(IMA_SGIMP64) || defined(IMA_ALPHAMP)
  	if ((mysemid = semget((key_t)pvmmytid, 1, IPC_CREAT|IPC_EXCL|PERMS)) == -1){
  		pvmlogperror("pvmbeatask() semget: can't create semaphore");
  		return PvmSysErr;
***************
*** 1094,1100 ****
  		return PvmSysErr;
  	}
  */
! #endif /*IMA_SGIMP*/
  	outmsgbuf = pvminbox + INBOXPAGE*pgsz;
  	msgbufinit(pvminbox);
  	/* XXX PAGELOCK(pvminfo); */
--- 1118,1124 ----
  		return PvmSysErr;
  	}
  */
! #endif /*IMA_SGIMP || IMA_SGIMP64 || IMA_ALPHAMP*/
  	outmsgbuf = pvminbox + INBOXPAGE*pgsz;
  	msgbufinit(pvminbox);
  	/* XXX PAGELOCK(pvminfo); */
***************
*** 1111,1117 ****
  	char *p;
  	int i;
  	struct shmid_ds shmds;
- /*	union semun semunion;	*/
  
  	if (pvmsbufmid > 0)
  		umbuf_free(pvmsbufmid);
--- 1135,1140 ----
***************
*** 1118,1143 ****
  	if (pvmrbufmid > 0)
  		umbuf_free(pvmrbufmid);
  
! 	/* hang around until all outgoing messages are received */
! 	for (p = outmsgbuf, i = 0; i < bufpageused; i++, p += FRAGPAGE*pgsz) {
! /*
! #ifdef TEST_ADD
! 		while (TEST_ADD(&((struct shmpghdr *)p)->pg_ref,0))
! 			;
! #else
! 		PAGELOCK(&((struct shmpghdr *)p)->pg_lock);
! */
! 		while (((struct shmpghdr *)p)->pg_ref) {
! 			;
! /*
! 			PAGEUNLOCK(&((struct shmpghdr *)p)->pg_lock);
! 			PAGELOCK(&((struct shmpghdr *)p)->pg_lock);
! */
! 		}
! /*
! 		PAGEUNLOCK(&((struct shmpghdr *)p)->pg_lock);
! #endif
! */
  	}
  
  	/* PAGELOCK(pvminfo->i_pghd); */
--- 1141,1154 ----
  	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);
  	}
  
  	/* PAGELOCK(pvminfo->i_pghd); */
***************
*** 1149,1158 ****
  		pvmlogperror("pvmendtask() shmctl STAT");
  	if (shmds.shm_nattch == 0 &&
  */
  	shmdt((char*)globinfo);
  	if (shmctl(myshmbufid, IPC_RMID, (struct shmid_ds *)0) == -1)
  		pvmlogperror("pvmendtask() shmctl RMID");
! #ifdef IMA_SGIMP
  	if (semctl(mysemid, 0, IPC_RMID) == -1)
  		pvmlogperror("pvmendtask() semctl RMID");
  #endif
--- 1160,1171 ----
  		pvmlogperror("pvmendtask() shmctl STAT");
  	if (shmds.shm_nattch == 0 &&
  */
+ #ifdef IMA_POWER4
  	shmdt((char*)globinfo);
+ #endif
  	if (shmctl(myshmbufid, IPC_RMID, (struct shmid_ds *)0) == -1)
  		pvmlogperror("pvmendtask() shmctl RMID");
! #if defined(IMA_SGIMP) || defined(IMA_SGIMP64) || defined(IMA_ALPHAMP)
  	if (semctl(mysemid, 0, IPC_RMID) == -1)
  		pvmlogperror("pvmendtask() semctl RMID");
  #endif
***************
*** 1782,1795 ****
  		sprintf(fname, PVMSHMFILE, tid);
  		if ((fd = open(fname, O_CREAT|O_RDWR, 0600)) == -1 ||
  		(pp->p_dbuf = (char *)mmap(0, max(len,SHMBUFSIZE), PROT_READ|PROT_WRITE,
! #ifdef IMA_SGIMP
! 		MAP_SHARED|MAP_AUTOGROW, fd, 0)) == (char *)-1)
  #else
  		MAP_SHARED, fd, 0)) == (char *)-1)
  #endif
  		{
  			pvmlogperror(fname);
! 			return (char *)-1;
  		}
  #ifdef IMA_SUNMP
  		/* fill buffer with 0's */
--- 1795,1808 ----
  		sprintf(fname, PVMSHMFILE, tid);
  		if ((fd = open(fname, O_CREAT|O_RDWR, 0600)) == -1 ||
  		(pp->p_dbuf = (char *)mmap(0, max(len,SHMBUFSIZE), PROT_READ|PROT_WRITE,
! #if defined(IMA_SGIMP) || defined(IMA_SGIMP64)
! 		MAP_SHARED|MAP_AUTOGROW, fd, 0)) == (char *)-1L)
  #else
  		MAP_SHARED, fd, 0)) == (char *)-1)
  #endif
  		{
  			pvmlogperror(fname);
! 			return (char *)-1L;
  		}
  #ifdef IMA_SUNMP
  		/* fill buffer with 0's */
***************
*** 1805,1811 ****
  	} else if (pp->p_dlen < len) {
  		if ((fd = open(fname, O_CREAT|O_RDWR, 0600)) == -1) {
  			pvmlogperror(fname);
! 			return (char *)-1;
  		}
  		lseek(fd, len - 1, SEEK_SET);
  		write(fd, fname, 1);
--- 1818,1824 ----
  	} else if (pp->p_dlen < len) {
  		if ((fd = open(fname, O_CREAT|O_RDWR, 0600)) == -1) {
  			pvmlogperror(fname);
! 			return (char *)-1L;
  		}
  		lseek(fd, len - 1, SEEK_SET);
  		write(fd, fname, 1);
***************
*** 1877,1883 ****
  			char *dbuf;
  
  			len += sizeof(struct shmpghdr);
! 			if ((dbuf = dynbuf(tid, len)) != (char *)-1) {
  				BCOPY(cp, dbuf, len);
  
  			} else
--- 1890,1896 ----
  			char *dbuf;
  
  			len += sizeof(struct shmpghdr);
! 			if ((dbuf = dynbuf(tid, len)) != (char *)-1L) {
  				BCOPY(cp, dbuf, len);
  
  			} else
*** ../netlib/pvm3.3.4/src/pvmarchc.c	Sun Sep  4 16:25:30 1994
--- src/pvmarchc.c	Mon Nov  7 17:46:38 1994
***************
*** 32,37 ****
--- 32,40 ----
   *	Architecture classification.  Used to be archcode.c
   *
  $Log: pvmarchc.c,v $
+  * Revision 1.3  1994/11/07  22:46:08  manchek
+  * added classes SGI64, SGIMP64, SCO, SX3
+  *
   * Revision 1.2  1994/09/02  15:46:44  manchek
   * added CSPP, UXPM arches
   *
***************
*** 66,72 ****
  	struct nl *nl_next;
  };
  
! static char rcsid[] = "$Id: pvmarchc.c,v 1.2 1994/09/02 15:46:44 manchek Exp $";
  static char pvmtxt[512];				/* scratch for error log */
  static struct nl *morearches = 0;
  static int lastarch = 0;
--- 69,75 ----
  	struct nl *nl_next;
  };
  
! static char rcsid[] = "$Id: pvmarchc.c,v 1.3 1994/11/07 22:46:08 manchek Exp $";
  static char pvmtxt[512];				/* scratch for error log */
  static struct nl *morearches = 0;
  static int lastarch = 0;
***************
*** 87,97 ****
  	{"CNVX", 11}, {"CRAYSMP", 11}, {"CSPP", 11}, {"DGAV", 11}, {"E88K", 11},
  	{"HP300", 11}, {"HPPA", 11}, {"MIPS", 11}, {"NEXT", 11},
  	{"RS6K", 11}, {"POWER4", 11}, {"RT", 11}, {"SGI", 11}, {"SGI5", 11},
  	{"SGIMP", 11}, {"SUN3", 11}, {"SUN4", 11}, {"SUN4SOL2", 11},
  	{"SUNMP", 11}, {"TITN", 11},
  
  	{"BSD386", 12}, {"IPSC2", 12}, {"LINUX", 12}, {"MASPAR", 12},
! 	{"PMAX", 12}, {"SYMM", 12},
  
  	{"I860", 13}, {"PGON", 13},
  
--- 90,101 ----
  	{"CNVX", 11}, {"CRAYSMP", 11}, {"CSPP", 11}, {"DGAV", 11}, {"E88K", 11},
  	{"HP300", 11}, {"HPPA", 11}, {"MIPS", 11}, {"NEXT", 11},
  	{"RS6K", 11}, {"POWER4", 11}, {"RT", 11}, {"SGI", 11}, {"SGI5", 11},
+ 	{"SGI64", 11}, {"SGIMP64", 11},
  	{"SGIMP", 11}, {"SUN3", 11}, {"SUN4", 11}, {"SUN4SOL2", 11},
  	{"SUNMP", 11}, {"TITN", 11},
  
  	{"BSD386", 12}, {"IPSC2", 12}, {"LINUX", 12}, {"MASPAR", 12},
! 	{"PMAX", 12}, {"SCO", 12}, {"SYMM", 12},
  
  	{"I860", 13}, {"PGON", 13},
  
***************
*** 103,108 ****
--- 107,113 ----
  	{"VCM2", 19},
  	{"ALPHA", 20}, {"ALPHAMP", 20},
  	{"U370", 21}, {"UXPM", 21},
+ 	{"SX3", 22},
  	{"", 0}
  };
  
*** ../netlib/pvm3.3.4/src/pvmcruft.c	Mon Jul 18 16:06:48 1994
--- src/pvmcruft.c	Mon Nov  7 17:48:20 1994
***************
*** 32,37 ****
--- 32,40 ----
   *	Missing links and other wonk.
   *
  $Log: pvmcruft.c,v $
+  * Revision 1.5  1994/11/07  22:48:09  manchek
+  * added tweaks for SX3, SCO
+  *
   * Revision 1.4  1994/07/18  19:21:05  manchek
   * pvmputenv() matched variable name substrings (need to compare = too)
   *
***************
*** 84,90 ****
   **           **
   ***************/
  
! static char rcsid[] = "$Id: pvmcruft.c,v 1.4 1994/07/18 19:21:05 manchek Exp $";
  
  
  int
--- 87,93 ----
   **           **
   ***************/
  
! static char rcsid[] = "$Id: pvmcruft.c,v 1.5 1994/11/07 22:48:09 manchek Exp $";
  
  
  int
***************
*** 160,165 ****
--- 163,178 ----
  
  #else	/*IMA_TITN*/
  
+ #ifdef IMA_SX3
+ 
+ int
+ getdtablesize()
+ {
+ 	return 64*8;
+ }
+ 
+ #else /*IMA_SX3*/
+ 
  #include <unistd.h>
  
  int
***************
*** 168,178 ****
  	return sysconf(_SC_OPEN_MAX);
  }
  
  #endif	/*IMA_TITN*/
  
  #endif /*NOGETDTBLSIZ*/
  
! #if defined(IMA_TITN) || defined(I860_NODE) || defined(I860_SRM)
  int
  ffs(x)
  	int x;
--- 181,192 ----
  	return sysconf(_SC_OPEN_MAX);
  }
  
+ #endif /*IMA_SX3*/
  #endif	/*IMA_TITN*/
  
  #endif /*NOGETDTBLSIZ*/
  
! #if defined(IMA_TITN) || defined(I860_NODE) || defined(I860_SRM) || defined(IMA_SCO)
  int
  ffs(x)
  	int x;
*** ../netlib/pvm3.3.4/src/pvmd.c	Sun Sep  4 16:25:30 1994
--- src/pvmd.c	Tue Nov  8 14:05:12 1994
***************
*** 32,37 ****
--- 32,51 ----
   *	Mr. pvm daemon.
   *
  $Log: pvmd.c,v $
+  * Revision 1.19  1994/11/08  19:05:07  manchek
+  * mpp fix?
+  *
+  * Revision 1.18  1994/11/08  15:30:51  manchek
+  * shared memory cleanup
+  *
+  * Revision 1.17  1994/10/15  19:27:02  manchek
+  * make wrk_fds_init(), use instead of FD_ZERO.
+  * don't send FIN|ACK to ourself in bailout.
+  * don't clean up task until SIGCHLD if TF_FORKD set.
+  * check newhosts when deleting host.
+  * cast message tags for comparison as integers.
+  * in beprime() call task_init instead of trying to clean up
+  *
   * Revision 1.16  1994/09/02  15:48:17  manchek
   * added UXPM ifdef to parallel SUN4SOL2
   *
***************
*** 145,151 ****
  #endif
  #include "bfunc.h"
  
! #if defined(IMA_CRAY) || defined(IMA_CRAY2) || defined(IMA_I860) || defined(IMA_E88K)
  #ifndef	MAXPATHLEN
  #define	MAXPATHLEN	CANBSIZ
  #endif
--- 159,165 ----
  #endif
  #include "bfunc.h"
  
! #if defined(IMA_CRAY) || defined(IMA_CRAY2) || defined(IMA_I860) || defined(IMA_E88K) || defined(IMA_SCO)
  #ifndef	MAXPATHLEN
  #define	MAXPATHLEN	CANBSIZ
  #endif
***************
*** 207,212 ****
--- 221,227 ----
  extern int errno;
  
  extern struct task *locltasks;	/* from task.c */
+ extern int log_fd;				/* from logging.c */
  extern struct waitc *waitlist;	/* from waitc.c */
  
  char **epaths = 0;				/* exec search path */
***************
*** 246,252 ****
   **           **
   ***************/
  
! static char rcsid[] = "$Id: pvmd.c,v 1.16 1994/09/02 15:48:17 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 */
--- 261,267 ----
   **           **
   ***************/
  
! static char rcsid[] = "$Id: pvmd.c,v 1.19 1994/11/08 19:05:07 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 */
***************
*** 389,398 ****
  	BZERO((char*)deads, ndead * sizeof(struct deaddata));
  
  #ifndef IMA_I860 /* this signal interferes with getcube() on I860 */
! #ifndef	SYSVSIGNAL
! 	(void)signal(SIGCHLD, reap);
! #else
  	(void)signal(SIGCLD, reap);
  #endif
  #endif /*IMA_I860*/
  
--- 404,413 ----
  	BZERO((char*)deads, ndead * sizeof(struct deaddata));
  
  #ifndef IMA_I860 /* this signal interferes with getcube() on I860 */
! #ifdef	SYSVSIGNAL
  	(void)signal(SIGCLD, reap);
+ #else
+ 	(void)signal(SIGCHLD, reap);
  #endif
  #endif /*IMA_I860*/
  
***************
*** 527,532 ****
--- 542,559 ----
  #ifdef	SIGSYS
  	(void)signal(SIGSYS, SIG_DFL);
  #endif
+ 	(void)signal(SIGINT, SIG_DFL);
+ 	(void)signal(SIGTERM, SIG_DFL);
+ 	(void)signal(SIGHUP, SIG_DFL);
+ 	(void)signal(SIGPIPE, SIG_DFL);
+ #ifdef	SYSVSIGNAL
+ 	(void)signal(SIGCLD, SIG_DFL);
+ #else
+ 	(void)signal(SIGCHLD, SIG_DFL);
+ #endif
+ 
+ 	sprintf(pvmtxt, "evilsig() caught signal %d\n", sig);
+ 	pvmlogerror(pvmtxt);
  	i_dump(1);
  /*
  	abort();
***************
*** 653,659 ****
  		if (debugmask)
  			pvmlogerror("sending FIN|ACK to all pvmds\n");
  		for (hh = hosts->ht_last; hh >= 1; hh--)
! 			if (hp = hosts->ht_hosts[hh]) {
  				pvmput32(dummy, hp->hd_hostpart | TIDPVMD);
  				pvmput32(dummy + 4, myhostpart | TIDPVMD);
  				pvmput16(dummy + 8, 0);
--- 680,686 ----
  		if (debugmask)
  			pvmlogerror("sending FIN|ACK to all pvmds\n");
  		for (hh = hosts->ht_last; hh >= 1; hh--)
! 			if ((hp = hosts->ht_hosts[hh]) && hp->hd_hostpart != myhostpart) {
  				pvmput32(dummy, hp->hd_hostpart | TIDPVMD);
  				pvmput32(dummy + 4, myhostpart | TIDPVMD);
  				pvmput16(dummy + 8, 0);
***************
*** 675,680 ****
--- 702,718 ----
  }
  
  
+ wrk_fds_init()
+ {
+ 	wrk_nfds = 0;
+ 	FD_ZERO(&wrk_rfds);
+ 	FD_ZERO(&wrk_wfds);
+ /*
+ 	FD_ZERO(&wrk_efds);
+ */
+ }
+ 
+ 
  wrk_fds_add(fd, sets)
  	int fd;				/* the fd */
  	int sets;			/* which sets */
***************
*** 819,830 ****
  
  	/* init select fd sets */
  
! 	FD_ZERO(&wrk_rfds);
! 	FD_ZERO(&wrk_wfds);
! /*
! 	FD_ZERO(&wrk_efds);
! */
! 	wrk_nfds = 0;
  
  	if (loclsock >= 0)
  		wrk_fds_add(loclsock, 1);
--- 857,863 ----
  
  	/* init select fd sets */
  
! 	wrk_fds_init();
  
  	if (loclsock >= 0)
  		wrk_fds_add(loclsock, 1);
***************
*** 860,866 ****
  								(fd_set*)0, &tout) == 1)
  							loclstout(tp);
  					}
! #if defined(IMA_PGON) || defined(SHMEM)
  					mpp_free(tp->t_tid);
  #endif
  					task_cleanup(tp);
--- 893,899 ----
  								(fd_set*)0, &tout) == 1)
  							loclstout(tp);
  					}
! #if defined(IMA_PGON)
  					mpp_free(tp->t_tid);
  #endif
  					task_cleanup(tp);
***************
*** 1039,1047 ****
  									tp->t_tid);
  							pvmlogerror(pvmtxt);
  						}
! 						tp = tp->t_rlink;
! 						task_cleanup(tp->t_link);
! 						task_free(tp->t_link);
  						continue;
  					}
  				}
--- 1072,1084 ----
  									tp->t_tid);
  							pvmlogerror(pvmtxt);
  						}
! 						if (!(tp->t_flag & TF_FORKD)) {
! 							tp = tp->t_rlink;
! 							task_cleanup(tp->t_link);
! 							task_free(tp->t_link);
! 
! 						} else
! 							wrk_fds_delete(tp->t_sock, 3);
  						continue;
  					}
  				}
***************
*** 1050,1058 ****
  					FD_CLR(tp->t_sock, &wfds);
  					nrdy--;
  					if (locloutput(tp)) {
! 						tp = tp->t_rlink;
! 						task_cleanup(tp->t_link);
! 						task_free(tp->t_link);
  						continue;
  					}
  				}
--- 1087,1099 ----
  					FD_CLR(tp->t_sock, &wfds);
  					nrdy--;
  					if (locloutput(tp)) {
! 						if (!(tp->t_flag & TF_FORKD)) {
! 							tp = tp->t_rlink;
! 							task_cleanup(tp->t_link);
! 							task_free(tp->t_link);
! 
! 						} else
! 							wrk_fds_delete(tp->t_sock, 3);
  						continue;
  					}
  				}
***************
*** 1122,1127 ****
--- 1163,1170 ----
  			hd_dump(hp);
  			hostfailentry(hp);
  			ht_delete(hosts, hp);
+ 			if (newhosts)
+ 				ht_delete(newhosts, hp);
  			continue;
  		}
  
***************
*** 1184,1189 ****
--- 1227,1234 ----
  				if (hp != hosts->ht_hosts[0]) {
  					hostfailentry(hp);
  					ht_delete(hosts, hp);
+ 					if (newhosts)
+ 						ht_delete(newhosts, hp);
  				}
  			}
  			if (!((pp->pk_flag & FFDAT)
***************
*** 1261,1267 ****
  			pp->pk_max - (pp->pk_dat - pp->pk_buf),
  			0, (struct sockaddr*)&osad, &oslen)) == -1) {
  		if (errno != EINTR)
! 			pvmlogperror("netinput() recvfrom(loclsock)");
  		goto scrap;
  	}
  
--- 1306,1312 ----
  			pp->pk_max - (pp->pk_dat - pp->pk_buf),
  			0, (struct sockaddr*)&osad, &oslen)) == -1) {
  		if (errno != EINTR)
! 			pvmlogperror("netinput() recvfrom(netsock)");
  		goto scrap;
  	}
  
***************
*** 1338,1345 ****
  			pvmlogerror(pvmtxt);
  			hd_dump(hp);
  			hostfailentry(hp);
! 			if (hp->hd_hostpart)
  				ht_delete(hosts, hp);
  		}
  		goto scrap;
  	}
--- 1383,1393 ----
  			pvmlogerror(pvmtxt);
  			hd_dump(hp);
  			hostfailentry(hp);
! 			if (hp->hd_hostpart) {
  				ht_delete(hosts, hp);
+ 				if (newhosts)
+ 					ht_delete(newhosts, hp);
+ 			}
  		}
  		goto scrap;
  	}
***************
*** 2027,2035 ****
  	pp->pk_len -= TDFRAGHDR;
  	pp->pk_dat += TDFRAGHDR;
  	pp->pk_dst = dst = pvmget32(cp);
! #if defined(IMA_PGON) || defined(IMA_I860) || defined(IMA_CM5) || defined(SHMEM)
  	src = pvmget32(cp + 4);
! #if defined(IMA_PGON) || defined(IMA_I860) || defined(SHMEM)
  	if (!tp)                                /* from a node */
  #endif
  #if defined(IMA_CM5)
--- 2075,2083 ----
  	pp->pk_len -= TDFRAGHDR;
  	pp->pk_dat += TDFRAGHDR;
  	pp->pk_dst = dst = pvmget32(cp);
! #if defined(IMA_PGON) || defined(IMA_I860) || defined(IMA_CM5)
  	src = pvmget32(cp + 4);
! #if defined(IMA_PGON) || defined(IMA_I860)
  	if (!tp)                                /* from a node */
  #endif
  #if defined(IMA_CM5)
***************
*** 2044,2052 ****
  	} else
  		src = tp->t_tid;
  	pp->pk_src = src;
! #else	/*defined(IMA_PGON) || defined(IMA_I860) || defined(IMA_CM5) || defined(SHMEM)*/
  	pp->pk_src = src = tp->t_tid;
! #endif	/*defined(IMA_PGON) || defined(IMA_I860) || defined(IMA_CM5) || defined(SHMEM)*/
  	pp->pk_flag = ff = pvmget8(cp + 12);
  
  	if (debugmask & PDMPACKET) {
--- 2092,2100 ----
  	} else
  		src = tp->t_tid;
  	pp->pk_src = src;
! #else	/*defined(IMA_PGON) || defined(IMA_I860) || defined(IMA_CM5)*/
  	pp->pk_src = src = tp->t_tid;
! #endif	/*defined(IMA_PGON) || defined(IMA_I860) || defined(IMA_CM5)*/
  	pp->pk_flag = ff = pvmget8(cp + 12);
  
  	if (debugmask & PDMPACKET) {
***************
*** 2161,2167 ****
  			tp->t_rxm = 0;
  			if (!(dst & tidhmask) || (dst & tidhmask) == myhostpart) {	/* local */
  				mesg_rewind(mp);
! 				if (mp->m_cod >= SM_FIRST && mp->m_cod <= SM_LAST
  				&& (src == pvmschedtid || src == hostertid || src == taskertid))
  				{
  					schentry(mp);
--- 2209,2215 ----
  			tp->t_rxm = 0;
  			if (!(dst & tidhmask) || (dst & tidhmask) == myhostpart) {	/* local */
  				mesg_rewind(mp);
! 				if (mp->m_cod >= (int)SM_FIRST && mp->m_cod <= (int)SM_LAST
  				&& (src == pvmschedtid || src == hostertid || src == taskertid))
  				{
  					schentry(mp);
***************
*** 2257,2265 ****
  done:
  	if (pp)
  		pk_free(pp);
- #ifdef IMA_CM5
- 	tp = socktp;
- #endif
  
  	return 0;
  }
--- 2305,2310 ----
***************
*** 2689,2694 ****
--- 2734,2740 ----
  
  			task_setpid(tp, pid);
  			tp->t_out = pfd[0];
+ 			tp->t_flag |= TF_FORKD;
  
  			wrk_fds_add(tp->t_out, 1);
  			if (debugmask & PDMTASK) {
***************
*** 2721,2726 ****
--- 2767,2773 ----
  {
  	struct htab *htp;
  	struct task *tp;
+ 	int i;
  
  	runstate = PVMDPRIME;
  
***************
*** 2755,2773 ****
  	netsock = ppnetsock;
  	ppnetsock = -1;
  
! 	while ((tp = locltasks->t_link) != locltasks) {
! 		tp->t_outtid = 0;
! 		tp->t_trctid = 0;
! 		task_free(tp);
! 	}
  
! 	FD_ZERO(&wrk_rfds);
! 	FD_ZERO(&wrk_wfds);
! /*
! 	FD_ZERO(&wrk_efds);
! */
! 	wrk_nfds = 0;
  
  	wrk_fds_add(netsock, 1);
  
  	opq = pk_new(0);
--- 2802,2817 ----
  	netsock = ppnetsock;
  	ppnetsock = -1;
  
! 	locltasks = 0;
! 	task_init();
  
! 	/* close everything but netsock, log_fd and 0, 1, 2 */
  
+ 	for (i = getdtablesize(); --i > 2; )
+ 		if (i != netsock && i != log_fd)
+ 			(void)close(i);
+ 
+ 	wrk_fds_init();
  	wrk_fds_add(netsock, 1);
  
  	opq = pk_new(0);
*** ../netlib/pvm3.3.4/src/pvmdshmem.c	Sat Jun  4 17:43:07 1994
--- src/pvmdshmem.c	Tue Nov  8 10:35:12 1994
***************
*** 30,35 ****
--- 30,40 ----
   * pvmdshmem.c
   *
   * Shared-memory MPP interface.
+  *
+ $Log: pvmdshmem.c,v $
+  * Revision 1.3  1994/11/08  15:35:07  manchek
+  * shared memory damage control
+  *
   */
  
  
***************
*** 77,84 ****
  char *getenv();
  
  
- /* global */
- 
  extern int debugmask;			/* from pvmd.c */
  extern int pvm_useruid;			/* from pvmd.c */
  extern int mytid;				/* from pvmd.c */
--- 82,87 ----
***************
*** 87,116 ****
  extern int tidhmask;			/* from pvmd.c */
  extern int ourudpmtu;			/* from pvmd.c */
  extern int myunixpid;			/* from pvmd.c */
! extern struct task *locltasks;  /* from task.c */
  extern struct peer *peers;		/* from pvmshmem.c */
  
! char *outmsgbuf;				/* outgoing message buffer */
! int outbufsz;					/* size of outgoing msg buffer */
! int pgsz;						/* page size */
! int pvmpgsz;					/* PVM virtual page size */
! char *infopage;					/* proto, NDF, pid-tid table */
! struct pidtid *pidtids;			/* pid -> tid table */
! int maxpidtid;					/* size of pid-tid table */
! int shmbufsiz;					/* shared-memory buffer size */
  #ifdef IMA_POWER4
! struct shmpghdr *globinfo;		/* global task information */
  #endif
  
  
! /* private */
  
  static char pvmtxt[512];		/* scratch for error log */
! static char *inbox;				/* incoming message header buffer */
! static int inboxsz;				/* size of incoming message buffer */ 
  static struct pkt *ovfpkts = 0;	/* packets waiting to be delivered */
! static int mybufid;				/* shared-memory msg buffer ID */
! static int globid;				/* ID of global shared segment */
  
  
  /* 
--- 90,129 ----
  extern int tidhmask;			/* from pvmd.c */
  extern int ourudpmtu;			/* from pvmd.c */
  extern int myunixpid;			/* from pvmd.c */
! extern struct task *locltasks;	/* from task.c */
  extern struct peer *peers;		/* from pvmshmem.c */
  
! 
! /***************
!  **  Globals  **
!  **           **
!  ***************/
! 
! char *outmsgbuf = 0;			/* outgoing message buffer */
! int outbufsz = 0;				/* size of outgoing msg buffer */
! int pgsz = 0;					/* page size */
! int pvmpgsz = 0;				/* PVM virtual page size */
! char *infopage = 0;				/* proto, NDF, pid-tid table */
! struct pidtid *pidtids = 0;		/* pid -> tid table */
! int maxpidtid = 0;				/* size of pid-tid table */
! int shmbufsiz = 0;				/* shared-memory buffer size */
  #ifdef IMA_POWER4
! struct shmpghdr *globinfo = 0;	/* global task information */
  #endif
  
  
! /***************
!  **  Private  **
!  **           **
!  ***************/
  
+ 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 */ 
  static struct pkt *ovfpkts = 0;	/* packets waiting to be delivered */
! static int mybufid = -1;		/* shared-memory msg buffer ID */
! static int globid = -1;			/* ID of global shared segment */
  
  
  /* 
***************
*** 150,155 ****
--- 163,170 ----
  }
  */
  
+ /* XXX mpp_init() is a mess - it just returns if anything goes wrong */
+ 
  void
  mpp_init(argc, argv)
  	int *argc;
***************
*** 179,185 ****
  		pvmlogperror("mpp_init() can't create msg buffer");
  		return;
  	}
! 	if ((inbox = (char *)shmat(mybufid, 0, 0)) == (char *)-1) {
  		pvmlogperror("mpp_init() can't attach msg buffer");
  		return;
  	}
--- 194,200 ----
  		pvmlogperror("mpp_init() can't create msg buffer");
  		return;
  	}
! 	if ((inbox = (char *)shmat(mybufid, 0, 0)) == (char *)-1L) {
  		pvmlogperror("mpp_init() can't attach msg buffer");
  		return;
  	}
***************
*** 240,266 ****
  */
  }
  
  void
  mpp_free(tid)
  	int tid;
  {
! 	struct peer *pp, *pp2;
  
! 	for (pp = peers->p_link; pp != peers; ) {
! 		pp2 = pp;
! 		pp = pp->p_link;
!         if (pp2->p_tid == tid) 
! 			pp2->p_tid = -1;
! /*
! 			shmdt(pp2->p_buf);
! 			LISTDELETE(pp2, p_link, p_rlink);
! 			PVM_FREE(pp2);
! */
! 	}
! 	if (debugmask & PDMNODE) {
! 		sprintf(pvmtxt, "mpp_free() freed t%x\n", tid);
  		pvmlogerror(pvmtxt);
  	}
  }
  	
  
--- 255,286 ----
  */
  }
  
+ 
+ /*	mpp_free()
+ *
+ *	Remove shared memory segment of tid from peers list.  If we were
+ *	the only reference to it, delete it as well.
+ */
+ 
  void
  mpp_free(tid)
  	int tid;
  {
! 	struct peer *pp;
  
! 	if (debugmask & (PDMTASK|PDMNODE)) {
! 		sprintf(pvmtxt, "mpp_free() t%x\n", tid);
  		pvmlogerror(pvmtxt);
  	}
+ 
+ 	for (pp = peers->p_link; pp != peers; pp = pp->p_link) {
+ 		if (pp->p_tid == tid) {
+ 			peer_detach(pp);
+ 			LISTDELETE(pp, p_link, p_rlink);
+ 			PVM_FREE(pp);
+ 			break;
+ 		}
+ 	}
  }
  	
  
***************
*** 305,310 ****
--- 325,332 ----
  	}
  }
  						
+ /* XXX lazy cleanup sucks */
+ 
  static void
  removeshm(tid)
  int tid;
***************
*** 313,329 ****
  
  	if (!tid)
  		tid = tid_new() + 1;
  #ifdef IMA_POWER4
! 	while ((shmid = 
! 	shmget((key_t)tid, shmbufsiz, IPC_POWER4|IPC_CREAT|IPC_EXCL|PERMS))
! 	== -1) {
  #else
! 	while ((shmid = shmget((key_t)tid, shmbufsiz, IPC_CREAT|IPC_EXCL|PERMS))==-1
! #if defined(IMA_SGIMP) || defined(IMA_ALPHAMP)
  	|| (semid = semget((key_t)tid, 1, IPC_CREAT|IPC_EXCL|PERMS)) == -1
  #endif
! 	) {
  #endif
  		if (task_find(tid)) {
  			tid = tid_new() + 1;		/* skip */
  			continue;
--- 335,354 ----
  
  	if (!tid)
  		tid = tid_new() + 1;
+ 
  #ifdef IMA_POWER4
! 	while ((shmid = shmget((key_t)tid, shmbufsiz,
! 				IPC_POWER4|IPC_CREAT|IPC_EXCL|PERMS))
! 	== -1)
  #else
! 	while ((shmid = shmget((key_t)tid, shmbufsiz, IPC_CREAT|IPC_EXCL|PERMS))
! 	== -1
! #if defined(IMA_SGIMP) || defined(IMA_SGIMP64) || defined(IMA_ALPHAMP)
  	|| (semid = semget((key_t)tid, 1, IPC_CREAT|IPC_EXCL|PERMS)) == -1
  #endif
! 	)
  #endif
+ 	{
  		if (task_find(tid)) {
  			tid = tid_new() + 1;		/* skip */
  			continue;
***************
*** 331,346 ****
  		/* if ((shmid = shmget((key_t)tid, shmbufsiz, PERMS)) == -1  */
  #ifdef IMA_POWER4
  		if ((shmid = shmget((key_t)tid, 0, IPC_POWER4|PERMS)) == -1 
! 		|| shmctl(shmid, IPC_RMID, (struct shmid_ds *)0) == -1) {
  #else
  		if (shmid == -1 && ((shmid = shmget((key_t)tid, 0, PERMS)) == -1 
! 		|| shmctl(shmid, IPC_RMID, (struct shmid_ds *)0) == -1)) {
  #endif
  			sprintf(pvmtxt, "removeshm: shm key = %x", tid);
  			pvmlogperror(pvmtxt);
  			tid = tid_new() + 1;
  		} 
! #if defined(IMA_SGIMP) || defined(IMA_ALPHAMP)
  		if (semid == -1 && ((semid = semget((key_t)tid, 0, PERMS)) == -1
  		|| semctl(semid, 0, IPC_RMID) == -1)) {
  			sprintf(pvmtxt, "removeshm: sem key = %x", tid);
--- 356,372 ----
  		/* if ((shmid = shmget((key_t)tid, shmbufsiz, PERMS)) == -1  */
  #ifdef IMA_POWER4
  		if ((shmid = shmget((key_t)tid, 0, IPC_POWER4|PERMS)) == -1 
! 		|| shmctl(shmid, IPC_RMID, (struct shmid_ds *)0) == -1)
  #else
  		if (shmid == -1 && ((shmid = shmget((key_t)tid, 0, PERMS)) == -1 
! 		|| shmctl(shmid, IPC_RMID, (struct shmid_ds *)0) == -1))
  #endif
+ 		{
  			sprintf(pvmtxt, "removeshm: shm key = %x", tid);
  			pvmlogperror(pvmtxt);
  			tid = tid_new() + 1;
  		} 
! #if defined(IMA_SGIMP) || defined(IMA_SGIMP64) || defined(IMA_ALPHAMP)
  		if (semid == -1 && ((semid = semget((key_t)tid, 0, PERMS)) == -1
  		|| semctl(semid, 0, IPC_RMID) == -1)) {
  			sprintf(pvmtxt, "removeshm: sem key = %x", tid);
***************
*** 441,446 ****
--- 467,473 ----
  				tp = task_new(tid);
  				task_setpid(tp, src);
  				mpp_conn(tp);
+ 
  			} else if (tp->t_pid != src)
  				task_setpid(tp, src);
  			tp->t_flag |= TF_CONN;
***************
*** 452,458 ****
  			continue;
  		}
  
! 		if (!(pe = peer_conn(src)) || pe == (struct peer *)-1) {
  			sprintf(pvmtxt, "mpp_input() can't connect to src t%x\n", src);
  			pvmlogerror(pvmtxt);
  			return;
--- 479,485 ----
  			continue;
  		}
  
! 		if (!(pe = peer_conn(src)) || pe == (struct peer *)-1L) {
  			sprintf(pvmtxt, "mpp_input() can't connect to src t%x\n", src);
  			pvmlogerror(pvmtxt);
  			return;
***************
*** 463,471 ****
  		ff = inmsgs[next].ph_flag;
  		/* dst = pvmget32(cp); */
  		len = pvmget32(cp + 8) + TDFRAGHDR;
! /*
! 		if ((dst & ~tidhmask) != TIDPVMD && (dst & tidhmask) == myhostpart) {
! */
  		if ((dst & ~tidhmask) != TIDPVMD) {
  			pp = pk_new(len);
  			BCOPY(cp, pp->pk_dat, len);
--- 490,496 ----
  		ff = inmsgs[next].ph_flag;
  		/* dst = pvmget32(cp); */
  		len = pvmget32(cp + 8) + TDFRAGHDR;
! 
  		if ((dst & ~tidhmask) != TIDPVMD) {
  			pp = pk_new(len);
  			BCOPY(cp, pp->pk_dat, len);
***************
*** 473,478 ****
--- 498,504 ----
  			cp = pp->pk_dat;
  			pvmput32(cp, dst);
  			pvmput8(cp + 12, ff);
+ 
  		} else {
  			pp = pk_new(0);
  			pp->pk_dat = cp;
***************
*** 480,501 ****
  			pp->pk_max = ourudpmtu;
  		}
  		pp->pk_len = len;
! /*
! 		pp->pk_buf = pp->pk_dat = cp;
! 		pp->pk_max = pp->pk_len = len;
! 		if (DDFRAGHDR > TDFRAGHDR) {
! 			pp->pk_buf -= DDFRAGHDR - TDFRAGHDR;
! 			pp->pk_max -= DDFRAGHDR - TDFRAGHDR;
  		}
- */
  
- 		loclinpkt(0, pp);
- /*
- #ifdef TEST_ADD
- 	} while ((inbp->mb_read = next) != TEST_ADD(&inbp->mb_last,0));
- #else
- 		PAGELOCK(&inbp->mb_lock);
- */
  	} while ((inbp->mb_read = next) != inbp->mb_last);
  /*
  	PAGEUNLOCK(&inbp->mb_lock);
--- 506,525 ----
  			pp->pk_max = ourudpmtu;
  		}
  		pp->pk_len = len;
! 
! 		if (tp = task_find(src)) {
! 			loclinpkt(tp, pp);
! 			if ((tp->t_flag & TF_CLOSE) && !(tp->t_flag & TF_FORKD)) {
! 				task_cleanup(tp);
! 				task_free(tp);
! 			}
! 
! 		} else {
! 			sprintf(pvmtxt, "mpp_input() from unknown task t%x\n", src);
! 			pvmlogerror(pvmtxt);
! 			pk_free(pp);
  		}
  
  	} while ((inbp->mb_read = next) != inbp->mb_last);
  /*
  	PAGEUNLOCK(&inbp->mb_lock);
***************
*** 517,529 ****
  	char *cp;
  	int loc;
  	int next;
  
  	dst = pp->pk_dst;
  	if ((loc = pp->pk_dat - outmsgbuf) > outbufsz*pvmpgsz || loc < 0) {
  		cp = 0;
  		do {
! 			/* if (debugmask & PDMPACKET)	*/
! 				pvmlogerror("mpp_output() outgoing buffer full?\n");
  			if (cp)
  				da_unref(cp);
  			cp = da_new(max(DDFRAGHDR,TDFRAGHDR) + pp->pk_len);
--- 541,559 ----
  	char *cp;
  	int loc;
  	int next;
+ 	int onemsg = 1;
  
  	dst = pp->pk_dst;
  	if ((loc = pp->pk_dat - outmsgbuf) > outbufsz*pvmpgsz || loc < 0) {
  		cp = 0;
+ /* XXX this loop wants a shared page.  gosh, won't it hang if two
+    XXX tasks are trying to send and both get here.  i think so. -b */
  		do {
! 			if (onemsg) {
! 				onemsg = 0;
! 				if (debugmask & PDMPACKET)
! 					pvmlogerror("mpp_output() outgoing buffer full?\n");
! 			}
  			if (cp)
  				da_unref(cp);
  			cp = da_new(max(DDFRAGHDR,TDFRAGHDR) + pp->pk_len);
***************
*** 541,547 ****
  		/* pk_free(pp); */
  	}
  
! 	if ((pe = peer_conn(dst)) && pe != (struct peer *)-1) {
  		dboxp = (struct msgboxhdr *)pe->p_buf;
  		dmsgs = (struct shmpkhdr *)(dboxp + 1);
  		PAGELOCK(&dboxp->mb_lock);
--- 571,577 ----
  		/* pk_free(pp); */
  	}
  
! 	if ((pe = peer_conn(dst)) && pe != (struct peer *)-1L) {
  		dboxp = (struct msgboxhdr *)pe->p_buf;
  		dmsgs = (struct shmpkhdr *)(dboxp + 1);
  		PAGELOCK(&dboxp->mb_lock);
***************
*** 548,554 ****
  /*
  #ifdef TEST_ADD
  		if ((next = (dboxp->mb_last + 1) % inboxsz) 
! 		!= TEST_ADD(&dboxp->mb_read,0)) {
  #else
  */
  		if ((next = (dboxp->mb_last + 1) % inboxsz) != dboxp->mb_read) {
--- 578,584 ----
  /*
  #ifdef TEST_ADD
  		if ((next = (dboxp->mb_last + 1) % inboxsz) 
! 		!= TEST_ADD(&dboxp->mb_read,0))
  #else
  */
  		if ((next = (dboxp->mb_last + 1) % inboxsz) != dboxp->mb_read) {
***************
*** 592,604 ****
  		
  done:
  	pk_free(pp);
- 	if (tp->t_flag & TF_CLOSE) {
- 		mpp_free(tp->t_tid);
- 		tp = tp->t_rlink;
- /* XXX tm_exit() also calls task_cleanup(); should only be done once */
- 		task_cleanup(tp->t_link);
- 		task_free(tp->t_link);
- 	}
  }
  
  
--- 622,627 ----
***************
*** 640,645 ****
--- 663,669 ----
  		}
  	if (pp3)
  		pk_free(pp3);
+ 	return 0;
  }
  
  
***************
*** 694,699 ****
--- 718,724 ----
  /* #endif	*/
  }
  
+ 
  void
  mpp_cleanup()
  {
***************
*** 700,722 ****
  	struct peer *pp;
  	struct shmid_ds shmds;
  
! 	shmdt(inbox);
! 	if (shmctl(mybufid, IPC_RMID, (struct shmid_ds *)0) == -1)
! 		pvmlogperror("mpp_cleanup() shmctl mybuf");
  #ifdef IMA_POWER4
! 	shmdt((char*)globinfo);
! 	if (shmctl(globid, IPC_STAT, &shmds) == -1)
! 		pvmlogperror("mpp_cleanup() shmctl IPC_STAT globinfo");
! 	if (shmds.shm_nattch == 0 
! 	&& shmctl(globid, IPC_RMID, (struct shmid_ds *)0) == -1)
! 		pvmlogperror("mpp_cleanup() shmctl IPC_RMID globinfo");
  #endif
! 	for (pp = peers->p_link; pp != peers; pp = pp->p_link) {
! 		shmdt(pp->p_buf);
! 		if (pp->p_tid != -1 && 
! 		shmctl(pp->p_shmid, IPC_RMID, (struct shmid_ds *)0) == -1) {
! 			sprintf(pvmtxt, "shmctl: key = %x", pp->p_tid);
! 			pvmlogperror(pvmtxt);
  		}
  	}
  }
--- 725,760 ----
  	struct peer *pp;
  	struct shmid_ds shmds;
  
! 	if (inbox && shmdt(inbox) == -1)
! 		pvmlogperror("mpp_cleanup() shmdt inbox");
! 
! 	if (mybufid != -1 && shmctl(mybufid, IPC_RMID, (struct shmid_ds *)0) == -1)
! 		pvmlogperror("mpp_cleanup() shmctl IPC_RMID mybuf");
! 
  #ifdef IMA_POWER4
! 	if (globinfo) {
! 		shmdt((char*)globinfo);
! 		if (globid != -1) {
! 			if (shmctl(globid, IPC_STAT, &shmds) == -1)
! 				pvmlogperror("mpp_cleanup() shmctl IPC_STAT globinfo\n");
! 			else
! 				if (shmds.shm_nattch == 0
! 				&& shmctl(globid, IPC_RMID, (struct shmid_ds *)0) == -1)
! 					pvmlogperror("mpp_cleanup() shmctl IPC_RMID globinfo\n");
! 		}
! 	}
  #endif
! 
! 	if (peers) {
! 		for (pp = peers->p_link; pp != peers; pp = pp->p_link) {
! 			shmdt(pp->p_buf);
! 			if (pp->p_tid != -1 &&
! 			shmctl(pp->p_shmid, IPC_RMID, (struct shmid_ds *)0) == -1) {
! 				sprintf(pvmtxt, "shmctl: key = %x", pp->p_tid);
! 				pvmlogperror(pvmtxt);
! 			}
  		}
  	}
  }
+ 
+ 
*** ../netlib/pvm3.3.4/src/pvmmimd.h	Fri Jun  3 16:38:26 1994
--- src/pvmmimd.h	Tue Nov  8 14:19:26 1994
***************
*** 30,35 ****
--- 30,38 ----
   *  pvmmimd.h
   *
  $Log: pvmmimd.h,v $
+  * Revision 1.4  1994/11/08  19:19:23  manchek
+  * mpp fixes
+  *
   * Revision 1.3  1994/06/03  20:38:25  manchek
   * version 3.3.0
   *
***************
*** 77,83 ****
  	CMMD_send_noblock((int)(dest),tag,buf,len)
  #define PVMCRECV(src,tag,buf,len,ptype,info) \
  	CMMD_receive_block((int)src,tag,buf,len)
! #define MSGPROBE()		CMMD_msg_pending(CMMD_ANY_NODE,CMMD_ANY_TAG)
  #define NUMSMIDS	90			/* the CM5 has about 100 message IDs */
  
  #endif /*IMA_CM5*/
--- 80,86 ----
  	CMMD_send_noblock((int)(dest),tag,buf,len)
  #define PVMCRECV(src,tag,buf,len,ptype,info) \
  	CMMD_receive_block((int)src,tag,buf,len)
! #define MSGPROBE(tag)	CMMD_msg_pending(CMMD_ANY_NODE,tag)
  #define NUMSMIDS	90			/* the CM5 has about 100 message IDs */
  
  #endif /*IMA_CM5*/
***************
*** 89,95 ****
  #define MSGSIZE(mid)	_infocount()
  #define MSGSENDER(mid)	_infonode()
  #define MSGTAG(mid)		_infotype()
! #define MSGPROBE()		_iprobe(-1)
  #define ASYNCRECV(buf,len)					_irecv((long)recvmask,buf,(long)len)
  #define ASYNCSEND(tag,buf,len,dest,ptype)	_isend(tag,buf,(long)len,dest,ptype)
  #define PVMCSEND(tag,buf,len,dest,ptype)	_csend(tag,buf,(long)len,dest,ptype)
--- 92,98 ----
  #define MSGSIZE(mid)	_infocount()
  #define MSGSENDER(mid)	_infonode()
  #define MSGTAG(mid)		_infotype()
! #define MSGPROBE(tag)	_iprobe(tag)
  #define ASYNCRECV(buf,len)					_irecv((long)recvmask,buf,(long)len)
  #define ASYNCSEND(tag,buf,len,dest,ptype)	_isend(tag,buf,(long)len,dest,ptype)
  #define PVMCSEND(tag,buf,len,dest,ptype)	_csend(tag,buf,(long)len,dest,ptype)
***************
*** 104,113 ****
  #endif /*IMA_PGON/IMA_I860*/
  
  #ifdef IMA_PGON
! #define PVMCRECV(src,tag,buf,len,ptype,info) _crecvx(tag,buf,len,src,ptype,info)
  #endif
  #ifdef IMA_I860
! #define PVMCRECV(src,tag,buf,len,ptype,info) _crecv(tag,buf,len)
  #endif
  
  /* nodes in use */
--- 107,117 ----
  #endif /*IMA_PGON/IMA_I860*/
  
  #ifdef IMA_PGON
! #define PVMCRECV(src,tag,buf,len,ptype,info) \
! 	_crecvx(tag,buf,(long)len,src,ptype,info)
  #endif
  #ifdef IMA_I860
! #define PVMCRECV(src,tag,buf,len,ptype,info) _crecv(tag,buf,(long)len)
  #endif
  
  /* nodes in use */
***************
*** 148,156 ****
  
  /* pvm internal message types */
  
! #define PMTDN		999999001	/* pvmd to node */
! #define PMTND		999999002	/* node to pvmd */
! #define PMTNN		999999003	/* node to node */
! #define PMTHOST		999999004	/* broadcast myhostpart to all nodes */
! #define PMTMCAST	999999005	/* broadcast multicast packets to all nodes */
! #define PMTPHYS		999999006	/* (iPSC/860) msg containing physical node # */
--- 152,157 ----
  
  /* pvm internal message types */
  
! #define PMTPACK		999999001	/* packed messages */
! #define PMTHOST		(PMTPACK+1)	/* broadcast myhostpart to all nodes */
! #define PMTPHYS		(PMTPACK+2)	/* (iPSC/860) msg containing physical node # */
*** ../netlib/pvm3.3.4/src/pvmshmem.c	Sat Jun  4 17:44:26 1994
--- src/pvmshmem.c	Tue Nov  8 10:36:54 1994
***************
*** 32,37 ****
--- 32,40 ----
   *  Shared-memory stuff.
   *
  $Log: pvmshmem.c,v $
+  * Revision 1.3  1994/11/08  15:36:49  manchek
+  * shared memory damage control
+  *
   * Revision 1.2  1994/06/04  21:44:25  manchek
   * updated header
   *
***************
*** 61,66 ****
--- 64,70 ----
  #define min(a,b)	((a)<(b)?(a):(b))
  #endif
  
+ extern int debugmask;				/* from pvmd.c or lpvmshmem.c */
  extern int pvmpgsz;					/* from pvmdshmem.c or lpvmshmem.c */
  extern int pgsz;					/* from pvmdshmem.c or lpvmshmem.c */
  extern char *outmsgbuf;				/* from pvmdshmem.c or lpvmshmem.c */
***************
*** 69,85 ****
  extern struct pidtid *pidtids;		/* from pvmdshmem.c or lpvmshmem.c */
  extern int maxpidtid;				/* from pvmdshmem.c or lpvmshmem.c */
  extern int shmbufsiz;				/* from pvmdshmem.c or lpvmshmem.c */
  extern struct shmpghdr *globinfo;	/* from pvmdshmem.c or lpvmshmem.c */
  
! struct peer *peers;					/* tasks we're connected to */
  int bufpageused = 0;				/* number of dirty pages in msg buf */
  
! /* private */
  static char pvmtxt[512];			/* scratch for error log */
  static int nxtpage = 0;				/* next free page in outgoing msg buf */
  
  
! /* Shared-memory data buffer manip. routines */
  
  /* initialize shared-memory msg buffer */
  int
--- 73,106 ----
  extern struct pidtid *pidtids;		/* from pvmdshmem.c or lpvmshmem.c */
  extern int maxpidtid;				/* from pvmdshmem.c or lpvmshmem.c */
  extern int shmbufsiz;				/* from pvmdshmem.c or lpvmshmem.c */
+ #ifdef IMA_POWER4
  extern struct shmpghdr *globinfo;	/* from pvmdshmem.c or lpvmshmem.c */
+ #endif
  
! 
! /***************
!  **  Globals  **
!  **           **
!  ***************/
! 
! struct peer *peers = 0;				/* tasks we're connected to */
  int bufpageused = 0;				/* number of dirty pages in msg buf */
  
! 
! /***************
!  **  Private  **
!  **           **
!  ***************/
! 
! static char rcsid[] = "$Id: pvmshmem.c,v 1.3 1994/11/08 15:36:49 manchek Exp $";
  static char pvmtxt[512];			/* scratch for error log */
  static int nxtpage = 0;				/* next free page in outgoing msg buf */
  
  
! /*******************************************************
!  **  Shared-memory data buffer manipulation routines  **
!  **                                                   **
!  *******************************************************/
  
  /* initialize shared-memory msg buffer */
  int
***************
*** 105,110 ****
--- 126,141 ----
  		((struct shmpghdr *)p)->pg_priv = 0;
  		((struct shmpghdr *)p)->pg_ref = 0;
  	}
+ 
+ 	if (debugmask & PDMNODE) {
+ 		sprintf(pvmtxt, "msgbufinit() outmsgbuf=0x%x\n", outmsgbuf);
+ 		pvmlogerror(pvmtxt);
+ 		sprintf(pvmtxt, "msgbufinit() last buffer=0x%x\n", p - pvmpgsz);
+ 		pvmlogerror(pvmtxt);
+ 		sprintf(pvmtxt, "msgbufinit() pvmpgsz=%d\n", pvmpgsz);
+ 		pvmlogerror(pvmtxt);
+ 	}
+ 	return 0;
  }
  
  /* 
***************
*** 119,131 ****
  	char *p;
  	int start;
  
- /*
  	if (len > pvmpgsz - PVMPAGEHDR) {
  		sprintf(pvmtxt, "da_new() len = %d: frag must fit in a page\n", len);
  		pvmlogerror(pvmtxt);
  		return 0;
  	}
! */
  	p = outmsgbuf;
  	if (nxtpage && !((struct shmpghdr *)p)->pg_ref)
  		nxtpage = 0;		/* recycle to avoid page fault */
--- 150,161 ----
  	char *p;
  	int start;
  
  	if (len > pvmpgsz - PVMPAGEHDR) {
  		sprintf(pvmtxt, "da_new() len = %d: frag must fit in a page\n", len);
  		pvmlogerror(pvmtxt);
  		return 0;
  	}
! 
  	p = outmsgbuf;
  	if (nxtpage && !((struct shmpghdr *)p)->pg_ref)
  		nxtpage = 0;		/* recycle to avoid page fault */
***************
*** 136,144 ****
  	while (((struct shmpghdr *)p)->pg_ref) {
  		if (++nxtpage == outbufsz) {
  			nxtpage = 0;
! 			p = outmsgbuf + PVMPAGEHDR;
  		} else
  			p += pvmpgsz;
  		if (nxtpage == start) {		/* buffer full */
  			p = TALLOC(len + PVMPAGEHDR, char, "data");
  			if (p) {
--- 166,176 ----
  	while (((struct shmpghdr *)p)->pg_ref) {
  		if (++nxtpage == outbufsz) {
  			nxtpage = 0;
! 			p = outmsgbuf;
! 
  		} else
  			p += pvmpgsz;
+ 
  		if (nxtpage == start) {		/* buffer full */
  			p = TALLOC(len + PVMPAGEHDR, char, "data");
  			if (p) {
***************
*** 156,161 ****
--- 188,194 ----
  	if (p)
  		((struct shmpghdr *)p)->pg_ref = 1;
  
+ /* XXX this returns nonzero if it fails, yuck */
  	return (p + PVMPAGEHDR);
  }
  
***************
*** 180,186 ****
  {
  	p -= PVMPAGEHDR;
  #ifdef TEST_ADD
! 	if (TEST_ADD(&((struct shmpghdr *)p)->pg_ref, -1) < 0)
  		pvmlogerror("ref count is negative!\n");
  #else
  	PAGELOCK(&((struct shmpghdr *)p)->pg_lock);
--- 213,219 ----
  {
  	p -= PVMPAGEHDR;
  #ifdef TEST_ADD
! 	if (TEST_ADD(&((struct shmpghdr *)p)->pg_ref, -1L) < 0)
  		pvmlogerror("ref count is negative!\n");
  #else
  	PAGELOCK(&((struct shmpghdr *)p)->pg_lock);
***************
*** 205,210 ****
--- 238,245 ----
  }
  
  /* attach peer's msg buffer; disconnect from inactive peers */
+ /* XXX this is a vicious hack - lazy cleanup -b */
+ 
  struct peer *
  peer_conn(tid)
  	int tid;
***************
*** 235,245 ****
  				if (globtasks[i].gt_stat == ST_NOTREADY)
  					return (struct peer *)0;
  				if (globtasks[i].gt_stat == ST_SOCKET)
! 					return (struct peer *)-1;
  				break;
  			}
  		if (!globtasks[i].gt_tid)
! 			return (struct peer *)-1;
  
  		if ((bufid = shmget((key_t)tid, shmbufsiz, IPC_POWER4)) == -1) {
  #else
--- 270,280 ----
  				if (globtasks[i].gt_stat == ST_NOTREADY)
  					return (struct peer *)0;
  				if (globtasks[i].gt_stat == ST_SOCKET)
! 					return (struct peer *)-1L;
  				break;
  			}
  		if (!globtasks[i].gt_tid)
! 			return (struct peer *)-1L;
  
  		if ((bufid = shmget((key_t)tid, shmbufsiz, IPC_POWER4)) == -1) {
  #else
***************
*** 250,260 ****
  				if (pidtids[i].pt_stat == ST_NOTREADY)
  					return (struct peer *)0;
  				if (pidtids[i].pt_stat == ST_SOCKET)
! 					return (struct peer *)-1;
  				break;
  			}
  		if (i == ntids)
! 			return (struct peer *)-1;
  		/* PAGEUNLOCK(pvminfo); */
  
  		if ((bufid = shmget((key_t)tid, shmbufsiz, 0)) == -1) {
--- 285,295 ----
  				if (pidtids[i].pt_stat == ST_NOTREADY)
  					return (struct peer *)0;
  				if (pidtids[i].pt_stat == ST_SOCKET)
! 					return (struct peer *)-1L;
  				break;
  			}
  		if (i == ntids)
! 			return (struct peer *)-1L;
  		/* PAGEUNLOCK(pvminfo); */
  
  		if ((bufid = shmget((key_t)tid, shmbufsiz, 0)) == -1) {
***************
*** 265,271 ****
  			/* } */
  			return (struct peer *)0;
  		}
! 		while ((p = (char *)shmat(bufid, 0, 0)) == (char *)-1) {
  			sprintf(pvmtxt, "peer_conn() shmat to t%x", tid);
  			pvmlogperror(pvmtxt);
  			if (errno == EMFILE && (pp = peers->p_rlink) != peers) {
--- 300,306 ----
  			/* } */
  			return (struct peer *)0;
  		}
! 		while ((p = (char *)shmat(bufid, 0, 0)) == (char *)-1L) {
  			sprintf(pvmtxt, "peer_conn() shmat to t%x", tid);
  			pvmlogperror(pvmtxt);
  			if (errno == EMFILE && (pp = peers->p_rlink) != peers) {
***************
*** 323,333 ****
--- 358,374 ----
  
  	if (shmdt(pp->p_buf) == -1)
  		pvmlogerror("peer_detach() shmdt");
+ 	if (!shmctl(pp->p_shmid, IPC_STAT, &shmds) && shmds.shm_nattch == 0)
+ 		shmctl(pp->p_shmid, IPC_RMID, (struct shmid_ds *)0);
+ /*
+ 	if (shmdt(pp->p_buf) == -1)
+ 		pvmlogerror("peer_detach() shmdt");
  	if (shmctl(pp->p_shmid, IPC_STAT, &shmds) == -1)
  		pvmlogperror("peer_detach() shmctl STAT");
  	if (shmds.shm_nattch == 0 &&
  	shmctl(pp->p_shmid, IPC_RMID, &shmds) == -1)
  		pvmlogperror("peer_detach() shmctl RMID");
+ */
  }
  
  
***************
*** 337,342 ****
  	struct peer *pp;
  
  	for (pp = peers->p_link; pp != peers; pp = pp->p_link)
! 		/* peer_detach(pp); */
  		shmdt(pp->p_buf);
  }
--- 378,409 ----
  	struct peer *pp;
  
  	for (pp = peers->p_link; pp != peers; pp = pp->p_link)
! 		peer_detach(pp);
! /*
  		shmdt(pp->p_buf);
+ */
  }
+ 
+ 
+ int
+ peer_dump()
+ {
+ 	struct peer *pp;
+ 	struct shmid_ds shmds;
+ 
+ 	pvmlogerror("peer_dump()\n");
+ 	for (pp = peers->p_link; pp != peers; pp = pp->p_link) {
+ 		if (shmctl(pp->p_shmid, IPC_STAT, &shmds) == -1) {
+ 			sprintf(pvmtxt, "peer_dump() shmctl STAT %d", pp->p_shmid);
+ 			pvmlogperror(pvmtxt);
+ 
+ 		} else {
+ 			sprintf(pvmtxt, " t%x shmid=%d semid=%d shmlen=%d shmna=%d\n",
+ 					pp->p_tid, pp->p_shmid, pp->p_semid, pp->p_dlen,
+ 					(int)shmds.shm_nattch);
+ 			pvmlogerror(pvmtxt);
+ 		}
+ 	}
+ }
+ 
+ 
*** ../netlib/pvm3.3.4/src/pvmshmem.h	Sun Sep  4 16:25:30 1994
--- src/pvmshmem.h	Tue Nov  8 10:38:10 1994
***************
*** 28,43 ****
  /*
   *  pvmshmem.h
   *
   */
  
  
  /* 
!  *			Page Layout
   *		 _________________
   *		|      lock       | \
!  *	 	|_________________|  \  PVMPAGEHDR
   *		|    ref count    |  /
!  *  	|=================| /
   *		|                 |
   *		|      frag       |
   *		|       .         |
--- 28,47 ----
  /*
   *  pvmshmem.h
   *
+ $Log: pvmshmem.h,v $
+  * Revision 1.3  1994/11/08  15:38:05  manchek
+  * shared memory damage control
+  *
   */
  
  
  /* 
!  *		    Page Layout
   *		 _________________
   *		|      lock       | \
!  *		|_________________|  \  PVMPAGEHDR
   *		|    ref count    |  /
!  *		|=================| /
   *		|                 |
   *		|      frag       |
   *		|       .         |
***************
*** 47,55 ****
  
  #ifdef IMA_SYMM
  #define	PVMPAGEHDR			16
! #define PVM_INITLOCK(cp)	s_init_lock((slock_t)cp)
! #define PVM_LOCK(cp)		s_lock((slock_t)cp)
! #define PVM_UNLOCK(cp)		s_unlock((slock_t)cp)
  #endif
  
  /* page header and incoming message box header */
--- 51,59 ----
  
  #ifdef IMA_SYMM
  #define	PVMPAGEHDR			16
! #define PVM_INITLOCK(cp)	s_init_lock((slock_t)(cp))
! #define PVM_LOCK(cp)		s_lock((slock_t)(cp))
! #define PVM_UNLOCK(cp)		s_unlock((slock_t)(cp))
  #endif
  
  /* page header and incoming message box header */
***************
*** 91,99 ****
  	
  #define	PVMPAGEHDR			sizeof(struct shmpghdr)
  				
! #define PAGEINITLOCK(lp)	msem_init(lp,MSEM_UNLOCKED)
! #define PAGELOCK(lp)		msem_lock(lp,0)
! #define PAGEUNLOCK(lp)		msem_unlock(lp,0)
  
  #endif /*IMA_ALPHAMP*/
  
--- 95,103 ----
  	
  #define	PVMPAGEHDR			sizeof(struct shmpghdr)
  				
! #define PAGEINITLOCK(lp)	msem_init((lp), MSEM_UNLOCKED)
! #define PAGELOCK(lp)		msem_lock((lp), 0)
! #define PAGEUNLOCK(lp)		msem_unlock((lp), 0)
  
  #endif /*IMA_ALPHAMP*/
  
***************
*** 116,122 ****
  	
  #define	PVMPAGEHDR			sizeof(struct shmpghdr)
  				
! #define PAGEINITLOCK(lp)	mutex_init(lp,USYNC_PROCESS,0)
  #define PAGELOCK(lp)		mutex_lock(lp)
  #define PAGEUNLOCK(lp)		mutex_unlock(lp)
  /*
--- 120,126 ----
  	
  #define	PVMPAGEHDR			sizeof(struct shmpghdr)
  				
! #define PAGEINITLOCK(lp)	mutex_init((lp), USYNC_PROCESS, 0)
  #define PAGELOCK(lp)		mutex_lock(lp)
  #define PAGEUNLOCK(lp)		mutex_unlock(lp)
  /*
***************
*** 129,135 ****
  
  #endif /*IMA_SUNMP*/
  
! #ifdef IMA_SGIMP
  
  #include <mutex.h>
  
--- 133,139 ----
  
  #endif /*IMA_SUNMP*/
  
! #if defined(IMA_SGIMP) || defined(IMA_SGIMP64)
  
  #include <mutex.h>
  
***************
*** 146,155 ****
  	int 			mb_sleep;		/* Is task blocked on a semaphore? */
  };
  
! #define PAGEINITLOCK(lp)	(*lp = 0)
! #define PAGELOCK(lp)		while(test_then_add(lp,1))test_then_add(lp,-1)
! #define PAGEUNLOCK(lp)		test_then_add(lp,-1)
! #define	TEST_ADD(addr,inc)	test_then_add(addr,inc)
  
  #define	PVMPAGEHDR			sizeof(struct shmpghdr)
  
--- 150,159 ----
  	int 			mb_sleep;		/* Is task blocked on a semaphore? */
  };
  
! #define PAGEINITLOCK(lp)	(*(lp) = 0)
! #define PAGELOCK(lp)		while(test_then_add(lp, 1)) test_then_add(lp, -1L)
! #define PAGEUNLOCK(lp)		test_then_add(lp, -1L)
! #define	TEST_ADD(addr,inc)	test_then_add(addr, (long)inc)
  
  #define	PVMPAGEHDR			sizeof(struct shmpghdr)
  
***************
*** 159,165 ****
  #define PAGEUNLOCK(lp)		release_lock(lp)
  */
  
! #endif /*IMA_SGIMP*/
  
  #ifdef IMA_POWER4
  
--- 163,169 ----
  #define PAGEUNLOCK(lp)		release_lock(lp)
  */
  
! #endif /*IMA_SGIMP || IMA_SGIMP64*/
  
  #ifdef IMA_POWER4
  
***************
*** 189,195 ****
  
  #define	PVMPAGEHDR			sizeof(struct shmpghdr)
  #define _SC_PAGESIZE		_SC_PAGE_SIZE
! #define PAGEINITLOCK(lp)	(*lp=0)
  #define PAGELOCK(lp)		while(gcs(lp,0,1))
  #define PAGEUNLOCK(lp)		gcs(lp,1,0)
  
--- 193,200 ----
  
  #define	PVMPAGEHDR			sizeof(struct shmpghdr)
  #define _SC_PAGESIZE		_SC_PAGE_SIZE
! #define PAGEINITLOCK(lp)	(*(lp) = 0)
! /* XXX oh, kill me with a shovel.  nice place for a while. -b */
  #define PAGELOCK(lp)		while(gcs(lp,0,1))
  #define PAGEUNLOCK(lp)		gcs(lp,1,0)
  
*** ../netlib/pvm3.3.4/src/sdpro.c	Mon Jul 18 16:06:48 1994
--- src/sdpro.c	Sat Oct 15 15:29:28 1994
***************
*** 32,37 ****
--- 32,40 ----
   *	Pvmd entry points for messages from scheduler.
   *
  $Log: sdpro.c,v $
+  * Revision 1.3  1994/10/15  19:29:02  manchek
+  * cast message tags for comparison as integers
+  *
   * Revision 1.2  1994/07/18  19:22:56  manchek
   * ALPHA segfaulted on array subscript
   *
***************
*** 72,78 ****
   **           **
   ***************/
  
! static char rcsid[] = "$Id: sdpro.c,v 1.2 1994/07/18 19:22:56 manchek Exp $";
  static char pvmtxt[512];			/* scratch for error log */
  
  int sm_bogus();
--- 75,81 ----
   **           **
   ***************/
  
! static char rcsid[] = "$Id: sdpro.c,v 1.3 1994/10/15 19:29:02 manchek Exp $";
  static char pvmtxt[512];			/* scratch for error log */
  
  int sm_bogus();
***************
*** 127,133 ****
  smname(code)
  	int code;
  {
! 	if (code < SM_FIRST || code > SM_LAST)
  		return "unknown";
  	code -= SM_FIRST;
  	return sm_names[code];
--- 130,136 ----
  smname(code)
  	int code;
  {
! 	if (code < (int)SM_FIRST || code > (int)SM_LAST)
  		return "unknown";
  	code -= SM_FIRST;
  	return sm_names[code];
***************
*** 145,151 ****
  		pvmlogerror(pvmtxt);
  	}
  
! 	if (c < SM_FIRST || c > SM_LAST) {
  		sprintf(pvmtxt, "schentry() message from t%x with bogus code %d\n",
  				mp->m_src, c);
  		pvmlogerror(pvmtxt);
--- 148,154 ----
  		pvmlogerror(pvmtxt);
  	}
  
! 	if (c < (int)SM_FIRST || c > (int)SM_LAST) {
  		sprintf(pvmtxt, "schentry() message from t%x with bogus code %d\n",
  				mp->m_src, c);
  		pvmlogerror(pvmtxt);
*** ../netlib/pvm3.3.4/src/startup.c	Sat Jun  4 17:45:41 1994
--- src/startup.c	Sat Oct 15 15:31:58 1994
***************
*** 32,37 ****
--- 32,40 ----
   *	Exec more pvmds.  It's good for you.
   *
  $Log: startup.c,v $
+  * Revision 1.9  1994/10/15  19:31:31  manchek
+  * fixed typo in log message
+  *
   * Revision 1.8  1994/06/04  21:45:24  manchek
   * added unix domain sockets.
   * ripped out old (serial) startup code
***************
*** 204,210 ****
   **           **
   ***************/
  
! static char rcsid[] = "$Id: startup.c,v 1.8 1994/06/04 21:45:24 manchek Exp $";
  static char pvmtxt[1024];		/* scratch for error log */
  
  
--- 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 */
  
  
***************
*** 1050,1056 ****
  		}
  		if ((n = select(nfds, &rfds, (fd_set*)0, (fd_set*)0, &tout)) == -1) {
  			if (errno != EINTR) {
! 				pvmlogperror("work() select");
  				pvmbailout(0);
  			}
  		}
--- 1053,1059 ----
  		}
  		if ((n = select(nfds, &rfds, (fd_set*)0, (fd_set*)0, &tout)) == -1) {
  			if (errno != EINTR) {
! 				pvmlogperror("pl_startup() select");
  				pvmbailout(0);
  			}
  		}
*** ../netlib/pvm3.3.4/src/task.c	Fri Jun  3 16:38:28 1994
--- src/task.c	Tue Nov  8 10:41:29 1994
***************
*** 32,37 ****
--- 32,44 ----
   *	Task descriptors.
   *
  $Log: task.c,v $
+  * 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
+  *
+  * Revision 1.4  1994/10/15  19:32:49  manchek
+  * added log in task_free()
+  *
   * Revision 1.3  1994/06/03  20:38:28  manchek
   * version 3.3.0
   *
***************
*** 92,98 ****
   **           **
   ***************/
  
! static char rcsid[] = "$Id: task.c,v 1.3 1994/06/03 20:38:28 manchek Exp $";
  static char pvmtxt[512];		/* scratch for error log */
  
  
--- 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 */
  
  
***************
*** 205,211 ****
  	struct timeval now;
  	struct mesg *mp;
  
! 
  	if (tp->t_plink && tp->t_prlink) {
  		LISTDELETE(tp, t_plink, t_prlink);
  	}
--- 212,227 ----
  	struct timeval now;
  	struct mesg *mp;
  
! 	if (debugmask & PDMTASK) {
! 		sprintf(pvmtxt, "task_free() t%x\n", tp->t_tid);
! 		pvmlogerror(pvmtxt);
! 	}
! #ifdef SHMEM
! 	/* XXX this is inside out - mpp_free should call task_free.
! 	   XXX but for now task_free is what's called.
! 	   XXX this will change in the portable processor interface cleanup. */
! 	mpp_free(tp->t_tid);
! #endif
  	if (tp->t_plink && tp->t_prlink) {
  		LISTDELETE(tp, t_plink, t_prlink);
  	}
***************
*** 386,401 ****
  					break;
  
  				case WT_TASKX:
! 					mp = mesg_new(0);
! 					mp->m_dst = wp->wa_tid;
! 					if (TIDISTASK(mp->m_dst))
! 						mp->m_cod = wp->wa_dep;
! 					else {
! 						mp->m_cod = DM_NOTIFYACK;
! 						mp->m_wid = wp->wa_dep;
  					}
- 					pkint(mp, tp->t_tid);
- 					sendmessage(mp);
  					break;
  
  				case WT_HOSTA:
--- 402,419 ----
  					break;
  
  				case WT_TASKX:
! 					if (wp->wa_tid) {
! 						mp = mesg_new(0);
! 						mp->m_dst = wp->wa_tid;
! 						if (TIDISTASK(mp->m_dst))
! 							mp->m_cod = wp->wa_dep;
! 						else {
! 							mp->m_cod = DM_NOTIFYACK;
! 							mp->m_wid = wp->wa_dep;
! 						}
! 						pkint(mp, tp->t_tid);
! 						sendmessage(mp);
  					}
  					break;
  
  				case WT_HOSTA:
*** ../netlib/pvm3.3.4/src/task.h	Fri Jun  3 16:38:30 1994
--- src/task.h	Sat Oct 15 15:34:06 1994
***************
*** 32,37 ****
--- 32,40 ----
   *	Task descriptors.
   *
  $Log: task.h,v $
+  * Revision 1.3  1994/10/15  19:33:47  manchek
+  * added TF_FORKD flag
+  *
   * Revision 1.2  1994/06/03  20:38:28  manchek
   * version 3.3.0
   *
***************
*** 76,81 ****
--- 79,85 ----
  
  /* t_flag bits */
  
+ #define	TF_FORKD	2			/* task process is child of pvmd */
  #define	TF_CONN		4			/* task is connected */
  #define	TF_AUTH		8			/* task needs to auth */
  #define	TF_CLOSE	16			/* should delete context after flushing msgs */
*** ../netlib/pvm3.3.4/src/tdpro.c	Mon Jul 18 16:06:49 1994
--- src/tdpro.c	Sat Oct 15 15:38:57 1994
***************
*** 32,39 ****
   *	Entry points for messages from local tasks.
   *
  $Log: tdpro.c,v $
!  * Revision 1.5  1994/06/21  18:30:00  manchek
!  * subscript arith in tmname() broke with opt
   *
   * Revision 1.5  1994/06/21  18:30:00  manchek
   * subscript arith in tmname() broke with opt
--- 32,41 ----
   *	Entry points for messages from local tasks.
   *
  $Log: tdpro.c,v $
!  * Revision 1.6  1994/10/15  19:37:46  manchek
!  * cast message tags for comparison as integers.
!  * check newhosts when deleting host.
!  * unset TF_FORKD if task reconnects with a different pid
   *
   * Revision 1.5  1994/06/21  18:30:00  manchek
   * subscript arith in tmname() broke with opt
***************
*** 116,121 ****
--- 118,124 ----
  extern int myndf;					/* from pvmd.c */
  extern int myhostpart;				/* from pvmd.c */
  extern int mytid;					/* from pvmd.c */
+ extern struct htab *newhosts;		/* from pvmd.c */
  extern int nopax;					/* from pvmd.c */
  extern int ourudpmtu;				/* from pvmd.c */
  extern int runstate;				/* from pvmd.c */
***************
*** 131,137 ****
   **           **
   ***************/
  
! static char rcsid[] = "$Id: tdpro.c,v 1.5 1994/06/21 18:30:00 manchek Exp $";
  static char pvmtxt[512];		/* scratch for error log */
  
  int tm_addhost();
--- 134,140 ----
   **           **
   ***************/
  
! static char rcsid[] = "$Id: tdpro.c,v 1.6 1994/10/15 19:37:46 manchek Exp $";
  static char pvmtxt[512];		/* scratch for error log */
  
  int tm_addhost();
***************
*** 209,215 ****
  tmname(code)
  	int code;
  {
! 	if (code < TM_FIRST || code > TM_LAST)
  		return "unknown";
  	code -= TM_FIRST;
  	return tm_names[code];
--- 212,218 ----
  tmname(code)
  	int code;
  {
! 	if (code < (int)TM_FIRST || code > (int)TM_LAST)
  		return "unknown";
  	code -= TM_FIRST;
  	return tm_names[code];
***************
*** 239,245 ****
  		goto bail;
  	}
  
! 	if (c < TM_FIRST || c > TM_LAST) {
  		sprintf(pvmtxt, "loclentry() message from t%x with bogus code %d\n",
  				tp->t_tid, c);
  		pvmlogerror(pvmtxt);
--- 242,248 ----
  		goto bail;
  	}
  
! 	if (c < (int)TM_FIRST || c > (int)TM_LAST) {
  		sprintf(pvmtxt, "loclentry() message from t%x with bogus code %d\n",
  				tp->t_tid, c);
  		pvmlogerror(pvmtxt);
***************
*** 493,498 ****
--- 496,503 ----
  	tp->t_sock = -1;	/* tp will be freed by loclinput() */
  	tp->t_rxp = 0;
  	tp = tp2;
+ 	if (ipid != pid)
+ 		tp->t_flag &= ~TF_FORKD;
  
  	/*
  	*	kick it in the butt; it's ready to go
***************
*** 544,550 ****
  	mp->m_cod = TM_EXIT;
  	tp->t_flag |= TF_CLOSE;
  	sendmessage(mp);
! 	task_cleanup(tp);
  	return 0;
  }
  
--- 549,556 ----
  	mp->m_cod = TM_EXIT;
  	tp->t_flag |= TF_CLOSE;
  	sendmessage(mp);
! 	if (!(tp->t_flag & TF_FORKD))
! 		task_cleanup(tp);
  	return 0;
  }
  
***************
*** 1339,1344 ****
--- 1345,1352 ----
  			sprintf(pvmtxt, "tm_tickle() failing %s\n", hp->hd_name);
  			hostfailentry(hp);
  			ht_delete(hosts, hp);
+ 			if (newhosts)
+ 				ht_delete(newhosts, hp);
  			pkint(mp, 1);
  		} else {
  			if (hp)
*** ../netlib/pvm3.3.4/tasker/tasker.c	Wed May 18 09:50:44 1994
--- tasker/tasker.c	Sat Oct 15 15:39:37 1994
***************
*** 276,281 ****
--- 276,282 ----
  /*
  		task_dump();
  */
+ 		fds = rfds;
  		select(nfds, &fds, (fd_set*)0, (fd_set*)0, (struct timeval*)0);
  
  	/* clean up after any croaked processes */
*** ../netlib/pvm3.3.4/xep/xep.c	Fri Jul  1 11:27:19 1994
--- xep/xep.c	Mon Sep 19 16:32:48 1994
***************
*** 1401,1406 ****
--- 1401,1407 ----
  	int h = y2 - y1;
  	int y, x;
  	u_char *ba;
+ 	int c = isMono ? 128 : 240;
  
  	ba = imCan.cn_dat + y1 * wd;
  	for (y = h; y-- > 0; ) {
***************
*** 1412,1418 ****
  		ba += wd;
  		for (x = 0; x < 20; x++)
  			if (x & 3)
! 				ba[x] = (n & (1 << x / 4)) ? 255 : 240;
  	}
  	repaint_region(&imCan, 0, y1, 20, y2 - 1);
  	refresh_region(&imCan, 0, y1, 20, y2 - 1);
--- 1413,1419 ----
  		ba += wd;
  		for (x = 0; x < 20; x++)
  			if (x & 3)
! 				ba[x] = (n & (1 << x / 4)) ? 255 : c;
  	}
  	repaint_region(&imCan, 0, y1, 20, y2 - 1);
  	refresh_region(&imCan, 0, y1, 20, y2 - 1);
