[pooma-dev] [PATCH] Kill pre-instantiation

James Crotinger jcrotinger at proximation.com
Sat Mar 15 20:49:45 UTC 2003


I don't know what the state-of-the-art is for template instantiations on the
various platforms where POOMA is now used, but if memory serves, KCC and SGI
CC were greatly helped by pre-instantiating this stuff. This is a pain for
POOMA developers (i.e. they suffered longer rebuild times), but for POOMA
users it made a big difference in how long it took to "link" their codes
(which include all the pre-link cycles, which are particularly painful with
optimization enabled). So I certainly wouldn't nuke this capability. Perhaps
allowing the configuration to turn it off or limit it to lower
dimensionality would be useful.

	Jim

------------------------------------------------------------------------
James A. Crotinger                           email:     jimc at numerix.com
NumeriX, LLC                                 phone:  (505) 424-4477 x104
2960 Rodeo Park Dr. W.
Santa Fe, NM 87505
 

-----Original Message-----
From: Richard Guenther [mailto:rguenth at tat.physik.uni-tuebingen.de] 
Sent: Friday, March 14, 2003 3:27 PM
To: pooma-dev at pooma.codesourcery.com
Cc: Jeffrey D. Oldham
Subject: [pooma-dev] [PATCH] Kill pre-instantiation

Hi!

The following patch kills pre-instantiation and thereby cuts some of
the build time and libpooma.a size to 2/3 (on ppc). Instantiation into
the library should be done carefully by projects using pooma, we
certainly shouldnt instantiate for dims 1-n unconditionally.

Tested by building lib and some tests.

Ok? (File removals omitted from patch, but in summary)

Richard.

# This is a BitKeeper generated patch for the following project:
# Project Name: pooma/cheetah repository tracking CVS/tarball
# This patch format is intended for GNU patch command version 2.5 or higher.
# This patch includes the following deltas:
#	           ChangeSet	1.44    -> 1.46
#	        r2/configure	1.7     -> 1.8
#	r2/src/Engine/BrickEngine.1.inst.cpp	1.1     ->         (deleted)
#	r2/src/Engine/BrickBase5.cmpl.cpp	1.1     ->         (deleted)
#	r2/src/Engine/BrickBase6.cmpl.cpp	1.1     ->         (deleted)
#	r2/src/Engine/BrickEngine.3.inst.cpp	1.1     ->         (deleted)
#	r2/src/Engine/BrickBase3.cmpl.cpp	1.1     ->         (deleted)
#	r2/src/Engine/BrickBase4.cmpl.cpp	1.1     ->         (deleted)
#	r2/src/Layout/UniformGridLayout.inst.cpp	1.1     ->
(deleted)
#	r2/src/Engine/BrickBase2.cmpl.cpp	1.1     ->         (deleted)
#	r2/src/Engine/BrickEngine.5.inst.cpp	1.1     ->         (deleted)
#	r2/src/Engine/BrickBase7.cmpl.cpp	1.1     ->         (deleted)
#	    r2/src/subdir.mk	1.1     -> 1.2
#	r2/src/Engine/objfile.mk	1.1     ->         (deleted)
#	r2/src/Engine/BrickBase1.cmpl.cpp	1.1     ->         (deleted)
#	r2/src/Engine/BrickEngine.4.inst.cpp	1.1     ->         (deleted)
#	r2/src/Engine/BrickEngine.2.inst.cpp	1.1     ->         (deleted)
#	r2/src/Engine/BrickEngine.7.inst.cpp	1.1     ->         (deleted)
#	r2/src/Engine/BrickBase.h	1.2     -> 1.3
#	r2/src/FileTemplates/FileTemplate.inst.cpp	1.1     ->
(deleted)
#	r2/src/Engine/include.mk	1.1     ->         (deleted)
#	r2/src/Engine/BrickEngine.6.inst.cpp	1.1     ->         (deleted)
#	r2/src/Layout/objfile.mk	1.1     -> 1.3
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 03/03/14	richard at goofy.(none)	1.45
# drop pre-instantiation support
# --------------------------------------------
# 03/03/14	richard at goofy.(none)	1.46
# more pre-instantiation removal
# --------------------------------------------
#
diff -Nru a/r2/configure b/r2/configure
--- a/r2/configure	Fri Mar 14 23:24:52 2003
+++ b/r2/configure	Fri Mar 14 23:24:52 2003
@@ -194,7 +194,6 @@
 $noonepernm = "--nooneper";
 $schednm = "--sched";
 $boundsnm = "--bounds";
-$preinstnm = "--preinst";
 $printdbgnm = "--printdebug";
 $finternm = "--with-fortran";
 $nofinternm = "--without-fortran";
@@ -236,7 +235,6 @@
   [$sharednm,    "",         "create a shared library."],
   [$finternm,    "",         "include fortran support libraries."],
   [$nofinternm,  "",         "do not include the fortran libraries."],
-  [$preinstnm,   "",         "build preinstantiations of several
classes."],
   [$serialnm,    "",         "configure to run serially, no parallelism."],
   [$threadsnm,  "",         "include threads capability, if available."],
   [$cheetahnm,   "",         "enable use of CHEETAH communications
package."],
@@ -925,19 +923,6 @@
 #
 ###########################################################################

-### figure out if we should do preinstantiation
-sub setpreinstantiate
-{
-
-  if (scalar @{$arghash{$preinstnm}} > 1)
-    {
-      $preinstantiate = 1;
-      $extensions .= "-preinst";
-    }
-  print "Set preinstantiate = $preinstantiate\n" if $dbgprnt;
-  add_yesno_define("POOMA_PREINSTANTIATE", $preinstantiate);
-}
-

 ### figure out if verbose output from comp/link should be used
 sub setverbose
@@ -1876,14 +1861,6 @@
   print FSUITE "POOMA_LIBEXT        = $libext\n";
   print FSUITE "POOMA_LIBRARY       =
lib\$(POOMA_LIBNAME).\$(POOMA_LIBEXT)\n";
   print FSUITE "\n";
-
-  # if we should do preinstantiation, set makefile variable
-  if ($preinstantiate)
-    {
-      print FSUITE "### preinstantiate several classes\n";
-      print FSUITE "POOMA_PREINSTANTIATE = 1\n";
-      print FSUITE "\n";
-    }

   # if we are using PAWS, must add extra statements to suite file
   if ($paws or $pawsdev)
diff -Nru a/r2/src/Engine/BrickBase.h b/r2/src/Engine/BrickBase.h
--- a/r2/src/Engine/BrickBase.h	Fri Mar 14 23:24:52 2003
+++ b/r2/src/Engine/BrickBase.h	Fri Mar 14 23:24:52 2003
@@ -758,8 +758,9 @@

 
////////////////////////////////////////////////////////////////////////////
///

-// We explicitly instantiate everything, so there is no include
-// of BrickBase.cpp here!
+// Include .cpp file to get out-of-line functions.
+
+#include "Engine/BrickBase.cpp"

 #endif // POOMA_ENGINE_BRICKBASE_H

diff -Nru a/r2/src/Layout/objfile.mk b/r2/src/Layout/objfile.mk
--- a/r2/src/Layout/objfile.mk	Fri Mar 14 23:24:52 2003
+++ b/r2/src/Layout/objfile.mk	Fri Mar 14 23:24:52 2003
@@ -31,18 +31,11 @@

 # Object file list.
 # This list is user-editable.
-# Be sure that $(UNIQUE)_OBJS is set, even if set to empty.

-ifdef POOMA_PREINSTANTIATE
 $(UNIQUE)_OBJS := \
-	$(ODIR)/UniformGridLayout.inst.o \
 	$(ODIR)/DynamicLayout.cmpl.o \
 	$(ODIR)/GlobalIDDataBase.cmpl.o
-else
-$(UNIQUE)_OBJS := \
-	$(ODIR)/DynamicLayout.cmpl.o \
-	$(ODIR)/GlobalIDDataBase.cmpl.o
-endif
+
 LOCAL_OBJS += $($(UNIQUE)_OBJS)

 # Set rules for the ODIR directory
diff -Nru a/r2/src/subdir.mk b/r2/src/subdir.mk
--- a/r2/src/subdir.mk	Fri Mar 14 23:24:52 2003
+++ b/r2/src/subdir.mk	Fri Mar 14 23:24:52 2003
@@ -41,10 +41,6 @@
 include $(THISDIR)/$(NEXTDIR)/include.mk
 THISDIR :=$(firstword $(DIR_LIST))

-NEXTDIR := Engine
-include $(THISDIR)/$(NEXTDIR)/include.mk
-THISDIR :=$(firstword $(DIR_LIST))
-
 NEXTDIR := IO
 include $(THISDIR)/$(NEXTDIR)/include.mk
 THISDIR :=$(firstword $(DIR_LIST))
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://sourcerytools.com/pipermail/pooma-dev/attachments/20030315/96569c72/attachment.html>


More information about the pooma-dev mailing list