[comp.sys.sequent] parallel make

pwolfe@kailand.KAI.COM (01/10/89)

Right!  Encore's "make" doesn't need Makefile modifications to run in
parallel, (Encore Computer Systems, that is, not Encore International) so why
does Sequent's?  I have looked at the source code to GNU Make, and wouldn't
like to take on the task of adding the feature to it.

I have to maintain Makefile for both Sequent and non-Sequent environments,
and to get around this, put a macro definition $(P) whereever I would normally
put the '&' in a Makefile on the Sequent.  I have a shell script "mk" which I
use to run "make" which on Sequent hosts passes P='&' and on the other guys
doesn't.

Here's my "mk" script.  It puts make output into a file named "mklog", along
with date/time make started and stopped, userid and cwd of person who ran
"mk", and hostname the make is running on (useful because we have a Balance
and Symmetry sharing disks via NFS, and you can't mix object modules between
the two).  The "-a" option causes the current "mklog" to be appended to.


#!/bin/sh
#	mk [ -a ] [ make-options ]

PATH=$HOME/bin:/usr/local/bin:/usr/ucb:/bin:/usr/bin
export PATH
FILEOUT=mklog
HOST=`hostname`

#	-a option appends output to the log file
#	by default, the old log file is deleted
if [ "x$1" = "x-a" ]; then
	shift
else
	rm -f $FILEOUT
fi

#	put some info in the log file
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" >> $FILEOUT
echo "`whoami`@`hostname`:`pwd`" >> $FILEOUT
echo "`date`  started make $*" >> $FILEOUT

#	Sequent hosts have "ATTPATH" environment variable defined
#	whether you have SVAE installed or not!
if [ "x$ATTPATH" = "x" ]; then
	make $* >> $FILEOUT 2>&1
	mkstatus=$?
else
	#	use parallel make on Sequent hosts
	if [ "$PARALLEL" = "" ]; then
		#	default to 2 processes
		PARALLEL=2
		export PARALLEL
	fi
	make $* "P=&" >> $FILEOUT 2>&1
	mkstatus=$?
fi

#	print ending message
AMSG="`date`  mk $*"
if [ $mkstatus -eq 0 ]; then
	BMSG=""
else
	BMSG=" with status $mkstatus"
	fi
echo "${AMSG}${BMSG}" >> $FILEOUT
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" >> $FILEOUT

#	the following line contains a control-G
echo "${AMSG}${BMSG}"
exit $mkstatus

pwolfe@kailand.KAI.COM (01/17/89)

> What I would like to see is a "smart" version of the make command
> that would spawn processes in the background as appropriate without
> any changes to a "conventional" Makefile.

The most recent version of GNU make seems to have this feature.  We just
picked it up via anonymous FTP from tut.cis.ohio-state.edu, and it compiles
and runs on our Symmetry.  It appears to work, though we just got it a few
days ago, so haven't really had much of a chance to test it.  The -J option is
undocumented, but just put a -J5 on the make command line and it runs 5
processes in parallel.

	Patrick Wolfe
	System Manager, Kuck and Associates
	pat@kai.com
	{uunet,uiucuxc,sequent}!kailand!pat
	pat%kai.com@uxc.cso.uiuc.edu
	pat%kai.com@uiucuxc.arpa
	pat@kai.com@uiucvmd.bitnet