From rguenth at tat.physik.uni-tuebingen.de Tue Mar 2 09:20:06 2004 From: rguenth at tat.physik.uni-tuebingen.de (Richard Guenther) Date: Tue, 2 Mar 2004 10:20:06 +0100 (CET) Subject: [pooma-dev] AltView* classes In-Reply-To: <403F5B29.6040005@tat.physik.uni-tuebingen.de> References: <403F5B29.6040005@tat.physik.uni-tuebingen.de> Message-ID: On Fri, 27 Feb 2004, Richard Guenther wrote: > Hi! > > Does anyone remember the exact reason for the existance of the AltView* > classes in Array.h and Field.h? Removing them and fixing their usage to > use View* seems to work (full test with gcc 3.3 and 3.4 in progress). Testing completed with no new failures. Would it be ok to remove those AltView* classes? Thanks, Richard. -- Richard Guenther WWW: http://www.tat.physik.uni-tuebingen.de/~rguenth/ From rguenth at tat.physik.uni-tuebingen.de Tue Mar 2 10:28:34 2004 From: rguenth at tat.physik.uni-tuebingen.de (Richard Guenther) Date: Tue, 2 Mar 2004 11:28:34 +0100 (CET) Subject: [pooma-dev] AltView* classes In-Reply-To: References: <403F5B29.6040005@tat.physik.uni-tuebingen.de> Message-ID: On Tue, 2 Mar 2004, Richard Guenther wrote: > On Fri, 27 Feb 2004, Richard Guenther wrote: > > > Hi! > > > > Does anyone remember the exact reason for the existance of the AltView* > > classes in Array.h and Field.h? Removing them and fixing their usage to > > use View* seems to work (full test with gcc 3.3 and 3.4 in progress). > > Testing completed with no new failures. Would it be ok to remove those > AltView* classes? Which would be... Ok? Richard. 2004Mar02 Richard Guenther * src/Array/Array.h: remove all traces of AltView0 class. src/Field/Field.h: remove all traces of AltView1 and AltView1Implementation classes. ===== Array/Array.h 1.14 vs edited ===== --- 1.14/r2/src/Array/Array.h Tue Dec 16 15:19:57 2003 +++ edited/Array/Array.h Tue Mar 2 11:24:14 2004 @@ -649,8 +649,6 @@ // an existing engine cannot be any kind of slice domain. // Also, bounds checking would make no sense because it would // reduce to contains(a.domain(), a.domain()); -// -// Any changes to this class should also be made to AltView0. template struct View0 > @@ -695,41 +693,6 @@ } }; -// AltView0 avoids an instantiation problem that arises when two -// classes use each other. This class's definition should be exactly -// the same as View0 except omitting member functions. -// -// Do NOT explicitly instantiate this class. - -template -struct AltView0; - -template -struct AltView0 > -{ - // Convenience typedef for the thing we're taking a view of. - - typedef Array Subject_t; - - // Deduce domains for the output type. - // At some point, we need to fix NewDomain1; until then, use - // the temporary version from Array.h. - - typedef typename Subject_t::Engine_t Engine_t; - typedef typename Subject_t::Domain_t Domain_t; - - // Deduce the template parameters for the output type. - - typedef typename NewEngine::Type_t NewEngine_t; - enum { newDim = NewEngine_t::dimensions }; - typedef typename NewEngine_t::Tag_t NewEngineTag_t; - - // The output types. - - typedef Array Type_t; - typedef Type_t ReadType_t; -}; - template struct View1, int> { @@ -1864,7 +1827,7 @@ /// A zero-argument version of operator(), which takes a view of /// array's domain, is also supplied. //@{ - typename AltView0::ReadType_t + typename View0::ReadType_t read() const { typedef View0 Ret_t; @@ -1934,7 +1897,7 @@ return Ret_t::makeRead(*this, s1, s2, s3, s4, s5, s6, s7); } - typename AltView0::Type_t + typename View0::Type_t operator()() const { typedef View0 Ret_t; ===== Field/Field.h 1.14 vs edited ===== --- 1.14/r2/src/Field/Field.h Tue Dec 16 15:20:00 2003 +++ edited/Field/Field.h Tue Mar 2 11:25:22 2004 @@ -269,9 +269,6 @@ * View1Implementation specialization for indexing a field * with a single domain. There is a single-valued version (SV == true) * and a multi-valued version (SV == false). - * - * Any changes to View1Implementation should also be made to - * AltView1Implementation. */ // Single-valued version. Handles scalars and Locs. @@ -508,62 +505,7 @@ /** - * AltView1Implementation avoids an instantiation problem that arises when two - * classes use each other. This class's definition should be exactly - * the same as View1Implementation except omitting member functions. - * - * Do NOT explicitly instantiate this class. - */ - -// Single-valued version. Handles scalars and Locs. - -template -struct AltView1Implementation; - -template -struct AltView1Implementation, Domain, true> -{ - // Convenience typedef for the thing we're taking a view of. - - typedef Field Subject_t; - - // The return types are pretty simple here. - - typedef typename Subject_t::Element_t ReadType_t; - typedef typename Subject_t::ElementRef_t Type_t; -}; - -template -struct AltView1Implementation, Domain, false> -{ - // Convenience typedef for the thing we're taking a view of. - - typedef Field Subject_t; - - // Deduce domains for the output type. - - typedef typename Subject_t::Engine_t Engine_t; - typedef typename NewEngine::Type_t NewEngine_t; - typedef typename NewEngine_t::Element_t NewT_t; - typedef typename NewEngine_t::Tag_t NewEngineTag_t; - - // Deduce the new Mesh. - - typedef typename - NewMeshTag::Type_t - NewMeshTag_t; - - // The output types. - - typedef Field ReadType_t; - typedef Field Type_t; -}; - - -/** * View1 specialization for indexing a field with a single domain. - * - * Any changes to View1 should also be made to AltView1. */ template @@ -613,8 +555,6 @@ /** * View1 specialization for indexing a field with an int. - * - * Any changes to View1 should also be made to AltView1. */ template @@ -658,71 +598,6 @@ /** - * AltView1 avoids an instantiation problem that arises when two - * classes use each other. This class's definition should be exactly - * the same as View1 except omitting member functions. - * - * Do NOT explicitly instantiate this class. - */ - -template -struct AltView1; - -template -struct AltView1, Sub1> -{ - // Convenience typedef for the thing we're taking a view of. - - typedef Field Subject_t; - - // Deduce domains for the output type. - // At some point, we need to fix NewDomain1; until then, use - // the temporary version from NewDomain.h. - - typedef typename Subject_t::Domain_t Domain_t; - typedef TemporaryNewDomain1 NewDomain_t; - typedef typename NewDomain_t::SliceType_t SDomain_t; - - // Deduce appropriate version of implementation to dispatch to. - - enum { sv = DomainTraits::singleValued }; - typedef AltView1Implementation Dispatch_t; - - // The optimized domain combiner. - - typedef CombineDomainOpt Combine_t; - - // The return types. - - typedef typename Dispatch_t::ReadType_t ReadType_t; - typedef typename Dispatch_t::Type_t Type_t; -}; - - -/** - * AltView1 avoids an instantiation problem that arises when two - * classes use each other. This class's definition should be exactly - * the same as View1 except omitting member functions. - * - * Do NOT explicitly instantiate this class. - */ - -template -struct AltView1, int> -{ - // Convenience typedef for the thing we're taking a view of. - - typedef Field Subject_t; - - // The return types. - - typedef typename Subject_t::Element_t ReadType_t; - typedef typename Subject_t::ElementRef_t Type_t; - -}; - - -/** * View2 specialization for indexing a field with two * domains. */ @@ -1455,14 +1330,14 @@ /// point fields the viewing domain is an actual centering domain. //@{ - inline typename AltView1::ReadType_t + inline typename View1::ReadType_t read() const { typedef View1 Ret_t; return Ret_t::makeRead(*this, physicalDomain()); } - inline typename AltView1::ReadType_t + inline typename View1::ReadType_t readAll() const { typedef View1 Ret_t; @@ -1470,7 +1345,7 @@ } template - inline typename AltView1::ReadType_t + inline typename View1::ReadType_t read(const Sub1 &s1) const { typedef View1 Ret_t; @@ -1493,14 +1368,14 @@ return Ret_t::makeRead(*this, s1, s2, s3); } - inline typename AltView1::Type_t + inline typename View1::Type_t operator()() const { typedef View1 Ret_t; return Ret_t::make(*this, physicalDomain()); } - inline typename AltView1::Type_t + inline typename View1::Type_t all() const { typedef View1 Ret_t; @@ -1508,7 +1383,7 @@ } template - inline typename AltView1::Type_t + inline typename View1::Type_t operator()(const Sub1 &s1) const { typedef View1 Ret_t; From jcrotinger at proximation.com Tue Mar 2 16:10:37 2004 From: jcrotinger at proximation.com (James Crotinger) Date: Tue, 2 Mar 2004 09:10:37 -0700 Subject: [pooma-dev] AltView* classes Message-ID: Hi Richard, This tickled a neuron the other day, but I couldn't recall the details. The AltView classes were put in to reduce link times and sizes for large codes. The classes that have enums end up having a link-time cost, both in space and time. I believe this refactoring was done to reduce the cardinality of classes having the "sv" enum. My recollection is that this, and other similar "optimizations", had a pretty substantial impact on link-time for Blanca. Unless these are hurting something else, I would tend to leave them in. Does the CodeSourcery CVS repository have complete CVS history? (i.e. did we copy the repository, or just the head version?) This should have been easy to determine via CVS. 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: Tuesday, March 02, 2004 3:29 AM > To: pooma-dev at pooma.codesourcery.com > Cc: Jeffrey D. Oldham > Subject: Re: [pooma-dev] AltView* classes > > On Tue, 2 Mar 2004, Richard Guenther wrote: > > > On Fri, 27 Feb 2004, Richard Guenther wrote: > > > > > Hi! > > > > > > Does anyone remember the exact reason for the existance of the > AltView* > > > classes in Array.h and Field.h? Removing them and fixing their usage > to > > > use View* seems to work (full test with gcc 3.3 and 3.4 in progress). > > > > Testing completed with no new failures. Would it be ok to remove those > > AltView* classes? > > Which would be... > > Ok? > > Richard. > > > 2004Mar02 Richard Guenther > > * src/Array/Array.h: remove all traces of AltView0 class. > src/Field/Field.h: remove all traces of AltView1 and > AltView1Implementation classes. > > ===== Array/Array.h 1.14 vs edited ===== > --- 1.14/r2/src/Array/Array.h Tue Dec 16 15:19:57 2003 > +++ edited/Array/Array.h Tue Mar 2 11:24:14 2004 > @@ -649,8 +649,6 @@ > // an existing engine cannot be any kind of slice domain. > // Also, bounds checking would make no sense because it would > // reduce to contains(a.domain(), a.domain()); > -// > -// Any changes to this class should also be made to AltView0. > > template > struct View0 > > @@ -695,41 +693,6 @@ > } > }; > > -// AltView0 avoids an instantiation problem that arises when two > -// classes use each other. This class's definition should be exactly > -// the same as View0 except omitting member functions. > -// > -// Do NOT explicitly instantiate this class. > - > -template > -struct AltView0; > - > -template > -struct AltView0 > > -{ > - // Convenience typedef for the thing we're taking a view of. > - > - typedef Array Subject_t; > - > - // Deduce domains for the output type. > - // At some point, we need to fix NewDomain1; until then, use > - // the temporary version from Array.h. > - > - typedef typename Subject_t::Engine_t Engine_t; > - typedef typename Subject_t::Domain_t Domain_t; > - > - // Deduce the template parameters for the output type. > - > - typedef typename NewEngine::Type_t NewEngine_t; > - enum { newDim = NewEngine_t::dimensions }; > - typedef typename NewEngine_t::Tag_t NewEngineTag_t; > - > - // The output types. > - > - typedef Array Type_t; > - typedef Type_t ReadType_t; > -}; > - > template > struct View1, int> > { > @@ -1864,7 +1827,7 @@ > /// A zero-argument version of operator(), which takes a view of > /// array's domain, is also supplied. > //@{ > - typename AltView0::ReadType_t > + typename View0::ReadType_t > read() const > { > typedef View0 Ret_t; > @@ -1934,7 +1897,7 @@ > return Ret_t::makeRead(*this, s1, s2, s3, s4, s5, s6, s7); > } > > - typename AltView0::Type_t > + typename View0::Type_t > operator()() const > { > typedef View0 Ret_t; > ===== Field/Field.h 1.14 vs edited ===== > --- 1.14/r2/src/Field/Field.h Tue Dec 16 15:20:00 2003 > +++ edited/Field/Field.h Tue Mar 2 11:25:22 2004 > @@ -269,9 +269,6 @@ > * View1Implementation specialization for indexing a field > * with a single domain. There is a single-valued version (SV == true) > * and a multi-valued version (SV == false). > - * > - * Any changes to View1Implementation should also be made to > - * AltView1Implementation. > */ > > // Single-valued version. Handles scalars and Locs. > @@ -508,62 +505,7 @@ > > > /** > - * AltView1Implementation avoids an instantiation problem that arises > when two > - * classes use each other. This class's definition should be exactly > - * the same as View1Implementation except omitting member functions. > - * > - * Do NOT explicitly instantiate this class. > - */ > - > -// Single-valued version. Handles scalars and Locs. > - > -template > -struct AltView1Implementation; > - > -template > -struct AltView1Implementation, Domain, true> > -{ > - // Convenience typedef for the thing we're taking a view of. > - > - typedef Field Subject_t; > - > - // The return types are pretty simple here. > - > - typedef typename Subject_t::Element_t ReadType_t; > - typedef typename Subject_t::ElementRef_t Type_t; > -}; > - > -template > -struct AltView1Implementation, Domain, false> > -{ > - // Convenience typedef for the thing we're taking a view of. > - > - typedef Field Subject_t; > - > - // Deduce domains for the output type. > - > - typedef typename Subject_t::Engine_t Engine_t; > - typedef typename NewEngine::Type_t NewEngine_t; > - typedef typename NewEngine_t::Element_t NewT_t; > - typedef typename NewEngine_t::Tag_t NewEngineTag_t; > - > - // Deduce the new Mesh. > - > - typedef typename > - NewMeshTag::Type_t > - NewMeshTag_t; > - > - // The output types. > - > - typedef Field ReadType_t; > - typedef Field Type_t; > -}; > - > - > -/** > * View1 specialization for indexing a field with a single > domain. > - * > - * Any changes to View1 should also be made to AltView1. > */ > > template > @@ -613,8 +555,6 @@ > > /** > * View1 specialization for indexing a field with an int. > - * > - * Any changes to View1 should also be made to AltView1. > */ > > template > @@ -658,71 +598,6 @@ > > > /** > - * AltView1 avoids an instantiation problem that arises when two > - * classes use each other. This class's definition should be exactly > - * the same as View1 except omitting member functions. > - * > - * Do NOT explicitly instantiate this class. > - */ > - > -template > -struct AltView1; > - > -template > -struct AltView1, Sub1> > -{ > - // Convenience typedef for the thing we're taking a view of. > - > - typedef Field Subject_t; > - > - // Deduce domains for the output type. > - // At some point, we need to fix NewDomain1; until then, use > - // the temporary version from NewDomain.h. > - > - typedef typename Subject_t::Domain_t Domain_t; > - typedef TemporaryNewDomain1 NewDomain_t; > - typedef typename NewDomain_t::SliceType_t SDomain_t; > - > - // Deduce appropriate version of implementation to dispatch to. > - > - enum { sv = DomainTraits::singleValued }; > - typedef AltView1Implementation Dispatch_t; > - > - // The optimized domain combiner. > - > - typedef CombineDomainOpt Combine_t; > - > - // The return types. > - > - typedef typename Dispatch_t::ReadType_t ReadType_t; > - typedef typename Dispatch_t::Type_t Type_t; > -}; > - > - > -/** > - * AltView1 avoids an instantiation problem that arises when two > - * classes use each other. This class's definition should be exactly > - * the same as View1 except omitting member functions. > - * > - * Do NOT explicitly instantiate this class. > - */ > - > -template > -struct AltView1, int> > -{ > - // Convenience typedef for the thing we're taking a view of. > - > - typedef Field Subject_t; > - > - // The return types. > - > - typedef typename Subject_t::Element_t ReadType_t; > - typedef typename Subject_t::ElementRef_t Type_t; > - > -}; > - > - > -/** > * View2 specialization for indexing a field with two > * domains. > */ > @@ -1455,14 +1330,14 @@ > /// point fields the viewing domain is an actual centering domain. > //@{ > > - inline typename AltView1::ReadType_t > + inline typename View1::ReadType_t > read() const > { > typedef View1 Ret_t; > return Ret_t::makeRead(*this, physicalDomain()); > } > > - inline typename AltView1::ReadType_t > + inline typename View1::ReadType_t > readAll() const > { > typedef View1 Ret_t; > @@ -1470,7 +1345,7 @@ > } > > template > - inline typename AltView1::ReadType_t > + inline typename View1::ReadType_t > read(const Sub1 &s1) const > { > typedef View1 Ret_t; > @@ -1493,14 +1368,14 @@ > return Ret_t::makeRead(*this, s1, s2, s3); > } > > - inline typename AltView1::Type_t > + inline typename View1::Type_t > operator()() const > { > typedef View1 Ret_t; > return Ret_t::make(*this, physicalDomain()); > } > > - inline typename AltView1::Type_t > + inline typename View1::Type_t > all() const > { > typedef View1 Ret_t; > @@ -1508,7 +1383,7 @@ > } > > template > - inline typename AltView1::Type_t > + inline typename View1::Type_t > operator()(const Sub1 &s1) const > { > typedef View1 Ret_t; -------------- next part -------------- An HTML attachment was scrubbed... URL: From oldham at codesourcery.com Tue Mar 2 16:19:09 2004 From: oldham at codesourcery.com (Jeffrey D. Oldham) Date: Tue, 02 Mar 2004 08:19:09 -0800 Subject: [pooma-dev] AltView* classes In-Reply-To: References: Message-ID: <4044B3FD.8090509@codesourcery.com> James Crotinger wrote: > Hi Richard, > > This tickled a neuron the other day, but I couldn't recall the details. > > The AltView classes were put in to reduce link times and sizes for large > codes. The classes that have enums end up having a link-time cost, both > in space and time. I believe this refactoring was done to reduce the > cardinality of classes having the "sv" enum. My recollection is that > this, and other similar "optimizations", had a pretty substantial impact > on link-time for Blanca. Unless these are hurting something else, I > would tend to leave them in. > > Does the CodeSourcery CVS repository have complete CVS history? (i.e. > did we copy the repository, or just the head version?) This should have > been easy to determine via CVS. The POOMA CVS repository history goes back to at least 1998 March. For example, see the log for src/Array/Array.h. This log gives an entry for AltView0 and AltView1Implementation: revision 1.141 date: 2001/05/25 17:42:48; author: oldham; state: Exp; lines: +47 -6 branches: 1.141.4; 2001-05-25 Jeffrey D. Oldham * Array/Array.h (View0): Modify initial comment to indicate changes should also be made to AltView0. (AltView0): New class to avoid explicit instantiation problems. (ComponentView): Modify initial comment to indicate class should not be explicitly instantiated. (Array::read()): Change return type to AltView0. (Array::operator()()): Likewise. * NewField/Field.h (View1Implementation): Modify initial comment to indicate changes should also be made to AltView1Implementation. (AltView1Implementation): New class to avoid explicit instantiation problems. (View1): Modify initial comment to indicate changes should also be made to AltView1. (AltView1): New class to avoid explicit instantiation problems. (Field::read()): Change return type to AltView1. (Field::readAll()): Likewise. (Field::read(s1)): Likewise. (Field::operator()()): Likewise. (Field::all()): Likewise. (Field::operator()(s1)): Likewise. Perhaps this will jog Jim's memory more. I do not remember much about this. -- Jeffrey D. Oldham oldham at codesourcery.com From rguenth at tat.physik.uni-tuebingen.de Tue Mar 2 16:53:53 2004 From: rguenth at tat.physik.uni-tuebingen.de (Richard Guenther) Date: Tue, 02 Mar 2004 17:53:53 +0100 Subject: [pooma-dev] AltView* classes In-Reply-To: <4044B3FD.8090509@codesourcery.com> References: <4044B3FD.8090509@codesourcery.com> Message-ID: <4044BC21.5010001@tat.physik.uni-tuebingen.de> Jeffrey D. Oldham wrote: > > James Crotinger wrote: > >> Hi Richard, >> >> This tickled a neuron the other day, but I couldn't recall the details. >> >> The AltView classes were put in to reduce link times and sizes for >> large codes. The classes that have enums end up having a link-time >> cost, both in space and time. I believe this refactoring was done to >> reduce the cardinality of classes having the "sv" enum. My >> recollection is that this, and other similar "optimizations", had a >> pretty substantial impact on link-time for Blanca. Unless these are >> hurting something else, I would tend to leave them in. It seems they are only used for return type creation which hinted me that it may have beed a compiler bug workaround (so does the CVS histroy). As an optimization this looks worthless at it just adds classes to parse. No? > The POOMA CVS repository history goes back to at least 1998 March. For > example, see the log for src/Array/Array.h. This log gives an entry for > AltView0 and AltView1Implementation: > > revision 1.141 > date: 2001/05/25 17:42:48; author: oldham; state: Exp; lines: +47 -6 > branches: 1.141.4; > 2001-05-25 Jeffrey D. Oldham > * Array/Array.h (View0): Modify initial comment to indicate > changes should also be made to AltView0. > (AltView0): New class to avoid explicit instantiation problems. The same comment is above the classes in the source, but it's not very helpful in trying to figure out what these problems are/were. It's in my tree now, so I won't forget about it at least until the next treediff to CVS. Richard. From wdn at lanl.gov Tue Mar 2 17:00:27 2004 From: wdn at lanl.gov (Dave Nystrom) Date: Tue, 2 Mar 2004 10:00:27 -0700 Subject: [pooma-dev] AltView* classes In-Reply-To: References: Message-ID: <16452.48555.115583.812762@bedell.lanl.gov> These AltView classes were put in by Jeffrey Oldham to fix a problem that I was having trying to explicitly instantiate all the Pooma classes and functions that Blanca code was using. Basically, the way the Pooma 2 Field class was originally written, we were getting one of these "sv" enums instantiated for every unique expression which we had in our source code base. I was unable to explicitly instantiate these "sv" enums the way the code was originally written because of some issue which Arch Robison of Kuck and Associates (now Intel) identified - basically the code in it's original form violated some corner case of the C++ standard according to Arch. Jeffrey fixed this problem by adding the AltView class and then I was able to perform the explicit instantiations that I needed. However, I believe Jeffrey or someone else has gone through the code and replaced the "sv" enums with some other construct which does not have the explicit instantiation difficulties that the "sv" enums had. So, I think that it is probably okay to remove the AltView classes and that this would clean up the code considerably. I may revisit all this explicit instantiation stuff sometime in the not to distant future on a hobby basis (weird hobby, huh) and if I encounter difficulties being able to explicitly instantiate anything, I could then raise it as an issue at that time. In summary, the AltView classes were added by Jeffrey to fix an explicit instantiation problem that I think no longer exists and I am in favor of now removing them in the interest of cleaning up the code as much as possible. -- Dave Nystrom email: wdn at lanl.gov LANL X-2 phone: 505-667-7913 fax: 505-665-2227 James Crotinger writes: > Hi Richard, > > This tickled a neuron the other day, but I couldn't recall the details. > > The AltView classes were put in to reduce link times and sizes for large > codes. The classes that have enums end up having a link-time cost, both in > space and time. I believe this refactoring was done to reduce the > cardinality of classes having the "sv" enum. My recollection is that this, > and other similar "optimizations", had a pretty substantial impact on > link-time for Blanca. Unless these are hurting something else, I would tend > to leave them in. > > Does the CodeSourcery CVS repository have complete CVS history? (i.e. did we > copy the repository, or just the head version?) This should have been easy > to determine via CVS. > > 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: Tuesday, March 02, 2004 3:29 AM > > To: pooma-dev at pooma.codesourcery.com > > Cc: Jeffrey D. Oldham > > Subject: Re: [pooma-dev] AltView* classes > > > > On Tue, 2 Mar 2004, Richard Guenther wrote: > > > > > On Fri, 27 Feb 2004, Richard Guenther wrote: > > > > > > > Hi! > > > > > > > > Does anyone remember the exact reason for the existance of the > > AltView* > > > > classes in Array.h and Field.h? Removing them and fixing their usage > > to > > > > use View* seems to work (full test with gcc 3.3 and 3.4 in progress). > > > > > > Testing completed with no new failures. Would it be ok to remove those > > > AltView* classes? > > > > Which would be... > > > > Ok? > > > > Richard. > > > > > > 2004Mar02 Richard Guenther > > > > * src/Array/Array.h: remove all traces of AltView0 class. > > src/Field/Field.h: remove all traces of AltView1 and > > AltView1Implementation classes. > > > > ===== Array/Array.h 1.14 vs edited ===== > > --- 1.14/r2/src/Array/Array.h Tue Dec 16 15:19:57 2003 > > +++ edited/Array/Array.h Tue Mar 2 11:24:14 2004 > > @@ -649,8 +649,6 @@ > > // an existing engine cannot be any kind of slice domain. > > // Also, bounds checking would make no sense because it would > > // reduce to contains(a.domain(), a.domain()); > > -// > > -// Any changes to this class should also be made to AltView0. > > > > template > > struct View0 > > > @@ -695,41 +693,6 @@ > > } > > }; > > > > -// AltView0 avoids an instantiation problem that arises when two > > -// classes use each other. This class's definition should be exactly > > -// the same as View0 except omitting member functions. > > -// > > -// Do NOT explicitly instantiate this class. > > - > > -template > > -struct AltView0; > > - > > -template > > -struct AltView0 > > > -{ > > - // Convenience typedef for the thing we're taking a view of. > > - > > - typedef Array Subject_t; > > - > > - // Deduce domains for the output type. > > - // At some point, we need to fix NewDomain1; until then, use > > - // the temporary version from Array.h. > > - > > - typedef typename Subject_t::Engine_t Engine_t; > > - typedef typename Subject_t::Domain_t Domain_t; > > - > > - // Deduce the template parameters for the output type. > > - > > - typedef typename NewEngine::Type_t NewEngine_t; > > - enum { newDim = NewEngine_t::dimensions }; > > - typedef typename NewEngine_t::Tag_t NewEngineTag_t; > > - > > - // The output types. > > - > > - typedef Array Type_t; > > - typedef Type_t ReadType_t; > > -}; > > - > > template > > struct View1, int> > > { > > @@ -1864,7 +1827,7 @@ > > /// A zero-argument version of operator(), which takes a view of > > /// array's domain, is also supplied. > > //@{ > > - typename AltView0::ReadType_t > > + typename View0::ReadType_t > > read() const > > { > > typedef View0 Ret_t; > > @@ -1934,7 +1897,7 @@ > > return Ret_t::makeRead(*this, s1, s2, s3, s4, s5, s6, s7); > > } > > > > - typename AltView0::Type_t > > + typename View0::Type_t > > operator()() const > > { > > typedef View0 Ret_t; > > ===== Field/Field.h 1.14 vs edited ===== > > --- 1.14/r2/src/Field/Field.h Tue Dec 16 15:20:00 2003 > > +++ edited/Field/Field.h Tue Mar 2 11:25:22 2004 > > @@ -269,9 +269,6 @@ > > * View1Implementation specialization for indexing a field > > * with a single domain. There is a single-valued version (SV == true) > > * and a multi-valued version (SV == false). > > - * > > - * Any changes to View1Implementation should also be made to > > - * AltView1Implementation. > > */ > > > > // Single-valued version. Handles scalars and Locs. > > @@ -508,62 +505,7 @@ > > > > > > /** > > - * AltView1Implementation avoids an instantiation problem that arises > > when two > > - * classes use each other. This class's definition should be exactly > > - * the same as View1Implementation except omitting member functions. > > - * > > - * Do NOT explicitly instantiate this class. > > - */ > > - > > -// Single-valued version. Handles scalars and Locs. > > - > > -template > > -struct AltView1Implementation; > > - > > -template > > -struct AltView1Implementation, Domain, true> > > -{ > > - // Convenience typedef for the thing we're taking a view of. > > - > > - typedef Field Subject_t; > > - > > - // The return types are pretty simple here. > > - > > - typedef typename Subject_t::Element_t ReadType_t; > > - typedef typename Subject_t::ElementRef_t Type_t; > > -}; > > - > > -template > > -struct AltView1Implementation, Domain, false> > > -{ > > - // Convenience typedef for the thing we're taking a view of. > > - > > - typedef Field Subject_t; > > - > > - // Deduce domains for the output type. > > - > > - typedef typename Subject_t::Engine_t Engine_t; > > - typedef typename NewEngine::Type_t NewEngine_t; > > - typedef typename NewEngine_t::Element_t NewT_t; > > - typedef typename NewEngine_t::Tag_t NewEngineTag_t; > > - > > - // Deduce the new Mesh. > > - > > - typedef typename > > - NewMeshTag::Type_t > > - NewMeshTag_t; > > - > > - // The output types. > > - > > - typedef Field ReadType_t; > > - typedef Field Type_t; > > -}; > > - > > - > > -/** > > * View1 specialization for indexing a field with a single > > domain. > > - * > > - * Any changes to View1 should also be made to AltView1. > > */ > > > > template > > @@ -613,8 +555,6 @@ > > > > /** > > * View1 specialization for indexing a field with an int. > > - * > > - * Any changes to View1 should also be made to AltView1. > > */ > > > > template > > @@ -658,71 +598,6 @@ > > > > > > /** > > - * AltView1 avoids an instantiation problem that arises when two > > - * classes use each other. This class's definition should be exactly > > - * the same as View1 except omitting member functions. > > - * > > - * Do NOT explicitly instantiate this class. > > - */ > > - > > -template > > -struct AltView1; > > - > > -template > > -struct AltView1, Sub1> > > -{ > > - // Convenience typedef for the thing we're taking a view of. > > - > > - typedef Field Subject_t; > > - > > - // Deduce domains for the output type. > > - // At some point, we need to fix NewDomain1; until then, use > > - // the temporary version from NewDomain.h. > > - > > - typedef typename Subject_t::Domain_t Domain_t; > > - typedef TemporaryNewDomain1 NewDomain_t; > > - typedef typename NewDomain_t::SliceType_t SDomain_t; > > - > > - // Deduce appropriate version of implementation to dispatch to. > > - > > - enum { sv = DomainTraits::singleValued }; > > - typedef AltView1Implementation Dispatch_t; > > - > > - // The optimized domain combiner. > > - > > - typedef CombineDomainOpt Combine_t; > > - > > - // The return types. > > - > > - typedef typename Dispatch_t::ReadType_t ReadType_t; > > - typedef typename Dispatch_t::Type_t Type_t; > > -}; > > - > > - > > -/** > > - * AltView1 avoids an instantiation problem that arises when two > > - * classes use each other. This class's definition should be exactly > > - * the same as View1 except omitting member functions. > > - * > > - * Do NOT explicitly instantiate this class. > > - */ > > - > > -template > > -struct AltView1, int> > > -{ > > - // Convenience typedef for the thing we're taking a view of. > > - > > - typedef Field Subject_t; > > - > > - // The return types. > > - > > - typedef typename Subject_t::Element_t ReadType_t; > > - typedef typename Subject_t::ElementRef_t Type_t; > > - > > -}; > > - > > - > > -/** > > * View2 specialization for indexing a field with two > > * domains. > > */ > > @@ -1455,14 +1330,14 @@ > > /// point fields the viewing domain is an actual centering domain. > > //@{ > > > > - inline typename AltView1::ReadType_t > > + inline typename View1::ReadType_t > > read() const > > { > > typedef View1 Ret_t; > > return Ret_t::makeRead(*this, physicalDomain()); > > } > > > > - inline typename AltView1::ReadType_t > > + inline typename View1::ReadType_t > > readAll() const > > { > > typedef View1 Ret_t; > > @@ -1470,7 +1345,7 @@ > > } > > > > template > > - inline typename AltView1::ReadType_t > > + inline typename View1::ReadType_t > > read(const Sub1 &s1) const > > { > > typedef View1 Ret_t; > > @@ -1493,14 +1368,14 @@ > > return Ret_t::makeRead(*this, s1, s2, s3); > > } > > > > - inline typename AltView1::Type_t > > + inline typename View1::Type_t > > operator()() const > > { > > typedef View1 Ret_t; > > return Ret_t::make(*this, physicalDomain()); > > } > > > > - inline typename AltView1::Type_t > > + inline typename View1::Type_t > > all() const > > { > > typedef View1 Ret_t; > > @@ -1508,7 +1383,7 @@ > > } > > > > template > > - inline typename AltView1::Type_t > > + inline typename View1::Type_t > > operator()(const Sub1 &s1) const > > { > > typedef View1 Ret_t; > > > > > > RE: [pooma-dev] AltView* classes > > > >

Hi Richard, >

> >

This tickled a neuron the other day, but I couldn't recall the details. >

> >

The AltView classes were put in to reduce link times and sizes for large codes. The classes that have enums end up having a link-time cost, both in space and time. I believe this refactoring was done to reduce the cardinality of classes having the "sv" enum. My recollection is that this, and other similar "optimizations", had a pretty substantial impact on link-time for Blanca. Unless these are hurting something else, I would tend to leave them in.

> >

Does the CodeSourcery CVS repository have complete CVS history? (i.e. did we copy the repository, or just the head version?) This should have been easy to determine via CVS.

> >

        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: Tuesday, March 02, 2004 3:29 AM >
> To: pooma-dev at pooma.codesourcery.com >
> Cc: Jeffrey D. Oldham >
> Subject: Re: [pooma-dev] AltView* classes >
> >
> On Tue, 2 Mar 2004, Richard Guenther wrote: >
> >
> > On Fri, 27 Feb 2004, Richard Guenther wrote: >
> > >
> > > Hi! >
> > > >
> > > Does anyone remember the exact reason for the existance of the >
> AltView* >
> > > classes in Array.h and Field.h?  Removing them and fixing their usage >
> to >
> > > use View* seems to work (full test with gcc 3.3 and 3.4 in progress). >
> > >
> > Testing completed with no new failures.  Would it be ok to remove those >
> > AltView* classes? >
> >
> Which would be... >
> >
> Ok? >
> >
> Richard. >
> >
> >
> 2004Mar02  Richard Guenther <richard.guenther at uni-tuebingen.de> >
> >
>       * src/Array/Array.h: remove all traces of AltView0 class. >
>       src/Field/Field.h: remove all traces of AltView1 and >
>       AltView1Implementation classes. >
> >
> ===== Array/Array.h 1.14 vs edited ===== >
> --- 1.14/r2/src/Array/Array.h Tue Dec 16 15:19:57 2003 >
> +++ edited/Array/Array.h      Tue Mar  2 11:24:14 2004 >
> @@ -649,8 +649,6 @@ >
>  // an existing engine cannot be any kind of slice domain. >
>  // Also, bounds checking would make no sense because it would >
>  // reduce to contains(a.domain(), a.domain()); >
> -// >
> -// Any changes to this class should also be made to AltView0. >
> >
>  template<int Dim, class T, class EngineTag> >
>  struct View0<Array<Dim, T, EngineTag> > >
> @@ -695,41 +693,6 @@ >
>      } >
>  }; >
> >
> -// AltView0 avoids an instantiation problem that arises when two >
> -// classes use each other.  This class's definition should be exactly >
> -// the same as View0 except omitting member functions. >
> -// >
> -// Do NOT explicitly instantiate this class. >
> - >
> -template<class ArrayTag> >
> -struct AltView0; >
> - >
> -template<int Dim, class T, class EngineTag> >
> -struct AltView0<Array<Dim, T, EngineTag> > >
> -{ >
> -  // Convenience typedef for the thing we're taking a view of. >
> - >
> -  typedef Array<Dim, T, EngineTag> Subject_t; >
> - >
> -  // Deduce domains for the output type. >
> -  // At some point, we need to fix NewDomain1; until then, use >
> -  // the temporary version from Array.h. >
> - >
> -  typedef typename Subject_t::Engine_t Engine_t; >
> -  typedef typename Subject_t::Domain_t Domain_t; >
> - >
> -  // Deduce the template parameters for the output type. >
> - >
> -  typedef typename NewEngine<Engine_t, Domain_t>::Type_t NewEngine_t; >
> -  enum { newDim = NewEngine_t::dimensions }; >
> -  typedef typename NewEngine_t::Tag_t NewEngineTag_t; >
> - >
> -  // The output types. >
> - >
> -  typedef Array<newDim, T, NewEngineTag_t> Type_t; >
> -  typedef Type_t ReadType_t; >
> -}; >
> - >
>  template<int Dim, class T, class EngineTag> >
>  struct View1<Array<Dim, T, EngineTag>, int> >
>  { >
> @@ -1864,7 +1827,7 @@ >
>    /// A zero-argument version of operator(), which takes a view of >
>    /// array's domain, is also supplied. >
>    //@{ >
> -  typename AltView0<This_t>::ReadType_t >
> +  typename View0<This_t>::ReadType_t >
>    read() const >
>      { >
>        typedef View0<This_t> Ret_t; >
> @@ -1934,7 +1897,7 @@ >
>        return Ret_t::makeRead(*this, s1, s2, s3, s4, s5, s6, s7); >
>      } >
> >
> -  typename AltView0<This_t>::Type_t >
> +  typename View0<This_t>::Type_t >
>    operator()() const >
>      { >
>        typedef View0<This_t> Ret_t; >
> ===== Field/Field.h 1.14 vs edited ===== >
> --- 1.14/r2/src/Field/Field.h Tue Dec 16 15:20:00 2003 >
> +++ edited/Field/Field.h      Tue Mar  2 11:25:22 2004 >
> @@ -269,9 +269,6 @@ >
>   * View1Implementation<Field, D, SV> specialization for indexing a field >
>   * with a single domain. There is a single-valued version (SV == true) >
>   * and a multi-valued version (SV == false). >
> - * >
> - * Any changes to View1Implementation should also be made to >
> - * AltView1Implementation. >
>   */ >
> >
>  // Single-valued version. Handles scalars and Locs. >
> @@ -508,62 +505,7 @@ >
> >
> >
>  /** >
> - * AltView1Implementation avoids an instantiation problem that arises >
> when two >
> - * classes use each other.  This class's definition should be exactly >
> - * the same as View1Implementation except omitting member functions. >
> - * >
> - * Do NOT explicitly instantiate this class. >
> - */ >
> - >
> -// Single-valued version. Handles scalars and Locs. >
> - >
> -template<class Subject, class Domain, bool SV> >
> -struct AltView1Implementation; >
> - >
> -template<class Mesh, class T, class EngineTag, class Domain> >
> -struct AltView1Implementation<Field<Mesh, T, EngineTag>, Domain, true> >
> -{ >
> -  // Convenience typedef for the thing we're taking a view of. >
> - >
> -  typedef Field<Mesh, T, EngineTag> Subject_t; >
> - >
> -  // The return types are pretty simple here. >
> - >
> -  typedef typename Subject_t::Element_t ReadType_t; >
> -  typedef typename Subject_t::ElementRef_t Type_t; >
> -}; >
> - >
> -template<class Mesh, class T, class EngineTag, class Domain> >
> -struct AltView1Implementation<Field<Mesh, T, EngineTag>, Domain, false> >
> -{ >
> -  // Convenience typedef for the thing we're taking a view of. >
> - >
> -  typedef Field<Mesh, T, EngineTag> Subject_t; >
> - >
> -  // Deduce domains for the output type. >
> - >
> -  typedef typename Subject_t::Engine_t Engine_t; >
> -  typedef typename NewEngine<Engine_t, Domain>::Type_t NewEngine_t; >
> -  typedef typename NewEngine_t::Element_t NewT_t; >
> -  typedef typename NewEngine_t::Tag_t NewEngineTag_t; >
> - >
> -  // Deduce the new Mesh. >
> - >
> -  typedef typename >
> -    NewMeshTag<NewEngine_t::dimensions, Mesh, Domain>::Type_t >
> -      NewMeshTag_t; >
> - >
> -  // The output types. >
> - >
> -  typedef Field<NewMeshTag_t, NewT_t, NewEngineTag_t> ReadType_t; >
> -  typedef Field<NewMeshTag_t, NewT_t, NewEngineTag_t> Type_t; >
> -}; >
> - >
> - >
> -/** >
>   * View1<Field, S1> specialization for indexing a field with a single >
> domain. >
> - * >
> - * Any changes to View1 should also be made to AltView1. >
>   */ >
> >
>  template<class Mesh, class T, class EngineTag, class Sub1> >
> @@ -613,8 +555,6 @@ >
> >
>  /** >
>   * View1<Field, int> specialization for indexing a field with an int. >
> - * >
> - * Any changes to View1 should also be made to AltView1. >
>   */ >
> >
>  template<class Mesh, class T, class EngineTag> >
> @@ -658,71 +598,6 @@ >
> >
> >
>  /** >
> - * AltView1 avoids an instantiation problem that arises when two >
> - * classes use each other.  This class's definition should be exactly >
> - * the same as View1 except omitting member functions. >
> - * >
> - * Do NOT explicitly instantiate this class. >
> - */ >
> - >
> -template<class FieldTag, class DomainTag> >
> -struct AltView1; >
> - >
> -template<class Mesh, class T, class EngineTag, class Sub1> >
> -struct AltView1<Field<Mesh, T, EngineTag>, Sub1> >
> -{ >
> -  // Convenience typedef for the thing we're taking a view of. >
> - >
> -  typedef Field<Mesh, T, EngineTag> Subject_t; >
> - >
> -  // Deduce domains for the output type. >
> -  // At some point, we need to fix NewDomain1; until then, use >
> -  // the temporary version from NewDomain.h. >
> - >
> -  typedef typename Subject_t::Domain_t Domain_t; >
> -  typedef TemporaryNewDomain1<Domain_t, Sub1> NewDomain_t; >
> -  typedef typename NewDomain_t::SliceType_t SDomain_t; >
> - >
> -  // Deduce appropriate version of implementation to dispatch to. >
> - >
> -  enum { sv = DomainTraits<SDomain_t>::singleValued }; >
> -  typedef AltView1Implementation<Subject_t, SDomain_t, sv> Dispatch_t; >
> - >
> -  // The optimized domain combiner. >
> - >
> -  typedef CombineDomainOpt<NewDomain_t, sv> Combine_t; >
> - >
> -  // The return types. >
> - >
> -  typedef typename Dispatch_t::ReadType_t ReadType_t; >
> -  typedef typename Dispatch_t::Type_t Type_t; >
> -}; >
> - >
> - >
> -/** >
> - * AltView1 avoids an instantiation problem that arises when two >
> - * classes use each other.  This class's definition should be exactly >
> - * the same as View1 except omitting member functions. >
> - * >
> - * Do NOT explicitly instantiate this class. >
> - */ >
> - >
> -template<class Mesh, class T, class EngineTag> >
> -struct AltView1<Field<Mesh, T, EngineTag>, int> >
> -{ >
> -  // Convenience typedef for the thing we're taking a view of. >
> - >
> -  typedef Field<Mesh, T, EngineTag> Subject_t; >
> - >
> -  // The return types. >
> - >
> -  typedef typename Subject_t::Element_t ReadType_t; >
> -  typedef typename Subject_t::ElementRef_t Type_t; >
> - >
> -}; >
> - >
> - >
> -/** >
>   * View2<Field, S1, S2> specialization for indexing a field with two >
>   * domains. >
>   */ >
> @@ -1455,14 +1330,14 @@ >
>    /// point fields the viewing domain is an actual centering domain. >
>    //@{ >
> >
> -  inline typename AltView1<This_t, Domain_t>::ReadType_t >
> +  inline typename View1<This_t, Domain_t>::ReadType_t >
>    read() const >
>      { >
>        typedef View1<This_t, Domain_t> Ret_t; >
>        return Ret_t::makeRead(*this, physicalDomain()); >
>      } >
> >
> -  inline typename AltView1<This_t, Domain_t>::ReadType_t >
> +  inline typename View1<This_t, Domain_t>::ReadType_t >
>    readAll() const >
>      { >
>        typedef View1<This_t, Domain_t> Ret_t; >
> @@ -1470,7 +1345,7 @@ >
>      } >
> >
>    template<class Sub1> >
> -  inline typename AltView1<This_t, Sub1>::ReadType_t >
> +  inline typename View1<This_t, Sub1>::ReadType_t >
>    read(const Sub1 &s1) const >
>      { >
>        typedef View1<This_t, Sub1> Ret_t; >
> @@ -1493,14 +1368,14 @@ >
>        return Ret_t::makeRead(*this, s1, s2, s3); >
>      } >
> >
> -  inline typename AltView1<This_t, Domain_t>::Type_t >
> +  inline typename View1<This_t, Domain_t>::Type_t >
>    operator()() const >
>      { >
>        typedef View1<This_t, Domain_t> Ret_t; >
>        return Ret_t::make(*this, physicalDomain()); >
>      } >
> >
> -  inline typename AltView1<This_t, Domain_t>::Type_t >
> +  inline typename View1<This_t, Domain_t>::Type_t >
>    all() const >
>      { >
>        typedef View1<This_t, Domain_t> Ret_t; >
> @@ -1508,7 +1383,7 @@ >
>      } >
> >
>    template<class Sub1> >
> -  inline typename AltView1<This_t, Sub1>::Type_t >
> +  inline typename View1<This_t, Sub1>::Type_t >
>    operator()(const Sub1 &s1) const >
>      { >
>        typedef View1<This_t, Sub1> Ret_t; >

> > > From jcrotinger at proximation.com Tue Mar 2 17:03:20 2004 From: jcrotinger at proximation.com (James Crotinger) Date: Tue, 2 Mar 2004 10:03:20 -0700 Subject: [pooma-dev] AltView* classes Message-ID: Hi all, Jeffrey's email shook a few more things loose. :) Yes, more classes means more parse time, but the issue was link time. The Blanca folk did explicit instantiation of as much stuff as they could. My recollection was that without explicit instantiation, there was a link-time compile for every view in every file that took a view, or something like that. There was a problem doing implicit instantiation of the views themselves, though I don't remember what the issue was. The solution was to move the enum into the AltView class and explicitly instantiate all of these. With this addition, the linker always found the sv variable and no additional link-time compile was needed. This is obviously coming from some pretty rusty neurons, but I believe this is the crux of the issue. For large codes, POOMA is a pig at link/compile time (depending on the instantiation model) and there were various possibly non-obvious factorings made along the way in order to try to keep this under control. 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: Tuesday, March 02, 2004 9:54 AM > To: Jeffrey D. Oldham > Cc: James Crotinger; 'pooma-dev at pooma.codesourcery.com' > Subject: Re: [pooma-dev] AltView* classes > > Jeffrey D. Oldham wrote: > > > > James Crotinger wrote: > > > >> Hi Richard, > >> > >> This tickled a neuron the other day, but I couldn't recall the details. > >> > >> The AltView classes were put in to reduce link times and sizes for > >> large codes. The classes that have enums end up having a link-time > >> cost, both in space and time. I believe this refactoring was done to > >> reduce the cardinality of classes having the "sv" enum. My > >> recollection is that this, and other similar "optimizations", had a > >> pretty substantial impact on link-time for Blanca. Unless these are > >> hurting something else, I would tend to leave them in. > > It seems they are only used for return type creation which hinted me > that it may have beed a compiler bug workaround (so does the CVS > histroy). As an optimization this looks worthless at it just adds > classes to parse. No? > > > > The POOMA CVS repository history goes back to at least 1998 March. For > > example, see the log for src/Array/Array.h. This log gives an entry for > > AltView0 and AltView1Implementation: > > > > revision 1.141 > > date: 2001/05/25 17:42:48; author: oldham; state: Exp; lines: +47 -6 > > branches: 1.141.4; > > 2001-05-25 Jeffrey D. Oldham > > * Array/Array.h (View0): Modify initial comment to indicate > > changes should also be made to AltView0. > > (AltView0): New class to avoid explicit instantiation problems. > > The same comment is above the classes in the source, but it's not very > helpful in trying to figure out what these problems are/were. > > It's in my tree now, so I won't forget about it at least until the next > treediff to CVS. > > Richard. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jcrotinger at proximation.com Tue Mar 2 17:05:55 2004 From: jcrotinger at proximation.com (James Crotinger) Date: Tue, 2 Mar 2004 10:05:55 -0700 Subject: [pooma-dev] AltView* classes Message-ID: OK - cool. Thanks for chipping in Dave. You're neurons are obviously less rusty than mine. :) 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: Dave Nystrom [mailto:wdn at lanl.gov] > Sent: Tuesday, March 02, 2004 10:00 AM > To: James Crotinger > Cc: 'Richard Guenther'; 'pooma-dev at pooma.codesourcery.com'; 'Jeffrey D. > Oldham'; John Hall; Dave Nystrom; Dave Nystrom > Subject: RE: [pooma-dev] AltView* classes > > These AltView classes were put in by Jeffrey Oldham to fix a problem that > I > was having trying to explicitly instantiate all the Pooma classes and > functions that Blanca code was using. Basically, the way the Pooma 2 > Field > class was originally written, we were getting one of these "sv" enums > instantiated for every unique expression which we had in our source code > base. I was unable to explicitly instantiate these "sv" enums the way the > code was originally written because of some issue which Arch Robison of > Kuck > and Associates (now Intel) identified - basically the code in it's > original > form violated some corner case of the C++ standard according to Arch. > Jeffrey fixed this problem by adding the AltView class and then I was able > to > perform the explicit instantiations that I needed. > > However, I believe Jeffrey or someone else has gone through the code and > replaced the "sv" enums with some other construct which does not have the > explicit instantiation difficulties that the "sv" enums had. So, I think > that it is probably okay to remove the AltView classes and that this would > clean up the code considerably. I may revisit all this explicit > instantiation stuff sometime in the not to distant future on a hobby basis > (weird hobby, huh) and if I encounter difficulties being able to > explicitly > instantiate anything, I could then raise it as an issue at that time. > > In summary, the AltView classes were added by Jeffrey to fix an explicit > instantiation problem that I think no longer exists and I am in favor of > now > removing them in the interest of cleaning up the code as much as possible. > > -- > Dave Nystrom email: wdn at lanl.gov > LANL X-2 phone: 505-667-7913 fax: 505-665-2227 > > James Crotinger writes: > > Hi Richard, > > > > This tickled a neuron the other day, but I couldn't recall the details. > > > > The AltView classes were put in to reduce link times and sizes for > large > > codes. The classes that have enums end up having a link-time cost, both > in > > space and time. I believe this refactoring was done to reduce the > > cardinality of classes having the "sv" enum. My recollection is that > this, > > and other similar "optimizations", had a pretty substantial impact on > > link-time for Blanca. Unless these are hurting something else, I would > tend > > to leave them in. > > > > Does the CodeSourcery CVS repository have complete CVS history? (i.e. > did we > > copy the repository, or just the head version?) This should have been > easy > > to determine via CVS. > > > > 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: Tuesday, March 02, 2004 3:29 AM > > > To: pooma-dev at pooma.codesourcery.com > > > Cc: Jeffrey D. Oldham > > > Subject: Re: [pooma-dev] AltView* classes > > > > > > On Tue, 2 Mar 2004, Richard Guenther wrote: > > > > > > > On Fri, 27 Feb 2004, Richard Guenther wrote: > > > > > > > > > Hi! > > > > > > > > > > Does anyone remember the exact reason for the existance of the > > > AltView* > > > > > classes in Array.h and Field.h? Removing them and fixing their > usage > > > to > > > > > use View* seems to work (full test with gcc 3.3 and 3.4 in > progress). > > > > > > > > Testing completed with no new failures. Would it be ok to remove > those > > > > AltView* classes? > > > > > > Which would be... > > > > > > Ok? > > > > > > Richard. > > > > > > > > > 2004Mar02 Richard Guenther > > > > > > * src/Array/Array.h: remove all traces of AltView0 class. > > > src/Field/Field.h: remove all traces of AltView1 and > > > AltView1Implementation classes. > > > > > > ===== Array/Array.h 1.14 vs edited ===== > > > --- 1.14/r2/src/Array/Array.h Tue Dec 16 15:19:57 2003 > > > +++ edited/Array/Array.h Tue Mar 2 11:24:14 2004 > > > @@ -649,8 +649,6 @@ > > > // an existing engine cannot be any kind of slice domain. > > > // Also, bounds checking would make no sense because it would > > > // reduce to contains(a.domain(), a.domain()); > > > -// > > > -// Any changes to this class should also be made to AltView0. > > > > > > template > > > struct View0 > > > > @@ -695,41 +693,6 @@ > > > } > > > }; > > > > > > -// AltView0 avoids an instantiation problem that arises when two > > > -// classes use each other. This class's definition should be > exactly > > > -// the same as View0 except omitting member functions. > > > -// > > > -// Do NOT explicitly instantiate this class. > > > - > > > -template > > > -struct AltView0; > > > - > > > -template > > > -struct AltView0 > > > > -{ > > > - // Convenience typedef for the thing we're taking a view of. > > > - > > > - typedef Array Subject_t; > > > - > > > - // Deduce domains for the output type. > > > - // At some point, we need to fix NewDomain1; until then, use > > > - // the temporary version from Array.h. > > > - > > > - typedef typename Subject_t::Engine_t Engine_t; > > > - typedef typename Subject_t::Domain_t Domain_t; > > > - > > > - // Deduce the template parameters for the output type. > > > - > > > - typedef typename NewEngine::Type_t > NewEngine_t; > > > - enum { newDim = NewEngine_t::dimensions }; > > > - typedef typename NewEngine_t::Tag_t NewEngineTag_t; > > > - > > > - // The output types. > > > - > > > - typedef Array Type_t; > > > - typedef Type_t ReadType_t; > > > -}; > > > - > > > template > > > struct View1, int> > > > { > > > @@ -1864,7 +1827,7 @@ > > > /// A zero-argument version of operator(), which takes a view of > > > /// array's domain, is also supplied. > > > //@{ > > > - typename AltView0::ReadType_t > > > + typename View0::ReadType_t > > > read() const > > > { > > > typedef View0 Ret_t; > > > @@ -1934,7 +1897,7 @@ > > > return Ret_t::makeRead(*this, s1, s2, s3, s4, s5, s6, s7); > > > } > > > > > > - typename AltView0::Type_t > > > + typename View0::Type_t > > > operator()() const > > > { > > > typedef View0 Ret_t; > > > ===== Field/Field.h 1.14 vs edited ===== > > > --- 1.14/r2/src/Field/Field.h Tue Dec 16 15:20:00 2003 > > > +++ edited/Field/Field.h Tue Mar 2 11:25:22 2004 > > > @@ -269,9 +269,6 @@ > > > * View1Implementation specialization for indexing a > field > > > * with a single domain. There is a single-valued version (SV == > true) > > > * and a multi-valued version (SV == false). > > > - * > > > - * Any changes to View1Implementation should also be made to > > > - * AltView1Implementation. > > > */ > > > > > > // Single-valued version. Handles scalars and Locs. > > > @@ -508,62 +505,7 @@ > > > > > > > > > /** > > > - * AltView1Implementation avoids an instantiation problem that > arises > > > when two > > > - * classes use each other. This class's definition should be > exactly > > > - * the same as View1Implementation except omitting member functions. > > > - * > > > - * Do NOT explicitly instantiate this class. > > > - */ > > > - > > > -// Single-valued version. Handles scalars and Locs. > > > - > > > -template > > > -struct AltView1Implementation; > > > - > > > -template > > > -struct AltView1Implementation, Domain, > true> > > > -{ > > > - // Convenience typedef for the thing we're taking a view of. > > > - > > > - typedef Field Subject_t; > > > - > > > - // The return types are pretty simple here. > > > - > > > - typedef typename Subject_t::Element_t ReadType_t; > > > - typedef typename Subject_t::ElementRef_t Type_t; > > > -}; > > > - > > > -template > > > -struct AltView1Implementation, Domain, > false> > > > -{ > > > - // Convenience typedef for the thing we're taking a view of. > > > - > > > - typedef Field Subject_t; > > > - > > > - // Deduce domains for the output type. > > > - > > > - typedef typename Subject_t::Engine_t Engine_t; > > > - typedef typename NewEngine::Type_t NewEngine_t; > > > - typedef typename NewEngine_t::Element_t NewT_t; > > > - typedef typename NewEngine_t::Tag_t NewEngineTag_t; > > > - > > > - // Deduce the new Mesh. > > > - > > > - typedef typename > > > - NewMeshTag::Type_t > > > - NewMeshTag_t; > > > - > > > - // The output types. > > > - > > > - typedef Field ReadType_t; > > > - typedef Field Type_t; > > > -}; > > > - > > > - > > > -/** > > > * View1 specialization for indexing a field with a > single > > > domain. > > > - * > > > - * Any changes to View1 should also be made to AltView1. > > > */ > > > > > > template > > > @@ -613,8 +555,6 @@ > > > > > > /** > > > * View1 specialization for indexing a field with an > int. > > > - * > > > - * Any changes to View1 should also be made to AltView1. > > > */ > > > > > > template > > > @@ -658,71 +598,6 @@ > > > > > > > > > /** > > > - * AltView1 avoids an instantiation problem that arises when two > > > - * classes use each other. This class's definition should be > exactly > > > - * the same as View1 except omitting member functions. > > > - * > > > - * Do NOT explicitly instantiate this class. > > > - */ > > > - > > > -template > > > -struct AltView1; > > > - > > > -template > > > -struct AltView1, Sub1> > > > -{ > > > - // Convenience typedef for the thing we're taking a view of. > > > - > > > - typedef Field Subject_t; > > > - > > > - // Deduce domains for the output type. > > > - // At some point, we need to fix NewDomain1; until then, use > > > - // the temporary version from NewDomain.h. > > > - > > > - typedef typename Subject_t::Domain_t Domain_t; > > > - typedef TemporaryNewDomain1 NewDomain_t; > > > - typedef typename NewDomain_t::SliceType_t SDomain_t; > > > - > > > - // Deduce appropriate version of implementation to dispatch to. > > > - > > > - enum { sv = DomainTraits::singleValued }; > > > - typedef AltView1Implementation > Dispatch_t; > > > - > > > - // The optimized domain combiner. > > > - > > > - typedef CombineDomainOpt Combine_t; > > > - > > > - // The return types. > > > - > > > - typedef typename Dispatch_t::ReadType_t ReadType_t; > > > - typedef typename Dispatch_t::Type_t Type_t; > > > -}; > > > - > > > - > > > -/** > > > - * AltView1 avoids an instantiation problem that arises when two > > > - * classes use each other. This class's definition should be > exactly > > > - * the same as View1 except omitting member functions. > > > - * > > > - * Do NOT explicitly instantiate this class. > > > - */ > > > - > > > -template > > > -struct AltView1, int> > > > -{ > > > - // Convenience typedef for the thing we're taking a view of. > > > - > > > - typedef Field Subject_t; > > > - > > > - // The return types. > > > - > > > - typedef typename Subject_t::Element_t ReadType_t; > > > - typedef typename Subject_t::ElementRef_t Type_t; > > > - > > > -}; > > > - > > > - > > > -/** > > > * View2 specialization for indexing a field with two > > > * domains. > > > */ > > > @@ -1455,14 +1330,14 @@ > > > /// point fields the viewing domain is an actual centering domain. > > > //@{ > > > > > > - inline typename AltView1::ReadType_t > > > + inline typename View1::ReadType_t > > > read() const > > > { > > > typedef View1 Ret_t; > > > return Ret_t::makeRead(*this, physicalDomain()); > > > } > > > > > > - inline typename AltView1::ReadType_t > > > + inline typename View1::ReadType_t > > > readAll() const > > > { > > > typedef View1 Ret_t; > > > @@ -1470,7 +1345,7 @@ > > > } > > > > > > template > > > - inline typename AltView1::ReadType_t > > > + inline typename View1::ReadType_t > > > read(const Sub1 &s1) const > > > { > > > typedef View1 Ret_t; > > > @@ -1493,14 +1368,14 @@ > > > return Ret_t::makeRead(*this, s1, s2, s3); > > > } > > > > > > - inline typename AltView1::Type_t > > > + inline typename View1::Type_t > > > operator()() const > > > { > > > typedef View1 Ret_t; > > > return Ret_t::make(*this, physicalDomain()); > > > } > > > > > > - inline typename AltView1::Type_t > > > + inline typename View1::Type_t > > > all() const > > > { > > > typedef View1 Ret_t; > > > @@ -1508,7 +1383,7 @@ > > > } > > > > > > template > > > - inline typename AltView1::Type_t > > > + inline typename View1::Type_t > > > operator()(const Sub1 &s1) const > > > { > > > typedef View1 Ret_t; > > > > > > > > > > > > RE: [pooma-dev] AltView* classes > > > > > > > >

Hi Richard, > >

> > > >

This tickled a neuron the other day, but I couldn't > recall the details. > >

> > > >

The AltView classes were put in to reduce link times > and sizes for large codes. The classes that have enums end up having a > link-time cost, both in space and time. I believe this refactoring was > done to reduce the cardinality of classes having the "sv" enum. > My recollection is that this, and other similar "optimizations", > had a pretty substantial impact on link-time for Blanca. Unless these are > hurting something else, I would tend to leave them in.

> > > >

Does the CodeSourcery CVS repository have complete CVS > history? (i.e. did we copy the repository, or just the head version?) This > should have been easy to determine via CVS.

> > > >

        Jim > >

> > > >

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

> > > >

> -----Original Message----- > >
> From: Richard Guenther [ HREF="mailto:rguenth at tat.physik.uni- > tuebingen.de">mailto:rguenth at tat.physik.uni-tuebingen.de] > >
> Sent: Tuesday, March 02, 2004 3:29 AM > >
> To: pooma-dev at pooma.codesourcery.com > >
> Cc: Jeffrey D. Oldham > >
> Subject: Re: [pooma-dev] AltView* classes > >
> > >
> On Tue, 2 Mar 2004, Richard Guenther > wrote: > >
> > >
> > On Fri, 27 Feb 2004, Richard Guenther > wrote: > >
> > > >
> > > Hi! > >
> > > > >
> > > Does anyone remember the exact reason > for the existance of the > >
> AltView* > >
> > > classes in Array.h and Field.h?  > Removing them and fixing their usage > >
> to > >
> > > use View* seems to work (full test with > gcc 3.3 and 3.4 in progress). > >
> > > >
> > Testing completed with no new > failures.  Would it be ok to remove those > >
> > AltView* classes? > >
> > >
> Which would be... > >
> > >
> Ok? > >
> > >
> Richard. > >
> > >
> > >
> 2004Mar02  Richard Guenther > <richard.guenther at uni-tuebingen.de> > >
> > >
>       * > src/Array/Array.h: remove all traces of AltView0 class. > >
>       src/Field/Field.h: > remove all traces of AltView1 and > >
>       > AltView1Implementation classes. > >
> > >
> ===== Array/Array.h 1.14 vs edited ===== > >
> --- 1.14/r2/src/Array/Array.h Tue Dec 16 15:19:57 > 2003 > >
> +++ > edited/Array/Array.h      Tue Mar  2 > 11:24:14 2004 > >
> @@ -649,8 +649,6 @@ > >
>  // an existing engine cannot be any kind of > slice domain. > >
>  // Also, bounds checking would make no > sense because it would > >
>  // reduce to contains(a.domain(), > a.domain()); > >
> -// > >
> -// Any changes to this class should also be made > to AltView0. > >
> > >
>  template<int Dim, class T, class > EngineTag> > >
>  struct View0<Array<Dim, T, > EngineTag> > > >
> @@ -695,41 +693,6 @@ > >
>      } > >
>  }; > >
> > >
> -// AltView0 avoids an instantiation problem that > arises when two > >
> -// classes use each other.  This class's > definition should be exactly > >
> -// the same as View0 except omitting member > functions. > >
> -// > >
> -// Do NOT explicitly instantiate this > class. > >
> - > >
> -template<class ArrayTag> > >
> -struct AltView0; > >
> - > >
> -template<int Dim, class T, class > EngineTag> > >
> -struct AltView0<Array<Dim, T, > EngineTag> > > >
> -{ > >
> -  // Convenience typedef for the thing > we're taking a view of. > >
> - > >
> -  typedef Array<Dim, T, EngineTag> > Subject_t; > >
> - > >
> -  // Deduce domains for the output > type. > >
> -  // At some point, we need to fix > NewDomain1; until then, use > >
> -  // the temporary version from > Array.h. > >
> - > >
> -  typedef typename Subject_t::Engine_t > Engine_t; > >
> -  typedef typename Subject_t::Domain_t > Domain_t; > >
> - > >
> -  // Deduce the template parameters for the > output type. > >
> - > >
> -  typedef typename NewEngine<Engine_t, > Domain_t>::Type_t NewEngine_t; > >
> -  enum { newDim = NewEngine_t::dimensions > }; > >
> -  typedef typename NewEngine_t::Tag_t > NewEngineTag_t; > >
> - > >
> -  // The output types. > >
> - > >
> -  typedef Array<newDim, T, > NewEngineTag_t> Type_t; > >
> -  typedef Type_t ReadType_t; > >
> -}; > >
> - > >
>  template<int Dim, class T, class > EngineTag> > >
>  struct View1<Array<Dim, T, > EngineTag>, int> > >
>  { > >
> @@ -1864,7 +1827,7 @@ > >
>    /// A zero-argument version of > operator(), which takes a view of > >
>    /// array's domain, is also > supplied. > >
>    //@{ > >
> -  typename > AltView0<This_t>::ReadType_t > >
> +  typename > View0<This_t>::ReadType_t > >
>    read() const > >
>      { > >
>        typedef > View0<This_t> Ret_t; > >
> @@ -1934,7 +1897,7 @@ > >
>        return > Ret_t::makeRead(*this, s1, s2, s3, s4, s5, s6, s7); > >
>      } > >
> > >
> -  typename > AltView0<This_t>::Type_t > >
> +  typename > View0<This_t>::Type_t > >
>    operator()() const > >
>      { > >
>        typedef > View0<This_t> Ret_t; > >
> ===== Field/Field.h 1.14 vs edited ===== > >
> --- 1.14/r2/src/Field/Field.h Tue Dec 16 15:20:00 > 2003 > >
> +++ > edited/Field/Field.h      Tue Mar  2 > 11:25:22 2004 > >
> @@ -269,9 +269,6 @@ > >
>   * View1Implementation<Field, D, > SV> specialization for indexing a field > >
>   * with a single domain. There is a > single-valued version (SV == true) > >
>   * and a multi-valued version (SV == > false). > >
> - * > >
> - * Any changes to View1Implementation should > also be made to > >
> - * AltView1Implementation. > >
>   */ > >
> > >
>  // Single-valued version. Handles scalars > and Locs. > >
> @@ -508,62 +505,7 @@ > >
> > >
> > >
>  /** > >
> - * AltView1Implementation avoids an > instantiation problem that arises > >
> when two > >
> - * classes use each other.  This class's > definition should be exactly > >
> - * the same as View1Implementation except > omitting member functions. > >
> - * > >
> - * Do NOT explicitly instantiate this > class. > >
> - */ > >
> - > >
> -// Single-valued version. Handles scalars and > Locs. > >
> - > >
> -template<class Subject, class Domain, bool > SV> > >
> -struct AltView1Implementation; > >
> - > >
> -template<class Mesh, class T, class > EngineTag, class Domain> > >
> -struct AltView1Implementation<Field<Mesh, > T, EngineTag>, Domain, true> > >
> -{ > >
> -  // Convenience typedef for the thing > we're taking a view of. > >
> - > >
> -  typedef Field<Mesh, T, EngineTag> > Subject_t; > >
> - > >
> -  // The return types are pretty simple > here. > >
> - > >
> -  typedef typename Subject_t::Element_t > ReadType_t; > >
> -  typedef typename Subject_t::ElementRef_t > Type_t; > >
> -}; > >
> - > >
> -template<class Mesh, class T, class > EngineTag, class Domain> > >
> -struct AltView1Implementation<Field<Mesh, > T, EngineTag>, Domain, false> > >
> -{ > >
> -  // Convenience typedef for the thing > we're taking a view of. > >
> - > >
> -  typedef Field<Mesh, T, EngineTag> > Subject_t; > >
> - > >
> -  // Deduce domains for the output > type. > >
> - > >
> -  typedef typename Subject_t::Engine_t > Engine_t; > >
> -  typedef typename NewEngine<Engine_t, > Domain>::Type_t NewEngine_t; > >
> -  typedef typename NewEngine_t::Element_t > NewT_t; > >
> -  typedef typename NewEngine_t::Tag_t > NewEngineTag_t; > >
> - > >
> -  // Deduce the new Mesh. > >
> - > >
> -  typedef typename > >
> -    > NewMeshTag<NewEngine_t::dimensions, Mesh, Domain>::Type_t > >
> -      > NewMeshTag_t; > >
> - > >
> -  // The output types. > >
> - > >
> -  typedef Field<NewMeshTag_t, NewT_t, > NewEngineTag_t> ReadType_t; > >
> -  typedef Field<NewMeshTag_t, NewT_t, > NewEngineTag_t> Type_t; > >
> -}; > >
> - > >
> - > >
> -/** > >
>   * View1<Field, S1> > specialization for indexing a field with a single > >
> domain. > >
> - * > >
> - * Any changes to View1 should also be made to > AltView1. > >
>   */ > >
> > >
>  template<class Mesh, class T, class > EngineTag, class Sub1> > >
> @@ -613,8 +555,6 @@ > >
> > >
>  /** > >
>   * View1<Field, int> > specialization for indexing a field with an int. > >
> - * > >
> - * Any changes to View1 should also be made to > AltView1. > >
>   */ > >
> > >
>  template<class Mesh, class T, class > EngineTag> > >
> @@ -658,71 +598,6 @@ > >
> > >
> > >
>  /** > >
> - * AltView1 avoids an instantiation problem that > arises when two > >
> - * classes use each other.  This class's > definition should be exactly > >
> - * the same as View1 except omitting member > functions. > >
> - * > >
> - * Do NOT explicitly instantiate this > class. > >
> - */ > >
> - > >
> -template<class FieldTag, class > DomainTag> > >
> -struct AltView1; > >
> - > >
> -template<class Mesh, class T, class > EngineTag, class Sub1> > >
> -struct AltView1<Field<Mesh, T, > EngineTag>, Sub1> > >
> -{ > >
> -  // Convenience typedef for the thing > we're taking a view of. > >
> - > >
> -  typedef Field<Mesh, T, EngineTag> > Subject_t; > >
> - > >
> -  // Deduce domains for the output > type. > >
> -  // At some point, we need to fix > NewDomain1; until then, use > >
> -  // the temporary version from > NewDomain.h. > >
> - > >
> -  typedef typename Subject_t::Domain_t > Domain_t; > >
> -  typedef TemporaryNewDomain1<Domain_t, > Sub1> NewDomain_t; > >
> -  typedef typename NewDomain_t::SliceType_t > SDomain_t; > >
> - > >
> -  // Deduce appropriate version of > implementation to dispatch to. > >
> - > >
> -  enum { sv = > DomainTraits<SDomain_t>::singleValued }; > >
> -  typedef > AltView1Implementation<Subject_t, SDomain_t, sv> Dispatch_t; > >
> - > >
> -  // The optimized domain combiner. > >
> - > >
> -  typedef CombineDomainOpt<NewDomain_t, > sv> Combine_t; > >
> - > >
> -  // The return types. > >
> - > >
> -  typedef typename Dispatch_t::ReadType_t > ReadType_t; > >
> -  typedef typename Dispatch_t::Type_t > Type_t; > >
> -}; > >
> - > >
> - > >
> -/** > >
> - * AltView1 avoids an instantiation problem that > arises when two > >
> - * classes use each other.  This class's > definition should be exactly > >
> - * the same as View1 except omitting member > functions. > >
> - * > >
> - * Do NOT explicitly instantiate this > class. > >
> - */ > >
> - > >
> -template<class Mesh, class T, class > EngineTag> > >
> -struct AltView1<Field<Mesh, T, > EngineTag>, int> > >
> -{ > >
> -  // Convenience typedef for the thing > we're taking a view of. > >
> - > >
> -  typedef Field<Mesh, T, EngineTag> > Subject_t; > >
> - > >
> -  // The return types. > >
> - > >
> -  typedef typename Subject_t::Element_t > ReadType_t; > >
> -  typedef typename Subject_t::ElementRef_t > Type_t; > >
> - > >
> -}; > >
> - > >
> - > >
> -/** > >
>   * View2<Field, S1, S2> > specialization for indexing a field with two > >
>   * domains. > >
>   */ > >
> @@ -1455,14 +1330,14 @@ > >
>    /// point fields the viewing > domain is an actual centering domain. > >
>    //@{ > >
> > >
> -  inline typename AltView1<This_t, > Domain_t>::ReadType_t > >
> +  inline typename View1<This_t, > Domain_t>::ReadType_t > >
>    read() const > >
>      { > >
>        typedef > View1<This_t, Domain_t> Ret_t; > >
>        return > Ret_t::makeRead(*this, physicalDomain()); > >
>      } > >
> > >
> -  inline typename AltView1<This_t, > Domain_t>::ReadType_t > >
> +  inline typename View1<This_t, > Domain_t>::ReadType_t > >
>    readAll() const > >
>      { > >
>        typedef > View1<This_t, Domain_t> Ret_t; > >
> @@ -1470,7 +1345,7 @@ > >
>      } > >
> > >
>    template<class > Sub1> > >
> -  inline typename AltView1<This_t, > Sub1>::ReadType_t > >
> +  inline typename View1<This_t, > Sub1>::ReadType_t > >
>    read(const Sub1 &s1) > const > >
>      { > >
>        typedef > View1<This_t, Sub1> Ret_t; > >
> @@ -1493,14 +1368,14 @@ > >
>        return > Ret_t::makeRead(*this, s1, s2, s3); > >
>      } > >
> > >
> -  inline typename AltView1<This_t, > Domain_t>::Type_t > >
> +  inline typename View1<This_t, > Domain_t>::Type_t > >
>    operator()() const > >
>      { > >
>        typedef > View1<This_t, Domain_t> Ret_t; > >
>        return > Ret_t::make(*this, physicalDomain()); > >
>      } > >
> > >
> -  inline typename AltView1<This_t, > Domain_t>::Type_t > >
> +  inline typename View1<This_t, > Domain_t>::Type_t > >
>    all() const > >
>      { > >
>        typedef > View1<This_t, Domain_t> Ret_t; > >
> @@ -1508,7 +1383,7 @@ > >
>      } > >
> > >
>    template<class > Sub1> > >
> -  inline typename AltView1<This_t, > Sub1>::Type_t > >
> +  inline typename View1<This_t, > Sub1>::Type_t > >
>    operator()(const Sub1 &s1) > const > >
>      { > >
>        typedef > View1<This_t, Sub1> Ret_t; > >

> > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From wdn at lanl.gov Tue Mar 2 17:16:54 2004 From: wdn at lanl.gov (Dave Nystrom) Date: Tue, 2 Mar 2004 10:16:54 -0700 Subject: [pooma-dev] AltView* classes In-Reply-To: References: Message-ID: <16452.49542.996541.986692@bedell.lanl.gov> No problem. I think my neurons are less rusty because of my perverse hobby:-). I've actually compiled the Blanca Demo stuff in the last year and I try to keep up with evolution of Pooma 2 with the thought that I will sometime get back to using it. John, Don and Jean have actually been doing some work on the source code base in the last year. Also, the Blanca Demo project and it's progeny is the only Blanca related source code base that to my knowledge ever used Pooma 2. And supposedly, the Blanca project is dead and unlikely to use anything that we ever did. -- Dave Nystrom email: wdn at lanl.gov LANL X-2 phone: 505-667-7913 fax: 505-665-2227 James Crotinger writes: > OK - cool. Thanks for chipping in Dave. You're neurons are obviously less > rusty than mine. :) > > 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: Dave Nystrom [mailto:wdn at lanl.gov] > > Sent: Tuesday, March 02, 2004 10:00 AM > > To: James Crotinger > > Cc: 'Richard Guenther'; 'pooma-dev at pooma.codesourcery.com'; 'Jeffrey D. > > Oldham'; John Hall; Dave Nystrom; Dave Nystrom > > Subject: RE: [pooma-dev] AltView* classes > > > > These AltView classes were put in by Jeffrey Oldham to fix a problem that > > I > > was having trying to explicitly instantiate all the Pooma classes and > > functions that Blanca code was using. Basically, the way the Pooma 2 > > Field > > class was originally written, we were getting one of these "sv" enums > > instantiated for every unique expression which we had in our source code > > base. I was unable to explicitly instantiate these "sv" enums the way the > > code was originally written because of some issue which Arch Robison of > > Kuck > > and Associates (now Intel) identified - basically the code in it's > > original > > form violated some corner case of the C++ standard according to Arch. > > Jeffrey fixed this problem by adding the AltView class and then I was able > > to > > perform the explicit instantiations that I needed. > > > > However, I believe Jeffrey or someone else has gone through the code and > > replaced the "sv" enums with some other construct which does not have the > > explicit instantiation difficulties that the "sv" enums had. So, I think > > that it is probably okay to remove the AltView classes and that this would > > clean up the code considerably. I may revisit all this explicit > > instantiation stuff sometime in the not to distant future on a hobby basis > > (weird hobby, huh) and if I encounter difficulties being able to > > explicitly > > instantiate anything, I could then raise it as an issue at that time. > > > > In summary, the AltView classes were added by Jeffrey to fix an explicit > > instantiation problem that I think no longer exists and I am in favor of > > now > > removing them in the interest of cleaning up the code as much as possible. > > > > -- > > Dave Nystrom email: wdn at lanl.gov > > LANL X-2 phone: 505-667-7913 fax: 505-665-2227 > > > > James Crotinger writes: > > > Hi Richard, > > > > > > This tickled a neuron the other day, but I couldn't recall the details. > > > > > > The AltView classes were put in to reduce link times and sizes for > > large > > > codes. The classes that have enums end up having a link-time cost, both > > in > > > space and time. I believe this refactoring was done to reduce the > > > cardinality of classes having the "sv" enum. My recollection is that > > this, > > > and other similar "optimizations", had a pretty substantial impact on > > > link-time for Blanca. Unless these are hurting something else, I would > > tend > > > to leave them in. > > > > > > Does the CodeSourcery CVS repository have complete CVS history? (i.e. > > did we > > > copy the repository, or just the head version?) This should have been > > easy > > > to determine via CVS. > > > > > > 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: Tuesday, March 02, 2004 3:29 AM > > > > To: pooma-dev at pooma.codesourcery.com > > > > Cc: Jeffrey D. Oldham > > > > Subject: Re: [pooma-dev] AltView* classes > > > > > > > > On Tue, 2 Mar 2004, Richard Guenther wrote: > > > > > > > > > On Fri, 27 Feb 2004, Richard Guenther wrote: > > > > > > > > > > > Hi! > > > > > > > > > > > > Does anyone remember the exact reason for the existance of the > > > > AltView* > > > > > > classes in Array.h and Field.h? Removing them and fixing their > > usage > > > > to > > > > > > use View* seems to work (full test with gcc 3.3 and 3.4 in > > progress). > > > > > > > > > > Testing completed with no new failures. Would it be ok to remove > > those > > > > > AltView* classes? > > > > > > > > Which would be... > > > > > > > > Ok? > > > > > > > > Richard. > > > > > > > > > > > > 2004Mar02 Richard Guenther > > > > > > > > * src/Array/Array.h: remove all traces of AltView0 class. > > > > src/Field/Field.h: remove all traces of AltView1 and > > > > AltView1Implementation classes. > > > > > > > > ===== Array/Array.h 1.14 vs edited ===== > > > > --- 1.14/r2/src/Array/Array.h Tue Dec 16 15:19:57 2003 > > > > +++ edited/Array/Array.h Tue Mar 2 11:24:14 2004 > > > > @@ -649,8 +649,6 @@ > > > > // an existing engine cannot be any kind of slice domain. > > > > // Also, bounds checking would make no sense because it would > > > > // reduce to contains(a.domain(), a.domain()); > > > > -// > > > > -// Any changes to this class should also be made to AltView0. > > > > > > > > template > > > > struct View0 > > > > > @@ -695,41 +693,6 @@ > > > > } > > > > }; > > > > > > > > -// AltView0 avoids an instantiation problem that arises when two > > > > -// classes use each other. This class's definition should be > > exactly > > > > -// the same as View0 except omitting member functions. > > > > -// > > > > -// Do NOT explicitly instantiate this class. > > > > - > > > > -template > > > > -struct AltView0; > > > > - > > > > -template > > > > -struct AltView0 > > > > > -{ > > > > - // Convenience typedef for the thing we're taking a view of. > > > > - > > > > - typedef Array Subject_t; > > > > - > > > > - // Deduce domains for the output type. > > > > - // At some point, we need to fix NewDomain1; until then, use > > > > - // the temporary version from Array.h. > > > > - > > > > - typedef typename Subject_t::Engine_t Engine_t; > > > > - typedef typename Subject_t::Domain_t Domain_t; > > > > - > > > > - // Deduce the template parameters for the output type. > > > > - > > > > - typedef typename NewEngine::Type_t > > NewEngine_t; > > > > - enum { newDim = NewEngine_t::dimensions }; > > > > - typedef typename NewEngine_t::Tag_t NewEngineTag_t; > > > > - > > > > - // The output types. > > > > - > > > > - typedef Array Type_t; > > > > - typedef Type_t ReadType_t; > > > > -}; > > > > - > > > > template > > > > struct View1, int> > > > > { > > > > @@ -1864,7 +1827,7 @@ > > > > /// A zero-argument version of operator(), which takes a view of > > > > /// array's domain, is also supplied. > > > > //@{ > > > > - typename AltView0::ReadType_t > > > > + typename View0::ReadType_t > > > > read() const > > > > { > > > > typedef View0 Ret_t; > > > > @@ -1934,7 +1897,7 @@ > > > > return Ret_t::makeRead(*this, s1, s2, s3, s4, s5, s6, s7); > > > > } > > > > > > > > - typename AltView0::Type_t > > > > + typename View0::Type_t > > > > operator()() const > > > > { > > > > typedef View0 Ret_t; > > > > ===== Field/Field.h 1.14 vs edited ===== > > > > --- 1.14/r2/src/Field/Field.h Tue Dec 16 15:20:00 2003 > > > > +++ edited/Field/Field.h Tue Mar 2 11:25:22 2004 > > > > @@ -269,9 +269,6 @@ > > > > * View1Implementation specialization for indexing a > > field > > > > * with a single domain. There is a single-valued version (SV == > > true) > > > > * and a multi-valued version (SV == false). > > > > - * > > > > - * Any changes to View1Implementation should also be made to > > > > - * AltView1Implementation. > > > > */ > > > > > > > > // Single-valued version. Handles scalars and Locs. > > > > @@ -508,62 +505,7 @@ > > > > > > > > > > > > /** > > > > - * AltView1Implementation avoids an instantiation problem that > > arises > > > > when two > > > > - * classes use each other. This class's definition should be > > exactly > > > > - * the same as View1Implementation except omitting member functions. > > > > - * > > > > - * Do NOT explicitly instantiate this class. > > > > - */ > > > > - > > > > -// Single-valued version. Handles scalars and Locs. > > > > - > > > > -template > > > > -struct AltView1Implementation; > > > > - > > > > -template > > > > -struct AltView1Implementation, Domain, > > true> > > > > -{ > > > > - // Convenience typedef for the thing we're taking a view of. > > > > - > > > > - typedef Field Subject_t; > > > > - > > > > - // The return types are pretty simple here. > > > > - > > > > - typedef typename Subject_t::Element_t ReadType_t; > > > > - typedef typename Subject_t::ElementRef_t Type_t; > > > > -}; > > > > - > > > > -template > > > > -struct AltView1Implementation, Domain, > > false> > > > > -{ > > > > - // Convenience typedef for the thing we're taking a view of. > > > > - > > > > - typedef Field Subject_t; > > > > - > > > > - // Deduce domains for the output type. > > > > - > > > > - typedef typename Subject_t::Engine_t Engine_t; > > > > - typedef typename NewEngine::Type_t NewEngine_t; > > > > - typedef typename NewEngine_t::Element_t NewT_t; > > > > - typedef typename NewEngine_t::Tag_t NewEngineTag_t; > > > > - > > > > - // Deduce the new Mesh. > > > > - > > > > - typedef typename > > > > - NewMeshTag::Type_t > > > > - NewMeshTag_t; > > > > - > > > > - // The output types. > > > > - > > > > - typedef Field ReadType_t; > > > > - typedef Field Type_t; > > > > -}; > > > > - > > > > - > > > > -/** > > > > * View1 specialization for indexing a field with a > > single > > > > domain. > > > > - * > > > > - * Any changes to View1 should also be made to AltView1. > > > > */ > > > > > > > > template > > > > @@ -613,8 +555,6 @@ > > > > > > > > /** > > > > * View1 specialization for indexing a field with an > > int. > > > > - * > > > > - * Any changes to View1 should also be made to AltView1. > > > > */ > > > > > > > > template > > > > @@ -658,71 +598,6 @@ > > > > > > > > > > > > /** > > > > - * AltView1 avoids an instantiation problem that arises when two > > > > - * classes use each other. This class's definition should be > > exactly > > > > - * the same as View1 except omitting member functions. > > > > - * > > > > - * Do NOT explicitly instantiate this class. > > > > - */ > > > > - > > > > -template > > > > -struct AltView1; > > > > - > > > > -template > > > > -struct AltView1, Sub1> > > > > -{ > > > > - // Convenience typedef for the thing we're taking a view of. > > > > - > > > > - typedef Field Subject_t; > > > > - > > > > - // Deduce domains for the output type. > > > > - // At some point, we need to fix NewDomain1; until then, use > > > > - // the temporary version from NewDomain.h. > > > > - > > > > - typedef typename Subject_t::Domain_t Domain_t; > > > > - typedef TemporaryNewDomain1 NewDomain_t; > > > > - typedef typename NewDomain_t::SliceType_t SDomain_t; > > > > - > > > > - // Deduce appropriate version of implementation to dispatch to. > > > > - > > > > - enum { sv = DomainTraits::singleValued }; > > > > - typedef AltView1Implementation > > Dispatch_t; > > > > - > > > > - // The optimized domain combiner. > > > > - > > > > - typedef CombineDomainOpt Combine_t; > > > > - > > > > - // The return types. > > > > - > > > > - typedef typename Dispatch_t::ReadType_t ReadType_t; > > > > - typedef typename Dispatch_t::Type_t Type_t; > > > > -}; > > > > - > > > > - > > > > -/** > > > > - * AltView1 avoids an instantiation problem that arises when two > > > > - * classes use each other. This class's definition should be > > exactly > > > > - * the same as View1 except omitting member functions. > > > > - * > > > > - * Do NOT explicitly instantiate this class. > > > > - */ > > > > - > > > > -template > > > > -struct AltView1, int> > > > > -{ > > > > - // Convenience typedef for the thing we're taking a view of. > > > > - > > > > - typedef Field Subject_t; > > > > - > > > > - // The return types. > > > > - > > > > - typedef typename Subject_t::Element_t ReadType_t; > > > > - typedef typename Subject_t::ElementRef_t Type_t; > > > > - > > > > -}; > > > > - > > > > - > > > > -/** > > > > * View2 specialization for indexing a field with two > > > > * domains. > > > > */ > > > > @@ -1455,14 +1330,14 @@ > > > > /// point fields the viewing domain is an actual centering domain. > > > > //@{ > > > > > > > > - inline typename AltView1::ReadType_t > > > > + inline typename View1::ReadType_t > > > > read() const > > > > { > > > > typedef View1 Ret_t; > > > > return Ret_t::makeRead(*this, physicalDomain()); > > > > } > > > > > > > > - inline typename AltView1::ReadType_t > > > > + inline typename View1::ReadType_t > > > > readAll() const > > > > { > > > > typedef View1 Ret_t; > > > > @@ -1470,7 +1345,7 @@ > > > > } > > > > > > > > template > > > > - inline typename AltView1::ReadType_t > > > > + inline typename View1::ReadType_t > > > > read(const Sub1 &s1) const > > > > { > > > > typedef View1 Ret_t; > > > > @@ -1493,14 +1368,14 @@ > > > > return Ret_t::makeRead(*this, s1, s2, s3); > > > > } > > > > > > > > - inline typename AltView1::Type_t > > > > + inline typename View1::Type_t > > > > operator()() const > > > > { > > > > typedef View1 Ret_t; > > > > return Ret_t::make(*this, physicalDomain()); > > > > } > > > > > > > > - inline typename AltView1::Type_t > > > > + inline typename View1::Type_t > > > > all() const > > > > { > > > > typedef View1 Ret_t; > > > > @@ -1508,7 +1383,7 @@ > > > > } > > > > > > > > template > > > > - inline typename AltView1::Type_t > > > > + inline typename View1::Type_t > > > > operator()(const Sub1 &s1) const > > > > { > > > > typedef View1 Ret_t; > > > > > > > > > > > > > > > > > > RE: [pooma-dev] AltView* classes > > > > > > > > > > > >

Hi Richard, > > >

> > > > > >

This tickled a neuron the other day, but I couldn't > > recall the details. > > >

> > > > > >

The AltView classes were put in to reduce link times > > and sizes for large codes. The classes that have enums end up having a > > link-time cost, both in space and time. I believe this refactoring was > > done to reduce the cardinality of classes having the "sv" enum. > > My recollection is that this, and other similar "optimizations", > > had a pretty substantial impact on link-time for Blanca. Unless these are > > hurting something else, I would tend to leave them in.

> > > > > >

Does the CodeSourcery CVS repository have complete CVS > > history? (i.e. did we copy the repository, or just the head version?) This > > should have been easy to determine via CVS.

> > > > > >

        Jim > > >

> > > > > >

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

> > > > > >

> -----Original Message----- > > >
> From: Richard Guenther [ > HREF="mailto:rguenth at tat.physik.uni- > > tuebingen.de">mailto:rguenth at tat.physik.uni-tuebingen.de] > > >
> Sent: Tuesday, March 02, 2004 3:29 AM > > >
> To: pooma-dev at pooma.codesourcery.com > > >
> Cc: Jeffrey D. Oldham > > >
> Subject: Re: [pooma-dev] AltView* classes > > >
> > > >
> On Tue, 2 Mar 2004, Richard Guenther > > wrote: > > >
> > > >
> > On Fri, 27 Feb 2004, Richard Guenther > > wrote: > > >
> > > > >
> > > Hi! > > >
> > > > > >
> > > Does anyone remember the exact reason > > for the existance of the > > >
> AltView* > > >
> > > classes in Array.h and Field.h?  > > Removing them and fixing their usage > > >
> to > > >
> > > use View* seems to work (full test with > > gcc 3.3 and 3.4 in progress). > > >
> > > > >
> > Testing completed with no new > > failures.  Would it be ok to remove those > > >
> > AltView* classes? > > >
> > > >
> Which would be... > > >
> > > >
> Ok? > > >
> > > >
> Richard. > > >
> > > >
> > > >
> 2004Mar02  Richard Guenther > > <richard.guenther at uni-tuebingen.de> > > >
> > > >
>       * > > src/Array/Array.h: remove all traces of AltView0 class. > > >
>       src/Field/Field.h: > > remove all traces of AltView1 and > > >
>       > > AltView1Implementation classes. > > >
> > > >
> ===== Array/Array.h 1.14 vs edited ===== > > >
> --- 1.14/r2/src/Array/Array.h Tue Dec 16 15:19:57 > > 2003 > > >
> +++ > > edited/Array/Array.h      Tue Mar  2 > > 11:24:14 2004 > > >
> @@ -649,8 +649,6 @@ > > >
>  // an existing engine cannot be any kind of > > slice domain. > > >
>  // Also, bounds checking would make no > > sense because it would > > >
>  // reduce to contains(a.domain(), > > a.domain()); > > >
> -// > > >
> -// Any changes to this class should also be made > > to AltView0. > > >
> > > >
>  template<int Dim, class T, class > > EngineTag> > > >
>  struct View0<Array<Dim, T, > > EngineTag> > > > >
> @@ -695,41 +693,6 @@ > > >
>      } > > >
>  }; > > >
> > > >
> -// AltView0 avoids an instantiation problem that > > arises when two > > >
> -// classes use each other.  This class's > > definition should be exactly > > >
> -// the same as View0 except omitting member > > functions. > > >
> -// > > >
> -// Do NOT explicitly instantiate this > > class. > > >
> - > > >
> -template<class ArrayTag> > > >
> -struct AltView0; > > >
> - > > >
> -template<int Dim, class T, class > > EngineTag> > > >
> -struct AltView0<Array<Dim, T, > > EngineTag> > > > >
> -{ > > >
> -  // Convenience typedef for the thing > > we're taking a view of. > > >
> - > > >
> -  typedef Array<Dim, T, EngineTag> > > Subject_t; > > >
> - > > >
> -  // Deduce domains for the output > > type. > > >
> -  // At some point, we need to fix > > NewDomain1; until then, use > > >
> -  // the temporary version from > > Array.h. > > >
> - > > >
> -  typedef typename Subject_t::Engine_t > > Engine_t; > > >
> -  typedef typename Subject_t::Domain_t > > Domain_t; > > >
> - > > >
> -  // Deduce the template parameters for the > > output type. > > >
> - > > >
> -  typedef typename NewEngine<Engine_t, > > Domain_t>::Type_t NewEngine_t; > > >
> -  enum { newDim = NewEngine_t::dimensions > > }; > > >
> -  typedef typename NewEngine_t::Tag_t > > NewEngineTag_t; > > >
> - > > >
> -  // The output types. > > >
> - > > >
> -  typedef Array<newDim, T, > > NewEngineTag_t> Type_t; > > >
> -  typedef Type_t ReadType_t; > > >
> -}; > > >
> - > > >
>  template<int Dim, class T, class > > EngineTag> > > >
>  struct View1<Array<Dim, T, > > EngineTag>, int> > > >
>  { > > >
> @@ -1864,7 +1827,7 @@ > > >
>    /// A zero-argument version of > > operator(), which takes a view of > > >
>    /// array's domain, is also > > supplied. > > >
>    //@{ > > >
> -  typename > > AltView0<This_t>::ReadType_t > > >
> +  typename > > View0<This_t>::ReadType_t > > >
>    read() const > > >
>      { > > >
>        typedef > > View0<This_t> Ret_t; > > >
> @@ -1934,7 +1897,7 @@ > > >
>        return > > Ret_t::makeRead(*this, s1, s2, s3, s4, s5, s6, s7); > > >
>      } > > >
> > > >
> -  typename > > AltView0<This_t>::Type_t > > >
> +  typename > > View0<This_t>::Type_t > > >
>    operator()() const > > >
>      { > > >
>        typedef > > View0<This_t> Ret_t; > > >
> ===== Field/Field.h 1.14 vs edited ===== > > >
> --- 1.14/r2/src/Field/Field.h Tue Dec 16 15:20:00 > > 2003 > > >
> +++ > > edited/Field/Field.h      Tue Mar  2 > > 11:25:22 2004 > > >
> @@ -269,9 +269,6 @@ > > >
>   * View1Implementation<Field, D, > > SV> specialization for indexing a field > > >
>   * with a single domain. There is a > > single-valued version (SV == true) > > >
>   * and a multi-valued version (SV == > > false). > > >
> - * > > >
> - * Any changes to View1Implementation should > > also be made to > > >
> - * AltView1Implementation. > > >
>   */ > > >
> > > >
>  // Single-valued version. Handles scalars > > and Locs. > > >
> @@ -508,62 +505,7 @@ > > >
> > > >
> > > >
>  /** > > >
> - * AltView1Implementation avoids an > > instantiation problem that arises > > >
> when two > > >
> - * classes use each other.  This class's > > definition should be exactly > > >
> - * the same as View1Implementation except > > omitting member functions. > > >
> - * > > >
> - * Do NOT explicitly instantiate this > > class. > > >
> - */ > > >
> - > > >
> -// Single-valued version. Handles scalars and > > Locs. > > >
> - > > >
> -template<class Subject, class Domain, bool > > SV> > > >
> -struct AltView1Implementation; > > >
> - > > >
> -template<class Mesh, class T, class > > EngineTag, class Domain> > > >
> -struct AltView1Implementation<Field<Mesh, > > T, EngineTag>, Domain, true> > > >
> -{ > > >
> -  // Convenience typedef for the thing > > we're taking a view of. > > >
> - > > >
> -  typedef Field<Mesh, T, EngineTag> > > Subject_t; > > >
> - > > >
> -  // The return types are pretty simple > > here. > > >
> - > > >
> -  typedef typename Subject_t::Element_t > > ReadType_t; > > >
> -  typedef typename Subject_t::ElementRef_t > > Type_t; > > >
> -}; > > >
> - > > >
> -template<class Mesh, class T, class > > EngineTag, class Domain> > > >
> -struct AltView1Implementation<Field<Mesh, > > T, EngineTag>, Domain, false> > > >
> -{ > > >
> -  // Convenience typedef for the thing > > we're taking a view of. > > >
> - > > >
> -  typedef Field<Mesh, T, EngineTag> > > Subject_t; > > >
> - > > >
> -  // Deduce domains for the output > > type. > > >
> - > > >
> -  typedef typename Subject_t::Engine_t > > Engine_t; > > >
> -  typedef typename NewEngine<Engine_t, > > Domain>::Type_t NewEngine_t; > > >
> -  typedef typename NewEngine_t::Element_t > > NewT_t; > > >
> -  typedef typename NewEngine_t::Tag_t > > NewEngineTag_t; > > >
> - > > >
> -  // Deduce the new Mesh. > > >
> - > > >
> -  typedef typename > > >
> -    > > NewMeshTag<NewEngine_t::dimensions, Mesh, Domain>::Type_t > > >
> -      > > NewMeshTag_t; > > >
> - > > >
> -  // The output types. > > >
> - > > >
> -  typedef Field<NewMeshTag_t, NewT_t, > > NewEngineTag_t> ReadType_t; > > >
> -  typedef Field<NewMeshTag_t, NewT_t, > > NewEngineTag_t> Type_t; > > >
> -}; > > >
> - > > >
> - > > >
> -/** > > >
>   * View1<Field, S1> > > specialization for indexing a field with a single > > >
> domain. > > >
> - * > > >
> - * Any changes to View1 should also be made to > > AltView1. > > >
>   */ > > >
> > > >
>  template<class Mesh, class T, class > > EngineTag, class Sub1> > > >
> @@ -613,8 +555,6 @@ > > >
> > > >
>  /** > > >
>   * View1<Field, int> > > specialization for indexing a field with an int. > > >
> - * > > >
> - * Any changes to View1 should also be made to > > AltView1. > > >
>   */ > > >
> > > >
>  template<class Mesh, class T, class > > EngineTag> > > >
> @@ -658,71 +598,6 @@ > > >
> > > >
> > > >
>  /** > > >
> - * AltView1 avoids an instantiation problem that > > arises when two > > >
> - * classes use each other.  This class's > > definition should be exactly > > >
> - * the same as View1 except omitting member > > functions. > > >
> - * > > >
> - * Do NOT explicitly instantiate this > > class. > > >
> - */ > > >
> - > > >
> -template<class FieldTag, class > > DomainTag> > > >
> -struct AltView1; > > >
> - > > >
> -template<class Mesh, class T, class > > EngineTag, class Sub1> > > >
> -struct AltView1<Field<Mesh, T, > > EngineTag>, Sub1> > > >
> -{ > > >
> -  // Convenience typedef for the thing > > we're taking a view of. > > >
> - > > >
> -  typedef Field<Mesh, T, EngineTag> > > Subject_t; > > >
> - > > >
> -  // Deduce domains for the output > > type. > > >
> -  // At some point, we need to fix > > NewDomain1; until then, use > > >
> -  // the temporary version from > > NewDomain.h. > > >
> - > > >
> -  typedef typename Subject_t::Domain_t > > Domain_t; > > >
> -  typedef TemporaryNewDomain1<Domain_t, > > Sub1> NewDomain_t; > > >
> -  typedef typename NewDomain_t::SliceType_t > > SDomain_t; > > >
> - > > >
> -  // Deduce appropriate version of > > implementation to dispatch to. > > >
> - > > >
> -  enum { sv = > > DomainTraits<SDomain_t>::singleValued }; > > >
> -  typedef > > AltView1Implementation<Subject_t, SDomain_t, sv> Dispatch_t; > > >
> - > > >
> -  // The optimized domain combiner. > > >
> - > > >
> -  typedef CombineDomainOpt<NewDomain_t, > > sv> Combine_t; > > >
> - > > >
> -  // The return types. > > >
> - > > >
> -  typedef typename Dispatch_t::ReadType_t > > ReadType_t; > > >
> -  typedef typename Dispatch_t::Type_t > > Type_t; > > >
> -}; > > >
> - > > >
> - > > >
> -/** > > >
> - * AltView1 avoids an instantiation problem that > > arises when two > > >
> - * classes use each other.  This class's > > definition should be exactly > > >
> - * the same as View1 except omitting member > > functions. > > >
> - * > > >
> - * Do NOT explicitly instantiate this > > class. > > >
> - */ > > >
> - > > >
> -template<class Mesh, class T, class > > EngineTag> > > >
> -struct AltView1<Field<Mesh, T, > > EngineTag>, int> > > >
> -{ > > >
> -  // Convenience typedef for the thing > > we're taking a view of. > > >
> - > > >
> -  typedef Field<Mesh, T, EngineTag> > > Subject_t; > > >
> - > > >
> -  // The return types. > > >
> - > > >
> -  typedef typename Subject_t::Element_t > > ReadType_t; > > >
> -  typedef typename Subject_t::ElementRef_t > > Type_t; > > >
> - > > >
> -}; > > >
> - > > >
> - > > >
> -/** > > >
>   * View2<Field, S1, S2> > > specialization for indexing a field with two > > >
>   * domains. > > >
>   */ > > >
> @@ -1455,14 +1330,14 @@ > > >
>    /// point fields the viewing > > domain is an actual centering domain. > > >
>    //@{ > > >
> > > >
> -  inline typename AltView1<This_t, > > Domain_t>::ReadType_t > > >
> +  inline typename View1<This_t, > > Domain_t>::ReadType_t > > >
>    read() const > > >
>      { > > >
>        typedef > > View1<This_t, Domain_t> Ret_t; > > >
>        return > > Ret_t::makeRead(*this, physicalDomain()); > > >
>      } > > >
> > > >
> -  inline typename AltView1<This_t, > > Domain_t>::ReadType_t > > >
> +  inline typename View1<This_t, > > Domain_t>::ReadType_t > > >
>    readAll() const > > >
>      { > > >
>        typedef > > View1<This_t, Domain_t> Ret_t; > > >
> @@ -1470,7 +1345,7 @@ > > >
>      } > > >
> > > >
>    template<class > > Sub1> > > >
> -  inline typename AltView1<This_t, > > Sub1>::ReadType_t > > >
> +  inline typename View1<This_t, > > Sub1>::ReadType_t > > >
>    read(const Sub1 &s1) > > const > > >
>      { > > >
>        typedef > > View1<This_t, Sub1> Ret_t; > > >
> @@ -1493,14 +1368,14 @@ > > >
>        return > > Ret_t::makeRead(*this, s1, s2, s3); > > >
>      } > > >
> > > >
> -  inline typename AltView1<This_t, > > Domain_t>::Type_t > > >
> +  inline typename View1<This_t, > > Domain_t>::Type_t > > >
>    operator()() const > > >
>      { > > >
>        typedef > > View1<This_t, Domain_t> Ret_t; > > >
>        return > > Ret_t::make(*this, physicalDomain()); > > >
>      } > > >
> > > >
> -  inline typename AltView1<This_t, > > Domain_t>::Type_t > > >
> +  inline typename View1<This_t, > > Domain_t>::Type_t > > >
>    all() const > > >
>      { > > >
>        typedef > > View1<This_t, Domain_t> Ret_t; > > >
> @@ -1508,7 +1383,7 @@ > > >
>      } > > >
> > > >
>    template<class > > Sub1> > > >
> -  inline typename AltView1<This_t, > > Sub1>::Type_t > > >
> +  inline typename View1<This_t, > > Sub1>::Type_t > > >
>    operator()(const Sub1 &s1) > > const > > >
>      { > > >
>        typedef > > View1<This_t, Sub1> Ret_t; > > >

> > > > > > > > > > > > > > > RE: [pooma-dev] AltView* classes > > > >

OK - cool. Thanks for chipping in Dave. You're neurons are obviously less rusty than mine. :) >

> >

        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: Dave Nystrom [mailto:wdn at lanl.gov] >
> Sent: Tuesday, March 02, 2004 10:00 AM >
> To: James Crotinger >
> Cc: 'Richard Guenther'; 'pooma-dev at pooma.codesourcery.com'; 'Jeffrey D. >
> Oldham'; John Hall; Dave Nystrom; Dave Nystrom >
> Subject: RE: [pooma-dev] AltView* classes >
> >
> These AltView classes were put in by Jeffrey Oldham to fix a problem that >
> I >
> was having trying to explicitly instantiate all the Pooma classes and >
> functions that Blanca code was using.  Basically, the way the Pooma 2 >
> Field >
> class was originally written, we were getting one of these "sv" enums >
> instantiated for every unique expression which we had in our source code >
> base.  I was unable to explicitly instantiate these "sv" enums the way the >
> code was originally written because of some issue which Arch Robison of >
> Kuck >
> and Associates (now Intel) identified - basically the code in it's >
> original >
> form violated some corner case of the C++ standard according to Arch. >
> Jeffrey fixed this problem by adding the AltView class and then I was able >
> to >
> perform the explicit instantiations that I needed. >
> >
> However, I believe Jeffrey or someone else has gone through the code and >
> replaced the "sv" enums with some other construct which does not have the >
> explicit instantiation difficulties that the "sv" enums had.  So, I think >
> that it is probably okay to remove the AltView classes and that this would >
> clean up the code considerably.  I may revisit all this explicit >
> instantiation stuff sometime in the not to distant future on a hobby basis >
> (weird hobby, huh) and if I encounter difficulties being able to >
> explicitly >
> instantiate anything, I could then raise it as an issue at that time. >
> >
> In summary, the AltView classes were added by Jeffrey to fix an explicit >
> instantiation problem that I think no longer exists and I am in favor of >
> now >
> removing them in the interest of cleaning up the code as much as possible. >
> >
> -- >
> Dave Nystrom                  email: wdn at lanl.gov >
> LANL X-2                      phone: 505-667-7913     fax: 505-665-2227 >
> >
> James Crotinger writes: >
>  > Hi Richard, >
>  > >
>  > This tickled a neuron the other day, but I couldn't recall the details. >
>  > >
>  > The AltView classes were put in to reduce link times and sizes for >
> large >
>  > codes. The classes that have enums end up having a link-time cost, both >
> in >
>  > space and time. I believe this refactoring was done to reduce the >
>  > cardinality of classes having the "sv" enum. My recollection is that >
> this, >
>  > and other similar "optimizations", had a pretty substantial impact on >
>  > link-time for Blanca. Unless these are hurting something else, I would >
> tend >
>  > to leave them in. >
>  > >
>  > Does the CodeSourcery CVS repository have complete CVS history? (i.e. >
> did we >
>  > copy the repository, or just the head version?) This should have been >
> easy >
>  > to determine via CVS. >
>  > >
>  >    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: Tuesday, March 02, 2004 3:29 AM >
>  > > To: pooma-dev at pooma.codesourcery.com >
>  > > Cc: Jeffrey D. Oldham >
>  > > Subject: Re: [pooma-dev] AltView* classes >
>  > > >
>  > > On Tue, 2 Mar 2004, Richard Guenther wrote: >
>  > > >
>  > > > On Fri, 27 Feb 2004, Richard Guenther wrote: >
>  > > > >
>  > > > > Hi! >
>  > > > > >
>  > > > > Does anyone remember the exact reason for the existance of the >
>  > > AltView* >
>  > > > > classes in Array.h and Field.h?  Removing them and fixing their >
> usage >
>  > > to >
>  > > > > use View* seems to work (full test with gcc 3.3 and 3.4 in >
> progress). >
>  > > > >
>  > > > Testing completed with no new failures.  Would it be ok to remove >
> those >
>  > > > AltView* classes? >
>  > > >
>  > > Which would be... >
>  > > >
>  > > Ok? >
>  > > >
>  > > Richard. >
>  > > >
>  > > >
>  > > 2004Mar02  Richard Guenther <richard.guenther at uni-tuebingen.de> >
>  > > >
>  > >  * src/Array/Array.h: remove all traces of AltView0 class. >
>  > >  src/Field/Field.h: remove all traces of AltView1 and >
>  > >  AltView1Implementation classes. >
>  > > >
>  > > ===== Array/Array.h 1.14 vs edited ===== >
>  > > --- 1.14/r2/src/Array/Array.h    Tue Dec 16 15:19:57 2003 >
>  > > +++ edited/Array/Array.h Tue Mar  2 11:24:14 2004 >
>  > > @@ -649,8 +649,6 @@ >
>  > >  // an existing engine cannot be any kind of slice domain. >
>  > >  // Also, bounds checking would make no sense because it would >
>  > >  // reduce to contains(a.domain(), a.domain()); >
>  > > -// >
>  > > -// Any changes to this class should also be made to AltView0. >
>  > > >
>  > >  template<int Dim, class T, class EngineTag> >
>  > >  struct View0<Array<Dim, T, EngineTag> > >
>  > > @@ -695,41 +693,6 @@ >
>  > >      } >
>  > >  }; >
>  > > >
>  > > -// AltView0 avoids an instantiation problem that arises when two >
>  > > -// classes use each other.  This class's definition should be >
> exactly >
>  > > -// the same as View0 except omitting member functions. >
>  > > -// >
>  > > -// Do NOT explicitly instantiate this class. >
>  > > - >
>  > > -template<class ArrayTag> >
>  > > -struct AltView0; >
>  > > - >
>  > > -template<int Dim, class T, class EngineTag> >
>  > > -struct AltView0<Array<Dim, T, EngineTag> > >
>  > > -{ >
>  > > -  // Convenience typedef for the thing we're taking a view of. >
>  > > - >
>  > > -  typedef Array<Dim, T, EngineTag> Subject_t; >
>  > > - >
>  > > -  // Deduce domains for the output type. >
>  > > -  // At some point, we need to fix NewDomain1; until then, use >
>  > > -  // the temporary version from Array.h. >
>  > > - >
>  > > -  typedef typename Subject_t::Engine_t Engine_t; >
>  > > -  typedef typename Subject_t::Domain_t Domain_t; >
>  > > - >
>  > > -  // Deduce the template parameters for the output type. >
>  > > - >
>  > > -  typedef typename NewEngine<Engine_t, Domain_t>::Type_t >
> NewEngine_t; >
>  > > -  enum { newDim = NewEngine_t::dimensions }; >
>  > > -  typedef typename NewEngine_t::Tag_t NewEngineTag_t; >
>  > > - >
>  > > -  // The output types. >
>  > > - >
>  > > -  typedef Array<newDim, T, NewEngineTag_t> Type_t; >
>  > > -  typedef Type_t ReadType_t; >
>  > > -}; >
>  > > - >
>  > >  template<int Dim, class T, class EngineTag> >
>  > >  struct View1<Array<Dim, T, EngineTag>, int> >
>  > >  { >
>  > > @@ -1864,7 +1827,7 @@ >
>  > >    /// A zero-argument version of operator(), which takes a view of >
>  > >    /// array's domain, is also supplied. >
>  > >    //@{ >
>  > > -  typename AltView0<This_t>::ReadType_t >
>  > > +  typename View0<This_t>::ReadType_t >
>  > >    read() const >
>  > >      { >
>  > >        typedef View0<This_t> Ret_t; >
>  > > @@ -1934,7 +1897,7 @@ >
>  > >        return Ret_t::makeRead(*this, s1, s2, s3, s4, s5, s6, s7); >
>  > >      } >
>  > > >
>  > > -  typename AltView0<This_t>::Type_t >
>  > > +  typename View0<This_t>::Type_t >
>  > >    operator()() const >
>  > >      { >
>  > >        typedef View0<This_t> Ret_t; >
>  > > ===== Field/Field.h 1.14 vs edited ===== >
>  > > --- 1.14/r2/src/Field/Field.h    Tue Dec 16 15:20:00 2003 >
>  > > +++ edited/Field/Field.h Tue Mar  2 11:25:22 2004 >
>  > > @@ -269,9 +269,6 @@ >
>  > >   * View1Implementation<Field, D, SV> specialization for indexing a >
> field >
>  > >   * with a single domain. There is a single-valued version (SV == >
> true) >
>  > >   * and a multi-valued version (SV == false). >
>  > > - * >
>  > > - * Any changes to View1Implementation should also be made to >
>  > > - * AltView1Implementation. >
>  > >   */ >
>  > > >
>  > >  // Single-valued version. Handles scalars and Locs. >
>  > > @@ -508,62 +505,7 @@ >
>  > > >
>  > > >
>  > >  /** >
>  > > - * AltView1Implementation avoids an instantiation problem that >
> arises >
>  > > when two >
>  > > - * classes use each other.  This class's definition should be >
> exactly >
>  > > - * the same as View1Implementation except omitting member functions. >
>  > > - * >
>  > > - * Do NOT explicitly instantiate this class. >
>  > > - */ >
>  > > - >
>  > > -// Single-valued version. Handles scalars and Locs. >
>  > > - >
>  > > -template<class Subject, class Domain, bool SV> >
>  > > -struct AltView1Implementation; >
>  > > - >
>  > > -template<class Mesh, class T, class EngineTag, class Domain> >
>  > > -struct AltView1Implementation<Field<Mesh, T, EngineTag>, Domain, >
> true> >
>  > > -{ >
>  > > -  // Convenience typedef for the thing we're taking a view of. >
>  > > - >
>  > > -  typedef Field<Mesh, T, EngineTag> Subject_t; >
>  > > - >
>  > > -  // The return types are pretty simple here. >
>  > > - >
>  > > -  typedef typename Subject_t::Element_t ReadType_t; >
>  > > -  typedef typename Subject_t::ElementRef_t Type_t; >
>  > > -}; >
>  > > - >
>  > > -template<class Mesh, class T, class EngineTag, class Domain> >
>  > > -struct AltView1Implementation<Field<Mesh, T, EngineTag>, Domain, >
> false> >
>  > > -{ >
>  > > -  // Convenience typedef for the thing we're taking a view of. >
>  > > - >
>  > > -  typedef Field<Mesh, T, EngineTag> Subject_t; >
>  > > - >
>  > > -  // Deduce domains for the output type. >
>  > > - >
>  > > -  typedef typename Subject_t::Engine_t Engine_t; >
>  > > -  typedef typename NewEngine<Engine_t, Domain>::Type_t NewEngine_t; >
>  > > -  typedef typename NewEngine_t::Element_t NewT_t; >
>  > > -  typedef typename NewEngine_t::Tag_t NewEngineTag_t; >
>  > > - >
>  > > -  // Deduce the new Mesh. >
>  > > - >
>  > > -  typedef typename >
>  > > -    NewMeshTag<NewEngine_t::dimensions, Mesh, Domain>::Type_t >
>  > > -      NewMeshTag_t; >
>  > > - >
>  > > -  // The output types. >
>  > > - >
>  > > -  typedef Field<NewMeshTag_t, NewT_t, NewEngineTag_t> ReadType_t; >
>  > > -  typedef Field<NewMeshTag_t, NewT_t, NewEngineTag_t> Type_t; >
>  > > -}; >
>  > > - >
>  > > - >
>  > > -/** >
>  > >   * View1<Field, S1> specialization for indexing a field with a >
> single >
>  > > domain. >
>  > > - * >
>  > > - * Any changes to View1 should also be made to AltView1. >
>  > >   */ >
>  > > >
>  > >  template<class Mesh, class T, class EngineTag, class Sub1> >
>  > > @@ -613,8 +555,6 @@ >
>  > > >
>  > >  /** >
>  > >   * View1<Field, int> specialization for indexing a field with an >
> int. >
>  > > - * >
>  > > - * Any changes to View1 should also be made to AltView1. >
>  > >   */ >
>  > > >
>  > >  template<class Mesh, class T, class EngineTag> >
>  > > @@ -658,71 +598,6 @@ >
>  > > >
>  > > >
>  > >  /** >
>  > > - * AltView1 avoids an instantiation problem that arises when two >
>  > > - * classes use each other.  This class's definition should be >
> exactly >
>  > > - * the same as View1 except omitting member functions. >
>  > > - * >
>  > > - * Do NOT explicitly instantiate this class. >
>  > > - */ >
>  > > - >
>  > > -template<class FieldTag, class DomainTag> >
>  > > -struct AltView1; >
>  > > - >
>  > > -template<class Mesh, class T, class EngineTag, class Sub1> >
>  > > -struct AltView1<Field<Mesh, T, EngineTag>, Sub1> >
>  > > -{ >
>  > > -  // Convenience typedef for the thing we're taking a view of. >
>  > > - >
>  > > -  typedef Field<Mesh, T, EngineTag> Subject_t; >
>  > > - >
>  > > -  // Deduce domains for the output type. >
>  > > -  // At some point, we need to fix NewDomain1; until then, use >
>  > > -  // the temporary version from NewDomain.h. >
>  > > - >
>  > > -  typedef typename Subject_t::Domain_t Domain_t; >
>  > > -  typedef TemporaryNewDomain1<Domain_t, Sub1> NewDomain_t; >
>  > > -  typedef typename NewDomain_t::SliceType_t SDomain_t; >
>  > > - >
>  > > -  // Deduce appropriate version of implementation to dispatch to. >
>  > > - >
>  > > -  enum { sv = DomainTraits<SDomain_t>::singleValued }; >
>  > > -  typedef AltView1Implementation<Subject_t, SDomain_t, sv> >
> Dispatch_t; >
>  > > - >
>  > > -  // The optimized domain combiner. >
>  > > - >
>  > > -  typedef CombineDomainOpt<NewDomain_t, sv> Combine_t; >
>  > > - >
>  > > -  // The return types. >
>  > > - >
>  > > -  typedef typename Dispatch_t::ReadType_t ReadType_t; >
>  > > -  typedef typename Dispatch_t::Type_t Type_t; >
>  > > -}; >
>  > > - >
>  > > - >
>  > > -/** >
>  > > - * AltView1 avoids an instantiation problem that arises when two >
>  > > - * classes use each other.  This class's definition should be >
> exactly >
>  > > - * the same as View1 except omitting member functions. >
>  > > - * >
>  > > - * Do NOT explicitly instantiate this class. >
>  > > - */ >
>  > > - >
>  > > -template<class Mesh, class T, class EngineTag> >
>  > > -struct AltView1<Field<Mesh, T, EngineTag>, int> >
>  > > -{ >
>  > > -  // Convenience typedef for the thing we're taking a view of. >
>  > > - >
>  > > -  typedef Field<Mesh, T, EngineTag> Subject_t; >
>  > > - >
>  > > -  // The return types. >
>  > > - >
>  > > -  typedef typename Subject_t::Element_t ReadType_t; >
>  > > -  typedef typename Subject_t::ElementRef_t Type_t; >
>  > > - >
>  > > -}; >
>  > > - >
>  > > - >
>  > > -/** >
>  > >   * View2<Field, S1, S2> specialization for indexing a field with two >
>  > >   * domains. >
>  > >   */ >
>  > > @@ -1455,14 +1330,14 @@ >
>  > >    /// point fields the viewing domain is an actual centering domain. >
>  > >    //@{ >
>  > > >
>  > > -  inline typename AltView1<This_t, Domain_t>::ReadType_t >
>  > > +  inline typename View1<This_t, Domain_t>::ReadType_t >
>  > >    read() const >
>  > >      { >
>  > >        typedef View1<This_t, Domain_t> Ret_t; >
>  > >        return Ret_t::makeRead(*this, physicalDomain()); >
>  > >      } >
>  > > >
>  > > -  inline typename AltView1<This_t, Domain_t>::ReadType_t >
>  > > +  inline typename View1<This_t, Domain_t>::ReadType_t >
>  > >    readAll() const >
>  > >      { >
>  > >        typedef View1<This_t, Domain_t> Ret_t; >
>  > > @@ -1470,7 +1345,7 @@ >
>  > >      } >
>  > > >
>  > >    template<class Sub1> >
>  > > -  inline typename AltView1<This_t, Sub1>::ReadType_t >
>  > > +  inline typename View1<This_t, Sub1>::ReadType_t >
>  > >    read(const Sub1 &s1) const >
>  > >      { >
>  > >        typedef View1<This_t, Sub1> Ret_t; >
>  > > @@ -1493,14 +1368,14 @@ >
>  > >        return Ret_t::makeRead(*this, s1, s2, s3); >
>  > >      } >
>  > > >
>  > > -  inline typename AltView1<This_t, Domain_t>::Type_t >
>  > > +  inline typename View1<This_t, Domain_t>::Type_t >
>  > >    operator()() const >
>  > >      { >
>  > >        typedef View1<This_t, Domain_t> Ret_t; >
>  > >        return Ret_t::make(*this, physicalDomain()); >
>  > >      } >
>  > > >
>  > > -  inline typename AltView1<This_t, Domain_t>::Type_t >
>  > > +  inline typename View1<This_t, Domain_t>::Type_t >
>  > >    all() const >
>  > >      { >
>  > >        typedef View1<This_t, Domain_t> Ret_t; >
>  > > @@ -1508,7 +1383,7 @@ >
>  > >      } >
>  > > >
>  > >    template<class Sub1> >
>  > > -  inline typename AltView1<This_t, Sub1>::Type_t >
>  > > +  inline typename View1<This_t, Sub1>::Type_t >
>  > >    operator()(const Sub1 &s1) const >
>  > >      { >
>  > >        typedef View1<This_t, Sub1> Ret_t; >
>  > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"> >
>  > <HTML> >
>  > <HEAD> >
>  > <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii"> >
>  > <META NAME="Generator" CONTENT="MS Exchange Server version >
> 5.5.2653.12"> >
>  > <TITLE>RE: [pooma-dev] AltView* classes</TITLE> >
>  > </HEAD> >
>  > <BODY> >
>  > >
>  > <P><FONT SIZE=2>Hi Richard,</FONT> >
>  > </P> >
>  > >
>  > <P><FONT SIZE=2>This tickled a neuron the other day, but I couldn't >
> recall the details.</FONT> >
>  > </P> >
>  > >
>  > <P><FONT SIZE=2>The AltView classes were put in to reduce link times >
> and sizes for large codes. The classes that have enums end up having a >
> link-time cost, both in space and time. I believe this refactoring was >
> done to reduce the cardinality of classes having the &quot;sv&quot; enum. >
> My recollection is that this, and other similar &quot;optimizations&quot;, >
> had a pretty substantial impact on link-time for Blanca. Unless these are >
> hurting something else, I would tend to leave them in. </FONT></P> >
>  > >
>  > <P><FONT SIZE=2>Does the CodeSourcery CVS repository have complete CVS >
> history? (i.e. did we copy the repository, or just the head version?) This >
> should have been easy to determine via CVS. </FONT></P> >
>  > >
>  > <P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2>Jim</FONT> >
>  > </P> >
>  > >
>  > <P><FONT SIZE=2>------------------------------------------------------- >
> -----------------</FONT> >
>  > <BR><FONT SIZE=2>James A. >
> Crotinger&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp >
> ;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& >
> nbsp;&nbsp;&nbsp; email:&nbsp;&nbsp;&nbsp;&nbsp; jimc at numerix.com</FONT> >
>  > <BR><FONT SIZE=2>NumeriX, >
> LLC&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp >
> ;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& >
> nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; phone:&nbsp; (505) 424- >
> 4477 x104</FONT> >
>  > <BR><FONT SIZE=2>2960 Rodeo Park Dr. W.</FONT> >
>  > <BR><FONT SIZE=2>Santa Fe, NM 87505</FONT> >
>  > <BR><FONT SIZE=2>&nbsp;</FONT> >
>  > </P> >
>  > >
>  > <P><FONT SIZE=2>&gt; -----Original Message-----</FONT> >
>  > <BR><FONT SIZE=2>&gt; From: Richard Guenther [<A >
> HREF="mailto:rguenth at tat.physik.uni- >
> tuebingen.de">mailto:rguenth at tat.physik.uni-tuebingen.de</A>]</FONT> >
>  > <BR><FONT SIZE=2>&gt; Sent: Tuesday, March 02, 2004 3:29 AM</FONT> >
>  > <BR><FONT SIZE=2>&gt; To: pooma-dev at pooma.codesourcery.com</FONT> >
>  > <BR><FONT SIZE=2>&gt; Cc: Jeffrey D. Oldham</FONT> >
>  > <BR><FONT SIZE=2>&gt; Subject: Re: [pooma-dev] AltView* classes</FONT> >
>  > <BR><FONT SIZE=2>&gt; </FONT> >
>  > <BR><FONT SIZE=2>&gt; On Tue, 2 Mar 2004, Richard Guenther >
> wrote:</FONT> >
>  > <BR><FONT SIZE=2>&gt; </FONT> >
>  > <BR><FONT SIZE=2>&gt; &gt; On Fri, 27 Feb 2004, Richard Guenther >
> wrote:</FONT> >
>  > <BR><FONT SIZE=2>&gt; &gt;</FONT> >
>  > <BR><FONT SIZE=2>&gt; &gt; &gt; Hi!</FONT> >
>  > <BR><FONT SIZE=2>&gt; &gt; &gt;</FONT> >
>  > <BR><FONT SIZE=2>&gt; &gt; &gt; Does anyone remember the exact reason >
> for the existance of the</FONT> >
>  > <BR><FONT SIZE=2>&gt; AltView*</FONT> >
>  > <BR><FONT SIZE=2>&gt; &gt; &gt; classes in Array.h and Field.h?&nbsp; >
> Removing them and fixing their usage</FONT> >
>  > <BR><FONT SIZE=2>&gt; to</FONT> >
>  > <BR><FONT SIZE=2>&gt; &gt; &gt; use View* seems to work (full test with >
> gcc 3.3 and 3.4 in progress).</FONT> >
>  > <BR><FONT SIZE=2>&gt; &gt;</FONT> >
>  > <BR><FONT SIZE=2>&gt; &gt; Testing completed with no new >
> failures.&nbsp; Would it be ok to remove those</FONT> >
>  > <BR><FONT SIZE=2>&gt; &gt; AltView* classes?</FONT> >
>  > <BR><FONT SIZE=2>&gt; </FONT> >
>  > <BR><FONT SIZE=2>&gt; Which would be...</FONT> >
>  > <BR><FONT SIZE=2>&gt; </FONT> >
>  > <BR><FONT SIZE=2>&gt; Ok?</FONT> >
>  > <BR><FONT SIZE=2>&gt; </FONT> >
>  > <BR><FONT SIZE=2>&gt; Richard.</FONT> >
>  > <BR><FONT SIZE=2>&gt; </FONT> >
>  > <BR><FONT SIZE=2>&gt; </FONT> >
>  > <BR><FONT SIZE=2>&gt; 2004Mar02&nbsp; Richard Guenther >
> &lt;richard.guenther at uni-tuebingen.de&gt;</FONT> >
>  > <BR><FONT SIZE=2>&gt; </FONT> >
>  > <BR><FONT SIZE=2>&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; * >
> src/Array/Array.h: remove all traces of AltView0 class.</FONT> >
>  > <BR><FONT SIZE=2>&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; src/Field/Field.h: >
> remove all traces of AltView1 and</FONT> >
>  > <BR><FONT SIZE=2>&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; >
> AltView1Implementation classes.</FONT> >
>  > <BR><FONT SIZE=2>&gt; </FONT> >
>  > <BR><FONT SIZE=2>&gt; ===== Array/Array.h 1.14 vs edited =====</FONT> >
>  > <BR><FONT SIZE=2>&gt; --- 1.14/r2/src/Array/Array.h Tue Dec 16 15:19:57 >
> 2003</FONT> >
>  > <BR><FONT SIZE=2>&gt; +++ >
> edited/Array/Array.h&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Tue Mar&nbsp; 2 >
> 11:24:14 2004</FONT> >
>  > <BR><FONT SIZE=2>&gt; @@ -649,8 +649,6 @@</FONT> >
>  > <BR><FONT SIZE=2>&gt;&nbsp; // an existing engine cannot be any kind of >
> slice domain.</FONT> >
>  > <BR><FONT SIZE=2>&gt;&nbsp; // Also, bounds checking would make no >
> sense because it would</FONT> >
>  > <BR><FONT SIZE=2>&gt;&nbsp; // reduce to contains(a.domain(), >
> a.domain());</FONT> >
>  > <BR><FONT SIZE=2>&gt; -//</FONT> >
>  > <BR><FONT SIZE=2>&gt; -// Any changes to this class should also be made >
> to AltView0.</FONT> >
>  > <BR><FONT SIZE=2>&gt; </FONT> >
>  > <BR><FONT SIZE=2>&gt;&nbsp; template&lt;int Dim, class T, class >
> EngineTag&gt;</FONT> >
>  > <BR><FONT SIZE=2>&gt;&nbsp; struct View0&lt;Array&lt;Dim, T, >
> EngineTag&gt; &gt;</FONT> >
>  > <BR><FONT SIZE=2>&gt; @@ -695,41 +693,6 @@</FONT> >
>  > <BR><FONT SIZE=2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</FONT> >
>  > <BR><FONT SIZE=2>&gt;&nbsp; };</FONT> >
>  > <BR><FONT SIZE=2>&gt; </FONT> >
>  > <BR><FONT SIZE=2>&gt; -// AltView0 avoids an instantiation problem that >
> arises when two</FONT> >
>  > <BR><FONT SIZE=2>&gt; -// classes use each other.&nbsp; This class's >
> definition should be exactly</FONT> >
>  > <BR><FONT SIZE=2>&gt; -// the same as View0 except omitting member >
> functions.</FONT> >
>  > <BR><FONT SIZE=2>&gt; -//</FONT> >
>  > <BR><FONT SIZE=2>&gt; -// Do NOT explicitly instantiate this >
> class.</FONT> >
>  > <BR><FONT SIZE=2>&gt; -</FONT> >
>  > <BR><FONT SIZE=2>&gt; -template&lt;class ArrayTag&gt;</FONT> >
>  > <BR><FONT SIZE=2>&gt; -struct AltView0;</FONT> >
>  > <BR><FONT SIZE=2>&gt; -</FONT> >
>  > <BR><FONT SIZE=2>&gt; -template&lt;int Dim, class T, class >
> EngineTag&gt;</FONT> >
>  > <BR><FONT SIZE=2>&gt; -struct AltView0&lt;Array&lt;Dim, T, >
> EngineTag&gt; &gt;</FONT> >
>  > <BR><FONT SIZE=2>&gt; -{</FONT> >
>  > <BR><FONT SIZE=2>&gt; -&nbsp; // Convenience typedef for the thing >
> we're taking a view of.</FONT> >
>  > <BR><FONT SIZE=2>&gt; -</FONT> >
>  > <BR><FONT SIZE=2>&gt; -&nbsp; typedef Array&lt;Dim, T, EngineTag&gt; >
> Subject_t;</FONT> >
>  > <BR><FONT SIZE=2>&gt; -</FONT> >
>  > <BR><FONT SIZE=2>&gt; -&nbsp; // Deduce domains for the output >
> type.</FONT> >
>  > <BR><FONT SIZE=2>&gt; -&nbsp; // At some point, we need to fix >
> NewDomain1; until then, use</FONT> >
>  > <BR><FONT SIZE=2>&gt; -&nbsp; // the temporary version from >
> Array.h.</FONT> >
>  > <BR><FONT SIZE=2>&gt; -</FONT> >
>  > <BR><FONT SIZE=2>&gt; -&nbsp; typedef typename Subject_t::Engine_t >
> Engine_t;</FONT> >
>  > <BR><FONT SIZE=2>&gt; -&nbsp; typedef typename Subject_t::Domain_t >
> Domain_t;</FONT> >
>  > <BR><FONT SIZE=2>&gt; -</FONT> >
>  > <BR><FONT SIZE=2>&gt; -&nbsp; // Deduce the template parameters for the >
> output type.</FONT> >
>  > <BR><FONT SIZE=2>&gt; -</FONT> >
>  > <BR><FONT SIZE=2>&gt; -&nbsp; typedef typename NewEngine&lt;Engine_t, >
> Domain_t&gt;::Type_t NewEngine_t;</FONT> >
>  > <BR><FONT SIZE=2>&gt; -&nbsp; enum { newDim = NewEngine_t::dimensions >
> };</FONT> >
>  > <BR><FONT SIZE=2>&gt; -&nbsp; typedef typename NewEngine_t::Tag_t >
> NewEngineTag_t;</FONT> >
>  > <BR><FONT SIZE=2>&gt; -</FONT> >
>  > <BR><FONT SIZE=2>&gt; -&nbsp; // The output types.</FONT> >
>  > <BR><FONT SIZE=2>&gt; -</FONT> >
>  > <BR><FONT SIZE=2>&gt; -&nbsp; typedef Array&lt;newDim, T, >
> NewEngineTag_t&gt; Type_t;</FONT> >
>  > <BR><FONT SIZE=2>&gt; -&nbsp; typedef Type_t ReadType_t;</FONT> >
>  > <BR><FONT SIZE=2>&gt; -};</FONT> >
>  > <BR><FONT SIZE=2>&gt; -</FONT> >
>  > <BR><FONT SIZE=2>&gt;&nbsp; template&lt;int Dim, class T, class >
> EngineTag&gt;</FONT> >
>  > <BR><FONT SIZE=2>&gt;&nbsp; struct View1&lt;Array&lt;Dim, T, >
> EngineTag&gt;, int&gt;</FONT> >
>  > <BR><FONT SIZE=2>&gt;&nbsp; {</FONT> >
>  > <BR><FONT SIZE=2>&gt; @@ -1864,7 +1827,7 @@</FONT> >
>  > <BR><FONT SIZE=2>&gt;&nbsp;&nbsp;&nbsp; /// A zero-argument version of >
> operator(), which takes a view of</FONT> >
>  > <BR><FONT SIZE=2>&gt;&nbsp;&nbsp;&nbsp; /// array's domain, is also >
> supplied.</FONT> >
>  > <BR><FONT SIZE=2>&gt;&nbsp;&nbsp;&nbsp; //@{</FONT> >
>  > <BR><FONT SIZE=2>&gt; -&nbsp; typename >
> AltView0&lt;This_t&gt;::ReadType_t</FONT> >
>  > <BR><FONT SIZE=2>&gt; +&nbsp; typename >
> View0&lt;This_t&gt;::ReadType_t</FONT> >
>  > <BR><FONT SIZE=2>&gt;&nbsp;&nbsp;&nbsp; read() const</FONT> >
>  > <BR><FONT SIZE=2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</FONT> >
>  > <BR><FONT SIZE=2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; typedef >
> View0&lt;This_t&gt; Ret_t;</FONT> >
>  > <BR><FONT SIZE=2>&gt; @@ -1934,7 +1897,7 @@</FONT> >
>  > <BR><FONT SIZE=2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return >
> Ret_t::makeRead(*this, s1, s2, s3, s4, s5, s6, s7);</FONT> >
>  > <BR><FONT SIZE=2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</FONT> >
>  > <BR><FONT SIZE=2>&gt; </FONT> >
>  > <BR><FONT SIZE=2>&gt; -&nbsp; typename >
> AltView0&lt;This_t&gt;::Type_t</FONT> >
>  > <BR><FONT SIZE=2>&gt; +&nbsp; typename >
> View0&lt;This_t&gt;::Type_t</FONT> >
>  > <BR><FONT SIZE=2>&gt;&nbsp;&nbsp;&nbsp; operator()() const</FONT> >
>  > <BR><FONT SIZE=2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</FONT> >
>  > <BR><FONT SIZE=2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; typedef >
> View0&lt;This_t&gt; Ret_t;</FONT> >
>  > <BR><FONT SIZE=2>&gt; ===== Field/Field.h 1.14 vs edited =====</FONT> >
>  > <BR><FONT SIZE=2>&gt; --- 1.14/r2/src/Field/Field.h Tue Dec 16 15:20:00 >
> 2003</FONT> >
>  > <BR><FONT SIZE=2>&gt; +++ >
> edited/Field/Field.h&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Tue Mar&nbsp; 2 >
> 11:25:22 2004</FONT> >
>  > <BR><FONT SIZE=2>&gt; @@ -269,9 +269,6 @@</FONT> >
>  > <BR><FONT SIZE=2>&gt;&nbsp;&nbsp; * View1Implementation&lt;Field, D, >
> SV&gt; specialization for indexing a field</FONT> >
>  > <BR><FONT SIZE=2>&gt;&nbsp;&nbsp; * with a single domain. There is a >
> single-valued version (SV == true)</FONT> >
>  > <BR><FONT SIZE=2>&gt;&nbsp;&nbsp; * and a multi-valued version (SV == >
> false).</FONT> >
>  > <BR><FONT SIZE=2>&gt; - *</FONT> >
>  > <BR><FONT SIZE=2>&gt; - * Any changes to View1Implementation should >
> also be made to</FONT> >
>  > <BR><FONT SIZE=2>&gt; - * AltView1Implementation.</FONT> >
>  > <BR><FONT SIZE=2>&gt;&nbsp;&nbsp; */</FONT> >
>  > <BR><FONT SIZE=2>&gt; </FONT> >
>  > <BR><FONT SIZE=2>&gt;&nbsp; // Single-valued version. Handles scalars >
> and Locs.</FONT> >
>  > <BR><FONT SIZE=2>&gt; @@ -508,62 +505,7 @@</FONT> >
>  > <BR><FONT SIZE=2>&gt; </FONT> >
>  > <BR><FONT SIZE=2>&gt; </FONT> >
>  > <BR><FONT SIZE=2>&gt;&nbsp; /**</FONT> >
>  > <BR><FONT SIZE=2>&gt; - * AltView1Implementation avoids an >
> instantiation problem that arises</FONT> >
>  > <BR><FONT SIZE=2>&gt; when two</FONT> >
>  > <BR><FONT SIZE=2>&gt; - * classes use each other.&nbsp; This class's >
> definition should be exactly</FONT> >
>  > <BR><FONT SIZE=2>&gt; - * the same as View1Implementation except >
> omitting member functions.</FONT> >
>  > <BR><FONT SIZE=2>&gt; - *</FONT> >
>  > <BR><FONT SIZE=2>&gt; - * Do NOT explicitly instantiate this >
> class.</FONT> >
>  > <BR><FONT SIZE=2>&gt; - */</FONT> >
>  > <BR><FONT SIZE=2>&gt; -</FONT> >
>  > <BR><FONT SIZE=2>&gt; -// Single-valued version. Handles scalars and >
> Locs.</FONT> >
>  > <BR><FONT SIZE=2>&gt; -</FONT> >
>  > <BR><FONT SIZE=2>&gt; -template&lt;class Subject, class Domain, bool >
> SV&gt;</FONT> >
>  > <BR><FONT SIZE=2>&gt; -struct AltView1Implementation;</FONT> >
>  > <BR><FONT SIZE=2>&gt; -</FONT> >
>  > <BR><FONT SIZE=2>&gt; -template&lt;class Mesh, class T, class >
> EngineTag, class Domain&gt;</FONT> >
>  > <BR><FONT SIZE=2>&gt; -struct AltView1Implementation&lt;Field&lt;Mesh, >
> T, EngineTag&gt;, Domain, true&gt;</FONT> >
>  > <BR><FONT SIZE=2>&gt; -{</FONT> >
>  > <BR><FONT SIZE=2>&gt; -&nbsp; // Convenience typedef for the thing >
> we're taking a view of.</FONT> >
>  > <BR><FONT SIZE=2>&gt; -</FONT> >
>  > <BR><FONT SIZE=2>&gt; -&nbsp; typedef Field&lt;Mesh, T, EngineTag&gt; >
> Subject_t;</FONT> >
>  > <BR><FONT SIZE=2>&gt; -</FONT> >
>  > <BR><FONT SIZE=2>&gt; -&nbsp; // The return types are pretty simple >
> here.</FONT> >
>  > <BR><FONT SIZE=2>&gt; -</FONT> >
>  > <BR><FONT SIZE=2>&gt; -&nbsp; typedef typename Subject_t::Element_t >
> ReadType_t;</FONT> >
>  > <BR><FONT SIZE=2>&gt; -&nbsp; typedef typename Subject_t::ElementRef_t >
> Type_t;</FONT> >
>  > <BR><FONT SIZE=2>&gt; -};</FONT> >
>  > <BR><FONT SIZE=2>&gt; -</FONT> >
>  > <BR><FONT SIZE=2>&gt; -template&lt;class Mesh, class T, class >
> EngineTag, class Domain&gt;</FONT> >
>  > <BR><FONT SIZE=2>&gt; -struct AltView1Implementation&lt;Field&lt;Mesh, >
> T, EngineTag&gt;, Domain, false&gt;</FONT> >
>  > <BR><FONT SIZE=2>&gt; -{</FONT> >
>  > <BR><FONT SIZE=2>&gt; -&nbsp; // Convenience typedef for the thing >
> we're taking a view of.</FONT> >
>  > <BR><FONT SIZE=2>&gt; -</FONT> >
>  > <BR><FONT SIZE=2>&gt; -&nbsp; typedef Field&lt;Mesh, T, EngineTag&gt; >
> Subject_t;</FONT> >
>  > <BR><FONT SIZE=2>&gt; -</FONT> >
>  > <BR><FONT SIZE=2>&gt; -&nbsp; // Deduce domains for the output >
> type.</FONT> >
>  > <BR><FONT SIZE=2>&gt; -</FONT> >
>  > <BR><FONT SIZE=2>&gt; -&nbsp; typedef typename Subject_t::Engine_t >
> Engine_t;</FONT> >
>  > <BR><FONT SIZE=2>&gt; -&nbsp; typedef typename NewEngine&lt;Engine_t, >
> Domain&gt;::Type_t NewEngine_t;</FONT> >
>  > <BR><FONT SIZE=2>&gt; -&nbsp; typedef typename NewEngine_t::Element_t >
> NewT_t;</FONT> >
>  > <BR><FONT SIZE=2>&gt; -&nbsp; typedef typename NewEngine_t::Tag_t >
> NewEngineTag_t;</FONT> >
>  > <BR><FONT SIZE=2>&gt; -</FONT> >
>  > <BR><FONT SIZE=2>&gt; -&nbsp; // Deduce the new Mesh.</FONT> >
>  > <BR><FONT SIZE=2>&gt; -</FONT> >
>  > <BR><FONT SIZE=2>&gt; -&nbsp; typedef typename</FONT> >
>  > <BR><FONT SIZE=2>&gt; -&nbsp;&nbsp;&nbsp; >
> NewMeshTag&lt;NewEngine_t::dimensions, Mesh, Domain&gt;::Type_t</FONT> >
>  > <BR><FONT SIZE=2>&gt; -&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; >
> NewMeshTag_t;</FONT> >
>  > <BR><FONT SIZE=2>&gt; -</FONT> >
>  > <BR><FONT SIZE=2>&gt; -&nbsp; // The output types.</FONT> >
>  > <BR><FONT SIZE=2>&gt; -</FONT> >
>  > <BR><FONT SIZE=2>&gt; -&nbsp; typedef Field&lt;NewMeshTag_t, NewT_t, >
> NewEngineTag_t&gt; ReadType_t;</FONT> >
>  > <BR><FONT SIZE=2>&gt; -&nbsp; typedef Field&lt;NewMeshTag_t, NewT_t, >
> NewEngineTag_t&gt; Type_t;</FONT> >
>  > <BR><FONT SIZE=2>&gt; -};</FONT> >
>  > <BR><FONT SIZE=2>&gt; -</FONT> >
>  > <BR><FONT SIZE=2>&gt; -</FONT> >
>  > <BR><FONT SIZE=2>&gt; -/**</FONT> >
>  > <BR><FONT SIZE=2>&gt;&nbsp;&nbsp; * View1&lt;Field, S1&gt; >
> specialization for indexing a field with a single</FONT> >
>  > <BR><FONT SIZE=2>&gt; domain.</FONT> >
>  > <BR><FONT SIZE=2>&gt; - *</FONT> >
>  > <BR><FONT SIZE=2>&gt; - * Any changes to View1 should also be made to >
> AltView1.</FONT> >
>  > <BR><FONT SIZE=2>&gt;&nbsp;&nbsp; */</FONT> >
>  > <BR><FONT SIZE=2>&gt; </FONT> >
>  > <BR><FONT SIZE=2>&gt;&nbsp; template&lt;class Mesh, class T, class >
> EngineTag, class Sub1&gt;</FONT> >
>  > <BR><FONT SIZE=2>&gt; @@ -613,8 +555,6 @@</FONT> >
>  > <BR><FONT SIZE=2>&gt; </FONT> >
>  > <BR><FONT SIZE=2>&gt;&nbsp; /**</FONT> >
>  > <BR><FONT SIZE=2>&gt;&nbsp;&nbsp; * View1&lt;Field, int&gt; >
> specialization for indexing a field with an int.</FONT> >
>  > <BR><FONT SIZE=2>&gt; - *</FONT> >
>  > <BR><FONT SIZE=2>&gt; - * Any changes to View1 should also be made to >
> AltView1.</FONT> >
>  > <BR><FONT SIZE=2>&gt;&nbsp;&nbsp; */</FONT> >
>  > <BR><FONT SIZE=2>&gt; </FONT> >
>  > <BR><FONT SIZE=2>&gt;&nbsp; template&lt;class Mesh, class T, class >
> EngineTag&gt;</FONT> >
>  > <BR><FONT SIZE=2>&gt; @@ -658,71 +598,6 @@</FONT> >
>  > <BR><FONT SIZE=2>&gt; </FONT> >
>  > <BR><FONT SIZE=2>&gt; </FONT> >
>  > <BR><FONT SIZE=2>&gt;&nbsp; /**</FONT> >
>  > <BR><FONT SIZE=2>&gt; - * AltView1 avoids an instantiation problem that >
> arises when two</FONT> >
>  > <BR><FONT SIZE=2>&gt; - * classes use each other.&nbsp; This class's >
> definition should be exactly</FONT> >
>  > <BR><FONT SIZE=2>&gt; - * the same as View1 except omitting member >
> functions.</FONT> >
>  > <BR><FONT SIZE=2>&gt; - *</FONT> >
>  > <BR><FONT SIZE=2>&gt; - * Do NOT explicitly instantiate this >
> class.</FONT> >
>  > <BR><FONT SIZE=2>&gt; - */</FONT> >
>  > <BR><FONT SIZE=2>&gt; -</FONT> >
>  > <BR><FONT SIZE=2>&gt; -template&lt;class FieldTag, class >
> DomainTag&gt;</FONT> >
>  > <BR><FONT SIZE=2>&gt; -struct AltView1;</FONT> >
>  > <BR><FONT SIZE=2>&gt; -</FONT> >
>  > <BR><FONT SIZE=2>&gt; -template&lt;class Mesh, class T, class >
> EngineTag, class Sub1&gt;</FONT> >
>  > <BR><FONT SIZE=2>&gt; -struct AltView1&lt;Field&lt;Mesh, T, >
> EngineTag&gt;, Sub1&gt;</FONT> >
>  > <BR><FONT SIZE=2>&gt; -{</FONT> >
>  > <BR><FONT SIZE=2>&gt; -&nbsp; // Convenience typedef for the thing >
> we're taking a view of.</FONT> >
>  > <BR><FONT SIZE=2>&gt; -</FONT> >
>  > <BR><FONT SIZE=2>&gt; -&nbsp; typedef Field&lt;Mesh, T, EngineTag&gt; >
> Subject_t;</FONT> >
>  > <BR><FONT SIZE=2>&gt; -</FONT> >
>  > <BR><FONT SIZE=2>&gt; -&nbsp; // Deduce domains for the output >
> type.</FONT> >
>  > <BR><FONT SIZE=2>&gt; -&nbsp; // At some point, we need to fix >
> NewDomain1; until then, use</FONT> >
>  > <BR><FONT SIZE=2>&gt; -&nbsp; // the temporary version from >
> NewDomain.h.</FONT> >
>  > <BR><FONT SIZE=2>&gt; -</FONT> >
>  > <BR><FONT SIZE=2>&gt; -&nbsp; typedef typename Subject_t::Domain_t >
> Domain_t;</FONT> >
>  > <BR><FONT SIZE=2>&gt; -&nbsp; typedef TemporaryNewDomain1&lt;Domain_t, >
> Sub1&gt; NewDomain_t;</FONT> >
>  > <BR><FONT SIZE=2>&gt; -&nbsp; typedef typename NewDomain_t::SliceType_t >
> SDomain_t;</FONT> >
>  > <BR><FONT SIZE=2>&gt; -</FONT> >
>  > <BR><FONT SIZE=2>&gt; -&nbsp; // Deduce appropriate version of >
> implementation to dispatch to.</FONT> >
>  > <BR><FONT SIZE=2>&gt; -</FONT> >
>  > <BR><FONT SIZE=2>&gt; -&nbsp; enum { sv = >
> DomainTraits&lt;SDomain_t&gt;::singleValued };</FONT> >
>  > <BR><FONT SIZE=2>&gt; -&nbsp; typedef >
> AltView1Implementation&lt;Subject_t, SDomain_t, sv&gt; Dispatch_t;</FONT> >
>  > <BR><FONT SIZE=2>&gt; -</FONT> >
>  > <BR><FONT SIZE=2>&gt; -&nbsp; // The optimized domain combiner.</FONT> >
>  > <BR><FONT SIZE=2>&gt; -</FONT> >
>  > <BR><FONT SIZE=2>&gt; -&nbsp; typedef CombineDomainOpt&lt;NewDomain_t, >
> sv&gt; Combine_t;</FONT> >
>  > <BR><FONT SIZE=2>&gt; -</FONT> >
>  > <BR><FONT SIZE=2>&gt; -&nbsp; // The return types.</FONT> >
>  > <BR><FONT SIZE=2>&gt; -</FONT> >
>  > <BR><FONT SIZE=2>&gt; -&nbsp; typedef typename Dispatch_t::ReadType_t >
> ReadType_t;</FONT> >
>  > <BR><FONT SIZE=2>&gt; -&nbsp; typedef typename Dispatch_t::Type_t >
> Type_t;</FONT> >
>  > <BR><FONT SIZE=2>&gt; -};</FONT> >
>  > <BR><FONT SIZE=2>&gt; -</FONT> >
>  > <BR><FONT SIZE=2>&gt; -</FONT> >
>  > <BR><FONT SIZE=2>&gt; -/**</FONT> >
>  > <BR><FONT SIZE=2>&gt; - * AltView1 avoids an instantiation problem that >
> arises when two</FONT> >
>  > <BR><FONT SIZE=2>&gt; - * classes use each other.&nbsp; This class's >
> definition should be exactly</FONT> >
>  > <BR><FONT SIZE=2>&gt; - * the same as View1 except omitting member >
> functions.</FONT> >
>  > <BR><FONT SIZE=2>&gt; - *</FONT> >
>  > <BR><FONT SIZE=2>&gt; - * Do NOT explicitly instantiate this >
> class.</FONT> >
>  > <BR><FONT SIZE=2>&gt; - */</FONT> >
>  > <BR><FONT SIZE=2>&gt; -</FONT> >
>  > <BR><FONT SIZE=2>&gt; -template&lt;class Mesh, class T, class >
> EngineTag&gt;</FONT> >
>  > <BR><FONT SIZE=2>&gt; -struct AltView1&lt;Field&lt;Mesh, T, >
> EngineTag&gt;, int&gt;</FONT> >
>  > <BR><FONT SIZE=2>&gt; -{</FONT> >
>  > <BR><FONT SIZE=2>&gt; -&nbsp; // Convenience typedef for the thing >
> we're taking a view of.</FONT> >
>  > <BR><FONT SIZE=2>&gt; -</FONT> >
>  > <BR><FONT SIZE=2>&gt; -&nbsp; typedef Field&lt;Mesh, T, EngineTag&gt; >
> Subject_t;</FONT> >
>  > <BR><FONT SIZE=2>&gt; -</FONT> >
>  > <BR><FONT SIZE=2>&gt; -&nbsp; // The return types.</FONT> >
>  > <BR><FONT SIZE=2>&gt; -</FONT> >
>  > <BR><FONT SIZE=2>&gt; -&nbsp; typedef typename Subject_t::Element_t >
> ReadType_t;</FONT> >
>  > <BR><FONT SIZE=2>&gt; -&nbsp; typedef typename Subject_t::ElementRef_t >
> Type_t;</FONT> >
>  > <BR><FONT SIZE=2>&gt; -</FONT> >
>  > <BR><FONT SIZE=2>&gt; -};</FONT> >
>  > <BR><FONT SIZE=2>&gt; -</FONT> >
>  > <BR><FONT SIZE=2>&gt; -</FONT> >
>  > <BR><FONT SIZE=2>&gt; -/**</FONT> >
>  > <BR><FONT SIZE=2>&gt;&nbsp;&nbsp; * View2&lt;Field, S1, S2&gt; >
> specialization for indexing a field with two</FONT> >
>  > <BR><FONT SIZE=2>&gt;&nbsp;&nbsp; * domains.</FONT> >
>  > <BR><FONT SIZE=2>&gt;&nbsp;&nbsp; */</FONT> >
>  > <BR><FONT SIZE=2>&gt; @@ -1455,14 +1330,14 @@</FONT> >
>  > <BR><FONT SIZE=2>&gt;&nbsp;&nbsp;&nbsp; /// point fields the viewing >
> domain is an actual centering domain.</FONT> >
>  > <BR><FONT SIZE=2>&gt;&nbsp;&nbsp;&nbsp; //@{</FONT> >
>  > <BR><FONT SIZE=2>&gt; </FONT> >
>  > <BR><FONT SIZE=2>&gt; -&nbsp; inline typename AltView1&lt;This_t, >
> Domain_t&gt;::ReadType_t</FONT> >
>  > <BR><FONT SIZE=2>&gt; +&nbsp; inline typename View1&lt;This_t, >
> Domain_t&gt;::ReadType_t</FONT> >
>  > <BR><FONT SIZE=2>&gt;&nbsp;&nbsp;&nbsp; read() const</FONT> >
>  > <BR><FONT SIZE=2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</FONT> >
>  > <BR><FONT SIZE=2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; typedef >
> View1&lt;This_t, Domain_t&gt; Ret_t;</FONT> >
>  > <BR><FONT SIZE=2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return >
> Ret_t::makeRead(*this, physicalDomain());</FONT> >
>  > <BR><FONT SIZE=2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</FONT> >
>  > <BR><FONT SIZE=2>&gt; </FONT> >
>  > <BR><FONT SIZE=2>&gt; -&nbsp; inline typename AltView1&lt;This_t, >
> Domain_t&gt;::ReadType_t</FONT> >
>  > <BR><FONT SIZE=2>&gt; +&nbsp; inline typename View1&lt;This_t, >
> Domain_t&gt;::ReadType_t</FONT> >
>  > <BR><FONT SIZE=2>&gt;&nbsp;&nbsp;&nbsp; readAll() const</FONT> >
>  > <BR><FONT SIZE=2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</FONT> >
>  > <BR><FONT SIZE=2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; typedef >
> View1&lt;This_t, Domain_t&gt; Ret_t;</FONT> >
>  > <BR><FONT SIZE=2>&gt; @@ -1470,7 +1345,7 @@</FONT> >
>  > <BR><FONT SIZE=2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</FONT> >
>  > <BR><FONT SIZE=2>&gt; </FONT> >
>  > <BR><FONT SIZE=2>&gt;&nbsp;&nbsp;&nbsp; template&lt;class >
> Sub1&gt;</FONT> >
>  > <BR><FONT SIZE=2>&gt; -&nbsp; inline typename AltView1&lt;This_t, >
> Sub1&gt;::ReadType_t</FONT> >
>  > <BR><FONT SIZE=2>&gt; +&nbsp; inline typename View1&lt;This_t, >
> Sub1&gt;::ReadType_t</FONT> >
>  > <BR><FONT SIZE=2>&gt;&nbsp;&nbsp;&nbsp; read(const Sub1 &amp;s1) >
> const</FONT> >
>  > <BR><FONT SIZE=2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</FONT> >
>  > <BR><FONT SIZE=2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; typedef >
> View1&lt;This_t, Sub1&gt; Ret_t;</FONT> >
>  > <BR><FONT SIZE=2>&gt; @@ -1493,14 +1368,14 @@</FONT> >
>  > <BR><FONT SIZE=2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return >
> Ret_t::makeRead(*this, s1, s2, s3);</FONT> >
>  > <BR><FONT SIZE=2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</FONT> >
>  > <BR><FONT SIZE=2>&gt; </FONT> >
>  > <BR><FONT SIZE=2>&gt; -&nbsp; inline typename AltView1&lt;This_t, >
> Domain_t&gt;::Type_t</FONT> >
>  > <BR><FONT SIZE=2>&gt; +&nbsp; inline typename View1&lt;This_t, >
> Domain_t&gt;::Type_t</FONT> >
>  > <BR><FONT SIZE=2>&gt;&nbsp;&nbsp;&nbsp; operator()() const</FONT> >
>  > <BR><FONT SIZE=2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</FONT> >
>  > <BR><FONT SIZE=2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; typedef >
> View1&lt;This_t, Domain_t&gt; Ret_t;</FONT> >
>  > <BR><FONT SIZE=2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return >
> Ret_t::make(*this, physicalDomain());</FONT> >
>  > <BR><FONT SIZE=2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</FONT> >
>  > <BR><FONT SIZE=2>&gt; </FONT> >
>  > <BR><FONT SIZE=2>&gt; -&nbsp; inline typename AltView1&lt;This_t, >
> Domain_t&gt;::Type_t</FONT> >
>  > <BR><FONT SIZE=2>&gt; +&nbsp; inline typename View1&lt;This_t, >
> Domain_t&gt;::Type_t</FONT> >
>  > <BR><FONT SIZE=2>&gt;&nbsp;&nbsp;&nbsp; all() const</FONT> >
>  > <BR><FONT SIZE=2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</FONT> >
>  > <BR><FONT SIZE=2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; typedef >
> View1&lt;This_t, Domain_t&gt; Ret_t;</FONT> >
>  > <BR><FONT SIZE=2>&gt; @@ -1508,7 +1383,7 @@</FONT> >
>  > <BR><FONT SIZE=2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</FONT> >
>  > <BR><FONT SIZE=2>&gt; </FONT> >
>  > <BR><FONT SIZE=2>&gt;&nbsp;&nbsp;&nbsp; template&lt;class >
> Sub1&gt;</FONT> >
>  > <BR><FONT SIZE=2>&gt; -&nbsp; inline typename AltView1&lt;This_t, >
> Sub1&gt;::Type_t</FONT> >
>  > <BR><FONT SIZE=2>&gt; +&nbsp; inline typename View1&lt;This_t, >
> Sub1&gt;::Type_t</FONT> >
>  > <BR><FONT SIZE=2>&gt;&nbsp;&nbsp;&nbsp; operator()(const Sub1 &amp;s1) >
> const</FONT> >
>  > <BR><FONT SIZE=2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</FONT> >
>  > <BR><FONT SIZE=2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; typedef >
> View1&lt;This_t, Sub1&gt; Ret_t;</FONT> >
>  > </P> >
>  > >
>  > </BODY> >
>  > </HTML> >

> > > From rguenth at tat.physik.uni-tuebingen.de Tue Mar 2 17:20:27 2004 From: rguenth at tat.physik.uni-tuebingen.de (Richard Guenther) Date: Tue, 02 Mar 2004 18:20:27 +0100 Subject: [pooma-dev] AltView* classes In-Reply-To: <16452.49542.996541.986692@bedell.lanl.gov> References: <16452.49542.996541.986692@bedell.lanl.gov> Message-ID: <4044C25B.6030001@tat.physik.uni-tuebingen.de> Dave Nystrom wrote: > No problem. I think my neurons are less rusty because of my perverse > hobby:-). I've actually compiled the Blanca Demo stuff in the last year and > I try to keep up with evolution of Pooma 2 with the thought that I will > sometime get back to using it. John, Don and Jean have actually been doing > some work on the source code base in the last year. > > Also, the Blanca Demo project and it's progeny is the only Blanca related > source code base that to my knowledge ever used Pooma 2. And supposedly, the > Blanca project is dead and unlikely to use anything that we ever did. I suppose it is not possible to "release" some of this demo code, if not for "educating of Pooma2" purpose? Thanks, Richard. From jxyh at lanl.gov Tue Mar 2 17:34:09 2004 From: jxyh at lanl.gov (John H. Hall) Date: Tue, 2 Mar 2004 10:34:09 -0700 Subject: [pooma-dev] AltView* classes In-Reply-To: <16452.49542.996541.986692@bedell.lanl.gov> References: <16452.49542.996541.986692@bedell.lanl.gov> Message-ID: Dave, et al: I have just had extensive discussion regarding the "Blanca is dead" issue. That is not quite the whole story. Management has decided to force Blanca and Shavano to merge, but, it is up to Blanca and Shavano to define what exactly that means. The head of ASCI at LANL is James Peery and he believes (to the best of my knowledge) that some amalgamation will win out. Meanwhile, Don and Jean Marshall and I are still developing what we affectionately refer to as "the Blanca Demo Project". This is funded (at a low level) through at least the end of this year, and around that time, I believe the code will start really impressing some people. We are having to develop a series of new POOMA engines for this project, some of which I hinted at a while back. The changes to field comtemplated here won't really affect engines for the most part, so if Dave's happy then I am happy. A special thanks to Richard for putting so much time into advancing the status of POOMA. John Hall On Mar 2, 2004, at 10:16 AM, Dave Nystrom wrote: > No problem. I think my neurons are less rusty because of my perverse > hobby:-). I've actually compiled the Blanca Demo stuff in the last > year and > I try to keep up with evolution of Pooma 2 with the thought that I will > sometime get back to using it. John, Don and Jean have actually been > doing > some work on the source code base in the last year. > > Also, the Blanca Demo project and it's progeny is the only Blanca > related > source code base that to my knowledge ever used Pooma 2. And > supposedly, the > Blanca project is dead and unlikely to use anything that we ever did. > > -- > Dave Nystrom email: wdn at lanl.gov > LANL X-2 phone: 505-667-7913 fax: 505-665-2227 > > James Crotinger writes: >> OK - cool. Thanks for chipping in Dave. You're neurons are obviously >> less >> rusty than mine. :) >> >> 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: Dave Nystrom [mailto:wdn at lanl.gov] >>> Sent: Tuesday, March 02, 2004 10:00 AM >>> To: James Crotinger >>> Cc: 'Richard Guenther'; 'pooma-dev at pooma.codesourcery.com'; 'Jeffrey >>> D. >>> Oldham'; John Hall; Dave Nystrom; Dave Nystrom >>> Subject: RE: [pooma-dev] AltView* classes >>> >>> These AltView classes were put in by Jeffrey Oldham to fix a problem >>> that >>> I >>> was having trying to explicitly instantiate all the Pooma classes and >>> functions that Blanca code was using. Basically, the way the Pooma 2 >>> Field >>> class was originally written, we were getting one of these "sv" enums >>> instantiated for every unique expression which we had in our source >>> code >>> base. I was unable to explicitly instantiate these "sv" enums the >>> way the >>> code was originally written because of some issue which Arch Robison >>> of >>> Kuck >>> and Associates (now Intel) identified - basically the code in it's >>> original >>> form violated some corner case of the C++ standard according to Arch. >>> Jeffrey fixed this problem by adding the AltView class and then I >>> was able >>> to >>> perform the explicit instantiations that I needed. >>> >>> However, I believe Jeffrey or someone else has gone through the code >>> and >>> replaced the "sv" enums with some other construct which does not >>> have the >>> explicit instantiation difficulties that the "sv" enums had. So, I >>> think >>> that it is probably okay to remove the AltView classes and that this >>> would >>> clean up the code considerably. I may revisit all this explicit >>> instantiation stuff sometime in the not to distant future on a hobby >>> basis >>> (weird hobby, huh) and if I encounter difficulties being able to >>> explicitly >>> instantiate anything, I could then raise it as an issue at that time. >>> >>> In summary, the AltView classes were added by Jeffrey to fix an >>> explicit >>> instantiation problem that I think no longer exists and I am in >>> favor of >>> now >>> removing them in the interest of cleaning up the code as much as >>> possible. >>> >>> -- >>> Dave Nystrom email: wdn at lanl.gov >>> LANL X-2 phone: 505-667-7913 fax: 505-665-2227 >>> >>> James Crotinger writes: >>>> Hi Richard, >>>> >>>> This tickled a neuron the other day, but I couldn't recall the >>>> details. >>>> >>>> The AltView classes were put in to reduce link times and sizes for >>> large >>>> codes. The classes that have enums end up having a link-time cost, >>>> both >>> in >>>> space and time. I believe this refactoring was done to reduce the >>>> cardinality of classes having the "sv" enum. My recollection is that >>> this, >>>> and other similar "optimizations", had a pretty substantial impact >>>> on >>>> link-time for Blanca. Unless these are hurting something else, I >>>> would >>> tend >>>> to leave them in. >>>> >>>> Does the CodeSourcery CVS repository have complete CVS history? >>>> (i.e. >>> did we >>>> copy the repository, or just the head version?) This should have >>>> been >>> easy >>>> to determine via CVS. >>>> >>>> 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: Tuesday, March 02, 2004 3:29 AM >>>>> To: pooma-dev at pooma.codesourcery.com >>>>> Cc: Jeffrey D. Oldham >>>>> Subject: Re: [pooma-dev] AltView* classes >>>>> >>>>> On Tue, 2 Mar 2004, Richard Guenther wrote: >>>>> >>>>>> On Fri, 27 Feb 2004, Richard Guenther wrote: >>>>>> >>>>>>> Hi! >>>>>>> >>>>>>> Does anyone remember the exact reason for the existance of the >>>>> AltView* >>>>>>> classes in Array.h and Field.h? Removing them and fixing their >>> usage >>>>> to >>>>>>> use View* seems to work (full test with gcc 3.3 and 3.4 in >>> progress). >>>>>> >>>>>> Testing completed with no new failures. Would it be ok to remove >>> those >>>>>> AltView* classes? >>>>> >>>>> Which would be... >>>>> >>>>> Ok? >>>>> >>>>> Richard. >>>>> >>>>> >>>>> 2004Mar02 Richard Guenther >>>>> >>>>> * src/Array/Array.h: remove all traces of AltView0 class. >>>>> src/Field/Field.h: remove all traces of AltView1 and >>>>> AltView1Implementation classes. >>>>> >>>>> ===== Array/Array.h 1.14 vs edited ===== >>>>> --- 1.14/r2/src/Array/Array.h Tue Dec 16 15:19:57 2003 >>>>> +++ edited/Array/Array.h Tue Mar 2 11:24:14 2004 >>>>> @@ -649,8 +649,6 @@ >>>>> // an existing engine cannot be any kind of slice domain. >>>>> // Also, bounds checking would make no sense because it would >>>>> // reduce to contains(a.domain(), a.domain()); >>>>> -// >>>>> -// Any changes to this class should also be made to AltView0. >>>>> >>>>> template >>>>> struct View0 > >>>>> @@ -695,41 +693,6 @@ >>>>> } >>>>> }; >>>>> >>>>> -// AltView0 avoids an instantiation problem that arises when two >>>>> -// classes use each other. This class's definition should be >>> exactly >>>>> -// the same as View0 except omitting member functions. >>>>> -// >>>>> -// Do NOT explicitly instantiate this class. >>>>> - >>>>> -template >>>>> -struct AltView0; >>>>> - >>>>> -template >>>>> -struct AltView0 > >>>>> -{ >>>>> - // Convenience typedef for the thing we're taking a view of. >>>>> - >>>>> - typedef Array Subject_t; >>>>> - >>>>> - // Deduce domains for the output type. >>>>> - // At some point, we need to fix NewDomain1; until then, use >>>>> - // the temporary version from Array.h. >>>>> - >>>>> - typedef typename Subject_t::Engine_t Engine_t; >>>>> - typedef typename Subject_t::Domain_t Domain_t; >>>>> - >>>>> - // Deduce the template parameters for the output type. >>>>> - >>>>> - typedef typename NewEngine::Type_t >>> NewEngine_t; >>>>> - enum { newDim = NewEngine_t::dimensions }; >>>>> - typedef typename NewEngine_t::Tag_t NewEngineTag_t; >>>>> - >>>>> - // The output types. >>>>> - >>>>> - typedef Array Type_t; >>>>> - typedef Type_t ReadType_t; >>>>> -}; >>>>> - >>>>> template >>>>> struct View1, int> >>>>> { >>>>> @@ -1864,7 +1827,7 @@ >>>>> /// A zero-argument version of operator(), which takes a view of >>>>> /// array's domain, is also supplied. >>>>> //@{ >>>>> - typename AltView0::ReadType_t >>>>> + typename View0::ReadType_t >>>>> read() const >>>>> { >>>>> typedef View0 Ret_t; >>>>> @@ -1934,7 +1897,7 @@ >>>>> return Ret_t::makeRead(*this, s1, s2, s3, s4, s5, s6, s7); >>>>> } >>>>> >>>>> - typename AltView0::Type_t >>>>> + typename View0::Type_t >>>>> operator()() const >>>>> { >>>>> typedef View0 Ret_t; >>>>> ===== Field/Field.h 1.14 vs edited ===== >>>>> --- 1.14/r2/src/Field/Field.h Tue Dec 16 15:20:00 2003 >>>>> +++ edited/Field/Field.h Tue Mar 2 11:25:22 2004 >>>>> @@ -269,9 +269,6 @@ >>>>> * View1Implementation specialization for indexing a >>> field >>>>> * with a single domain. There is a single-valued version (SV == >>> true) >>>>> * and a multi-valued version (SV == false). >>>>> - * >>>>> - * Any changes to View1Implementation should also be made to >>>>> - * AltView1Implementation. >>>>> */ >>>>> >>>>> // Single-valued version. Handles scalars and Locs. >>>>> @@ -508,62 +505,7 @@ >>>>> >>>>> >>>>> /** >>>>> - * AltView1Implementation avoids an instantiation problem that >>> arises >>>>> when two >>>>> - * classes use each other. This class's definition should be >>> exactly >>>>> - * the same as View1Implementation except omitting member >>>>> functions. >>>>> - * >>>>> - * Do NOT explicitly instantiate this class. >>>>> - */ >>>>> - >>>>> -// Single-valued version. Handles scalars and Locs. >>>>> - >>>>> -template >>>>> -struct AltView1Implementation; >>>>> - >>>>> -template >>>>> -struct AltView1Implementation, Domain, >>> true> >>>>> -{ >>>>> - // Convenience typedef for the thing we're taking a view of. >>>>> - >>>>> - typedef Field Subject_t; >>>>> - >>>>> - // The return types are pretty simple here. >>>>> - >>>>> - typedef typename Subject_t::Element_t ReadType_t; >>>>> - typedef typename Subject_t::ElementRef_t Type_t; >>>>> -}; >>>>> - >>>>> -template >>>>> -struct AltView1Implementation, Domain, >>> false> >>>>> -{ >>>>> - // Convenience typedef for the thing we're taking a view of. >>>>> - >>>>> - typedef Field Subject_t; >>>>> - >>>>> - // Deduce domains for the output type. >>>>> - >>>>> - typedef typename Subject_t::Engine_t Engine_t; >>>>> - typedef typename NewEngine::Type_t >>>>> NewEngine_t; >>>>> - typedef typename NewEngine_t::Element_t NewT_t; >>>>> - typedef typename NewEngine_t::Tag_t NewEngineTag_t; >>>>> - >>>>> - // Deduce the new Mesh. >>>>> - >>>>> - typedef typename >>>>> - NewMeshTag::Type_t >>>>> - NewMeshTag_t; >>>>> - >>>>> - // The output types. >>>>> - >>>>> - typedef Field ReadType_t; >>>>> - typedef Field Type_t; >>>>> -}; >>>>> - >>>>> - >>>>> -/** >>>>> * View1 specialization for indexing a field with a >>> single >>>>> domain. >>>>> - * >>>>> - * Any changes to View1 should also be made to AltView1. >>>>> */ >>>>> >>>>> template >>>>> @@ -613,8 +555,6 @@ >>>>> >>>>> /** >>>>> * View1 specialization for indexing a field with an >>> int. >>>>> - * >>>>> - * Any changes to View1 should also be made to AltView1. >>>>> */ >>>>> >>>>> template >>>>> @@ -658,71 +598,6 @@ >>>>> >>>>> >>>>> /** >>>>> - * AltView1 avoids an instantiation problem that arises when two >>>>> - * classes use each other. This class's definition should be >>> exactly >>>>> - * the same as View1 except omitting member functions. >>>>> - * >>>>> - * Do NOT explicitly instantiate this class. >>>>> - */ >>>>> - >>>>> -template >>>>> -struct AltView1; >>>>> - >>>>> -template >>>>> -struct AltView1, Sub1> >>>>> -{ >>>>> - // Convenience typedef for the thing we're taking a view of. >>>>> - >>>>> - typedef Field Subject_t; >>>>> - >>>>> - // Deduce domains for the output type. >>>>> - // At some point, we need to fix NewDomain1; until then, use >>>>> - // the temporary version from NewDomain.h. >>>>> - >>>>> - typedef typename Subject_t::Domain_t Domain_t; >>>>> - typedef TemporaryNewDomain1 NewDomain_t; >>>>> - typedef typename NewDomain_t::SliceType_t SDomain_t; >>>>> - >>>>> - // Deduce appropriate version of implementation to dispatch to. >>>>> - >>>>> - enum { sv = DomainTraits::singleValued }; >>>>> - typedef AltView1Implementation >>> Dispatch_t; >>>>> - >>>>> - // The optimized domain combiner. >>>>> - >>>>> - typedef CombineDomainOpt Combine_t; >>>>> - >>>>> - // The return types. >>>>> - >>>>> - typedef typename Dispatch_t::ReadType_t ReadType_t; >>>>> - typedef typename Dispatch_t::Type_t Type_t; >>>>> -}; >>>>> - >>>>> - >>>>> -/** >>>>> - * AltView1 avoids an instantiation problem that arises when two >>>>> - * classes use each other. This class's definition should be >>> exactly >>>>> - * the same as View1 except omitting member functions. >>>>> - * >>>>> - * Do NOT explicitly instantiate this class. >>>>> - */ >>>>> - >>>>> -template >>>>> -struct AltView1, int> >>>>> -{ >>>>> - // Convenience typedef for the thing we're taking a view of. >>>>> - >>>>> - typedef Field Subject_t; >>>>> - >>>>> - // The return types. >>>>> - >>>>> - typedef typename Subject_t::Element_t ReadType_t; >>>>> - typedef typename Subject_t::ElementRef_t Type_t; >>>>> - >>>>> -}; >>>>> - >>>>> - >>>>> -/** >>>>> * View2 specialization for indexing a field with >>>>> two >>>>> * domains. >>>>> */ >>>>> @@ -1455,14 +1330,14 @@ >>>>> /// point fields the viewing domain is an actual centering >>>>> domain. >>>>> //@{ >>>>> >>>>> - inline typename AltView1::ReadType_t >>>>> + inline typename View1::ReadType_t >>>>> read() const >>>>> { >>>>> typedef View1 Ret_t; >>>>> return Ret_t::makeRead(*this, physicalDomain()); >>>>> } >>>>> >>>>> - inline typename AltView1::ReadType_t >>>>> + inline typename View1::ReadType_t >>>>> readAll() const >>>>> { >>>>> typedef View1 Ret_t; >>>>> @@ -1470,7 +1345,7 @@ >>>>> } >>>>> >>>>> template >>>>> - inline typename AltView1::ReadType_t >>>>> + inline typename View1::ReadType_t >>>>> read(const Sub1 &s1) const >>>>> { >>>>> typedef View1 Ret_t; >>>>> @@ -1493,14 +1368,14 @@ >>>>> return Ret_t::makeRead(*this, s1, s2, s3); >>>>> } >>>>> >>>>> - inline typename AltView1::Type_t >>>>> + inline typename View1::Type_t >>>>> operator()() const >>>>> { >>>>> typedef View1 Ret_t; >>>>> return Ret_t::make(*this, physicalDomain()); >>>>> } >>>>> >>>>> - inline typename AltView1::Type_t >>>>> + inline typename View1::Type_t >>>>> all() const >>>>> { >>>>> typedef View1 Ret_t; >>>>> @@ -1508,7 +1383,7 @@ >>>>> } >>>>> >>>>> template >>>>> - inline typename AltView1::Type_t >>>>> + inline typename View1::Type_t >>>>> operator()(const Sub1 &s1) const >>>>> { >>>>> typedef View1 Ret_t; >>>> >>>> >>>> >>>> >>>> >>>> RE: [pooma-dev] AltView* classes >>>> >>>> >>>> >>>>

Hi Richard, >>>>

>>>> >>>>

This tickled a neuron the other day, but I couldn't >>> recall the details. >>>>

>>>> >>>>

The AltView classes were put in to reduce link times >>> and sizes for large codes. The classes that have enums end up having >>> a >>> link-time cost, both in space and time. I believe this refactoring >>> was >>> done to reduce the cardinality of classes having the "sv" >>> enum. >>> My recollection is that this, and other similar >>> "optimizations", >>> had a pretty substantial impact on link-time for Blanca. Unless >>> these are >>> hurting something else, I would tend to leave them in.

>>>> >>>>

Does the CodeSourcery CVS repository have complete >>>> CVS >>> history? (i.e. did we copy the repository, or just the head >>> version?) This >>> should have been easy to determine via CVS.

>>>> >>>>

        >>> SIZE=2>Jim >>>>

>>>> >>>>

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

>>>> >>>>

> -----Original Message----- >>>>
> From: Richard Guenther [>> HREF="mailto:rguenth at tat.physik.uni- >>> tuebingen.de">mailto:rguenth at tat.physik.uni-tuebingen.de] >>>>
> Sent: Tuesday, March 02, 2004 3:29 AM >>>>
> To: pooma-dev at pooma.codesourcery.com >>>>
> Cc: Jeffrey D. Oldham >>>>
> Subject: Re: [pooma-dev] AltView* >>>> classes >>>>
> >>>>
> On Tue, 2 Mar 2004, Richard Guenther >>> wrote: >>>>
> >>>>
> > On Fri, 27 Feb 2004, Richard Guenther >>> wrote: >>>>
> > >>>>
> > > Hi! >>>>
> > > >>>>
> > > Does anyone remember the exact >>>> reason >>> for the existance of the >>>>
> AltView* >>>>
> > > classes in Array.h and >>>> Field.h?  >>> Removing them and fixing their usage >>>>
> to >>>>
> > > use View* seems to work (full test >>>> with >>> gcc 3.3 and 3.4 in progress). >>>>
> > >>>>
> > Testing completed with no new >>> failures.  Would it be ok to remove those >>>>
> > AltView* classes? >>>>
> >>>>
> Which would be... >>>>
> >>>>
> Ok? >>>>
> >>>>
> Richard. >>>>
> >>>>
> >>>>
> 2004Mar02  Richard Guenther >>> <richard.guenther at uni-tuebingen.de> >>>>
> >>>>
>       * >>> src/Array/Array.h: remove all traces of AltView0 class. >>>>
>       >>>> src/Field/Field.h: >>> remove all traces of AltView1 and >>>>
>       >>> AltView1Implementation classes. >>>>
> >>>>
> ===== Array/Array.h 1.14 vs edited >>>> ===== >>>>
> --- 1.14/r2/src/Array/Array.h Tue Dec 16 >>>> 15:19:57 >>> 2003 >>>>
> +++ >>> edited/Array/Array.h      Tue Mar  2 >>> 11:24:14 2004 >>>>
> @@ -649,8 +649,6 @@ >>>>
>  // an existing engine cannot be any >>>> kind of >>> slice domain. >>>>
>  // Also, bounds checking would make no >>> sense because it would >>>>
>  // reduce to contains(a.domain(), >>> a.domain()); >>>>
> -// >>>>
> -// Any changes to this class should also be >>>> made >>> to AltView0. >>>>
> >>>>
>  template<int Dim, class T, class >>> EngineTag> >>>>
>  struct View0<Array<Dim, T, >>> EngineTag> > >>>>
> @@ -695,41 +693,6 @@ >>>>
>      } >>>>
>  }; >>>>
> >>>>
> -// AltView0 avoids an instantiation problem >>>> that >>> arises when two >>>>
> -// classes use each other.  This class's >>> definition should be exactly >>>>
> -// the same as View0 except omitting member >>> functions. >>>>
> -// >>>>
> -// Do NOT explicitly instantiate this >>> class. >>>>
> - >>>>
> -template<class ArrayTag> >>>>
> -struct AltView0; >>>>
> - >>>>
> -template<int Dim, class T, class >>> EngineTag> >>>>
> -struct AltView0<Array<Dim, T, >>> EngineTag> > >>>>
> -{ >>>>
> -  // Convenience typedef for the thing >>> we're taking a view of. >>>>
> - >>>>
> -  typedef Array<Dim, T, EngineTag> >>> Subject_t; >>>>
> - >>>>
> -  // Deduce domains for the output >>> type. >>>>
> -  // At some point, we need to fix >>> NewDomain1; until then, use >>>>
> -  // the temporary version from >>> Array.h. >>>>
> - >>>>
> -  typedef typename Subject_t::Engine_t >>> Engine_t; >>>>
> -  typedef typename Subject_t::Domain_t >>> Domain_t; >>>>
> - >>>>
> -  // Deduce the template parameters for >>>> the >>> output type. >>>>
> - >>>>
> -  typedef typename >>>> NewEngine<Engine_t, >>> Domain_t>::Type_t NewEngine_t; >>>>
> -  enum { newDim = >>>> NewEngine_t::dimensions >>> }; >>>>
> -  typedef typename NewEngine_t::Tag_t >>> NewEngineTag_t; >>>>
> - >>>>
> -  // The output types. >>>>
> - >>>>
> -  typedef Array<newDim, T, >>> NewEngineTag_t> Type_t; >>>>
> -  typedef Type_t ReadType_t; >>>>
> -}; >>>>
> - >>>>
>  template<int Dim, class T, class >>> EngineTag> >>>>
>  struct View1<Array<Dim, T, >>> EngineTag>, int> >>>>
>  { >>>>
> @@ -1864,7 +1827,7 @@ >>>>
>    /// A zero-argument version >>>> of >>> operator(), which takes a view of >>>>
>    /// array's domain, is also >>> supplied. >>>>
>    //@{ >>>>
> -  typename >>> AltView0<This_t>::ReadType_t >>>>
> +  typename >>> View0<This_t>::ReadType_t >>>>
>    read() const >>>>
>      { >>>>
>        >>>> typedef >>> View0<This_t> Ret_t; >>>>
> @@ -1934,7 +1897,7 @@ >>>>
>        >>>> return >>> Ret_t::makeRead(*this, s1, s2, s3, s4, s5, s6, s7); >>>>
>      } >>>>
> >>>>
> -  typename >>> AltView0<This_t>::Type_t >>>>
> +  typename >>> View0<This_t>::Type_t >>>>
>    operator()() const >>>>
>      { >>>>
>        >>>> typedef >>> View0<This_t> Ret_t; >>>>
> ===== Field/Field.h 1.14 vs edited >>>> ===== >>>>
> --- 1.14/r2/src/Field/Field.h Tue Dec 16 >>>> 15:20:00 >>> 2003 >>>>
> +++ >>> edited/Field/Field.h      Tue Mar  2 >>> 11:25:22 2004 >>>>
> @@ -269,9 +269,6 @@ >>>>
>   * View1Implementation<Field, D, >>> SV> specialization for indexing a field >>>>
>   * with a single domain. There is a >>> single-valued version (SV == true) >>>>
>   * and a multi-valued version (SV >>>> == >>> false). >>>>
> - * >>>>
> - * Any changes to View1Implementation should >>> also be made to >>>>
> - * AltView1Implementation. >>>>
>   */ >>>>
> >>>>
>  // Single-valued version. Handles >>>> scalars >>> and Locs. >>>>
> @@ -508,62 +505,7 @@ >>>>
> >>>>
> >>>>
>  /** >>>>
> - * AltView1Implementation avoids an >>> instantiation problem that arises >>>>
> when two >>>>
> - * classes use each other.  This class's >>> definition should be exactly >>>>
> - * the same as View1Implementation except >>> omitting member functions. >>>>
> - * >>>>
> - * Do NOT explicitly instantiate this >>> class. >>>>
> - */ >>>>
> - >>>>
> -// Single-valued version. Handles scalars and >>> Locs. >>>>
> - >>>>
> -template<class Subject, class Domain, bool >>> SV> >>>>
> -struct AltView1Implementation; >>>>
> - >>>>
> -template<class Mesh, class T, class >>> EngineTag, class Domain> >>>>
> -struct >>>> AltView1Implementation<Field<Mesh, >>> T, EngineTag>, Domain, true> >>>>
> -{ >>>>
> -  // Convenience typedef for the thing >>> we're taking a view of. >>>>
> - >>>>
> -  typedef Field<Mesh, T, >>>> EngineTag> >>> Subject_t; >>>>
> - >>>>
> -  // The return types are pretty simple >>> here. >>>>
> - >>>>
> -  typedef typename Subject_t::Element_t >>> ReadType_t; >>>>
> -  typedef typename >>>> Subject_t::ElementRef_t >>> Type_t; >>>>
> -}; >>>>
> - >>>>
> -template<class Mesh, class T, class >>> EngineTag, class Domain> >>>>
> -struct >>>> AltView1Implementation<Field<Mesh, >>> T, EngineTag>, Domain, false> >>>>
> -{ >>>>
> -  // Convenience typedef for the thing >>> we're taking a view of. >>>>
> - >>>>
> -  typedef Field<Mesh, T, >>>> EngineTag> >>> Subject_t; >>>>
> - >>>>
> -  // Deduce domains for the output >>> type. >>>>
> - >>>>
> -  typedef typename Subject_t::Engine_t >>> Engine_t; >>>>
> -  typedef typename >>>> NewEngine<Engine_t, >>> Domain>::Type_t NewEngine_t; >>>>
> -  typedef typename >>>> NewEngine_t::Element_t >>> NewT_t; >>>>
> -  typedef typename NewEngine_t::Tag_t >>> NewEngineTag_t; >>>>
> - >>>>
> -  // Deduce the new Mesh. >>>>
> - >>>>
> -  typedef typename >>>>
> -    >>> NewMeshTag<NewEngine_t::dimensions, Mesh, >>> Domain>::Type_t >>>>
> -      >>> NewMeshTag_t; >>>>
> - >>>>
> -  // The output types. >>>>
> - >>>>
> -  typedef Field<NewMeshTag_t, NewT_t, >>> NewEngineTag_t> ReadType_t; >>>>
> -  typedef Field<NewMeshTag_t, NewT_t, >>> NewEngineTag_t> Type_t; >>>>
> -}; >>>>
> - >>>>
> - >>>>
> -/** >>>>
>   * View1<Field, S1> >>> specialization for indexing a field with a single >>>>
> domain. >>>>
> - * >>>>
> - * Any changes to View1 should also be made >>>> to >>> AltView1. >>>>
>   */ >>>>
> >>>>
>  template<class Mesh, class T, class >>> EngineTag, class Sub1> >>>>
> @@ -613,8 +555,6 @@ >>>>
> >>>>
>  /** >>>>
>   * View1<Field, int> >>> specialization for indexing a field with an int. >>>>
> - * >>>>
> - * Any changes to View1 should also be made >>>> to >>> AltView1. >>>>
>   */ >>>>
> >>>>
>  template<class Mesh, class T, class >>> EngineTag> >>>>
> @@ -658,71 +598,6 @@ >>>>
> >>>>
> >>>>
>  /** >>>>
> - * AltView1 avoids an instantiation problem >>>> that >>> arises when two >>>>
> - * classes use each other.  This class's >>> definition should be exactly >>>>
> - * the same as View1 except omitting member >>> functions. >>>>
> - * >>>>
> - * Do NOT explicitly instantiate this >>> class. >>>>
> - */ >>>>
> - >>>>
> -template<class FieldTag, class >>> DomainTag> >>>>
> -struct AltView1; >>>>
> - >>>>
> -template<class Mesh, class T, class >>> EngineTag, class Sub1> >>>>
> -struct AltView1<Field<Mesh, T, >>> EngineTag>, Sub1> >>>>
> -{ >>>>
> -  // Convenience typedef for the thing >>> we're taking a view of. >>>>
> - >>>>
> -  typedef Field<Mesh, T, >>>> EngineTag> >>> Subject_t; >>>>
> - >>>>
> -  // Deduce domains for the output >>> type. >>>>
> -  // At some point, we need to fix >>> NewDomain1; until then, use >>>>
> -  // the temporary version from >>> NewDomain.h. >>>>
> - >>>>
> -  typedef typename Subject_t::Domain_t >>> Domain_t; >>>>
> -  typedef >>>> TemporaryNewDomain1<Domain_t, >>> Sub1> NewDomain_t; >>>>
> -  typedef typename >>>> NewDomain_t::SliceType_t >>> SDomain_t; >>>>
> - >>>>
> -  // Deduce appropriate version of >>> implementation to dispatch to. >>>>
> - >>>>
> -  enum { sv = >>> DomainTraits<SDomain_t>::singleValued }; >>>>
> -  typedef >>> AltView1Implementation<Subject_t, SDomain_t, sv> >>> Dispatch_t; >>>>
> - >>>>
> -  // The optimized domain >>>> combiner. >>>>
> - >>>>
> -  typedef >>>> CombineDomainOpt<NewDomain_t, >>> sv> Combine_t; >>>>
> - >>>>
> -  // The return types. >>>>
> - >>>>
> -  typedef typename >>>> Dispatch_t::ReadType_t >>> ReadType_t; >>>>
> -  typedef typename Dispatch_t::Type_t >>> Type_t; >>>>
> -}; >>>>
> - >>>>
> - >>>>
> -/** >>>>
> - * AltView1 avoids an instantiation problem >>>> that >>> arises when two >>>>
> - * classes use each other.  This class's >>> definition should be exactly >>>>
> - * the same as View1 except omitting member >>> functions. >>>>
> - * >>>>
> - * Do NOT explicitly instantiate this >>> class. >>>>
> - */ >>>>
> - >>>>
> -template<class Mesh, class T, class >>> EngineTag> >>>>
> -struct AltView1<Field<Mesh, T, >>> EngineTag>, int> >>>>
> -{ >>>>
> -  // Convenience typedef for the thing >>> we're taking a view of. >>>>
> - >>>>
> -  typedef Field<Mesh, T, >>>> EngineTag> >>> Subject_t; >>>>
> - >>>>
> -  // The return types. >>>>
> - >>>>
> -  typedef typename Subject_t::Element_t >>> ReadType_t; >>>>
> -  typedef typename >>>> Subject_t::ElementRef_t >>> Type_t; >>>>
> - >>>>
> -}; >>>>
> - >>>>
> - >>>>
> -/** >>>>
>   * View2<Field, S1, S2> >>> specialization for indexing a field with two >>>>
>   * domains. >>>>
>   */ >>>>
> @@ -1455,14 +1330,14 @@ >>>>
>    /// point fields the viewing >>> domain is an actual centering domain. >>>>
>    //@{ >>>>
> >>>>
> -  inline typename AltView1<This_t, >>> Domain_t>::ReadType_t >>>>
> +  inline typename View1<This_t, >>> Domain_t>::ReadType_t >>>>
>    read() const >>>>
>      { >>>>
>        >>>> typedef >>> View1<This_t, Domain_t> Ret_t; >>>>
>        >>>> return >>> Ret_t::makeRead(*this, physicalDomain()); >>>>
>      } >>>>
> >>>>
> -  inline typename AltView1<This_t, >>> Domain_t>::ReadType_t >>>>
> +  inline typename View1<This_t, >>> Domain_t>::ReadType_t >>>>
>    readAll() const >>>>
>      { >>>>
>        >>>> typedef >>> View1<This_t, Domain_t> Ret_t; >>>>
> @@ -1470,7 +1345,7 @@ >>>>
>      } >>>>
> >>>>
>    template<class >>> Sub1> >>>>
> -  inline typename AltView1<This_t, >>> Sub1>::ReadType_t >>>>
> +  inline typename View1<This_t, >>> Sub1>::ReadType_t >>>>
>    read(const Sub1 &s1) >>> const >>>>
>      { >>>>
>        >>>> typedef >>> View1<This_t, Sub1> Ret_t; >>>>
> @@ -1493,14 +1368,14 @@ >>>>
>        >>>> return >>> Ret_t::makeRead(*this, s1, s2, s3); >>>>
>      } >>>>
> >>>>
> -  inline typename AltView1<This_t, >>> Domain_t>::Type_t >>>>
> +  inline typename View1<This_t, >>> Domain_t>::Type_t >>>>
>    operator()() const >>>>
>      { >>>>
>        >>>> typedef >>> View1<This_t, Domain_t> Ret_t; >>>>
>        >>>> return >>> Ret_t::make(*this, physicalDomain()); >>>>
>      } >>>>
> >>>>
> -  inline typename AltView1<This_t, >>> Domain_t>::Type_t >>>>
> +  inline typename View1<This_t, >>> Domain_t>::Type_t >>>>
>    all() const >>>>
>      { >>>>
>        >>>> typedef >>> View1<This_t, Domain_t> Ret_t; >>>>
> @@ -1508,7 +1383,7 @@ >>>>
>      } >>>>
> >>>>
>    template<class >>> Sub1> >>>>
> -  inline typename AltView1<This_t, >>> Sub1>::Type_t >>>>
> +  inline typename View1<This_t, >>> Sub1>::Type_t >>>>
>    operator()(const Sub1 >>>> &s1) >>> const >>>>
>      { >>>>
>        >>>> typedef >>> View1<This_t, Sub1> Ret_t; >>>>

>>>> >>>> >>>> >> >> >> >> >> >> RE: [pooma-dev] AltView* classes >> >> >> >>

OK - cool. Thanks for chipping in Dave. You're >> neurons are obviously less rusty than mine. :) >>

>> >>

        Jim >>

>> >>

> SIZE=2>--------------------------------------------------------------- >> --------- >>
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: Dave Nystrom [> HREF="mailto:wdn at lanl.gov">mailto:wdn at lanl.gov] >>
> Sent: Tuesday, March 02, 2004 10:00 AM >>
> To: James Crotinger >>
> Cc: 'Richard Guenther'; >> 'pooma-dev at pooma.codesourcery.com'; 'Jeffrey D. >>
> Oldham'; John Hall; Dave Nystrom; Dave >> Nystrom >>
> Subject: RE: [pooma-dev] AltView* classes >>
> >>
> These AltView classes were put in by Jeffrey >> Oldham to fix a problem that >>
> I >>
> was having trying to explicitly instantiate all >> the Pooma classes and >>
> functions that Blanca code was using.  >> Basically, the way the Pooma 2 >>
> Field >>
> class was originally written, we were getting >> one of these "sv" enums >>
> instantiated for every unique expression which >> we had in our source code >>
> base.  I was unable to explicitly >> instantiate these "sv" enums the way the >>
> code was originally written because of some >> issue which Arch Robison of >>
> Kuck >>
> and Associates (now Intel) identified - >> basically the code in it's >>
> original >>
> form violated some corner case of the C++ >> standard according to Arch. >>
> Jeffrey fixed this problem by adding the >> AltView class and then I was able >>
> to >>
> perform the explicit instantiations that I >> needed. >>
> >>
> However, I believe Jeffrey or someone else has >> gone through the code and >>
> replaced the "sv" enums with some >> other construct which does not have the >>
> explicit instantiation difficulties that the >> "sv" enums had.  So, I think >>
> that it is probably okay to remove the AltView >> classes and that this would >>
> clean up the code considerably.  I may >> revisit all this explicit >>
> instantiation stuff sometime in the not to >> distant future on a hobby basis >>
> (weird hobby, huh) and if I encounter >> difficulties being able to >>
> explicitly >>
> instantiate anything, I could then raise it as >> an issue at that time. >>
> >>
> In summary, the AltView classes were added by >> Jeffrey to fix an explicit >>
> instantiation problem that I think no longer >> exists and I am in favor of >>
> now >>
> removing them in the interest of cleaning up >> the code as much as possible. >>
> >>
> -- >>
> Dave Nystrom  >>         >>         email: wdn at lanl.gov >>
> LANL X-2      >>         >>         phone: >> 505-667-7913     fax: 505-665-2227 >>
> >>
> James Crotinger writes: >>
>  > Hi Richard, >>
>  > >>
>  > This tickled a neuron the other day, >> but I couldn't recall the details. >>
>  > >>
>  > The AltView classes were put in to >> reduce link times and sizes for >>
> large >>
>  > codes. The classes that have enums >> end up having a link-time cost, both >>
> in >>
>  > space and time. I believe this >> refactoring was done to reduce the >>
>  > cardinality of classes having the >> "sv" enum. My recollection is that >>
> this, >>
>  > and other similar >> "optimizations", had a pretty substantial impact on >>
>  > link-time for Blanca. Unless these >> are hurting something else, I would >>
> tend >>
>  > to leave them in. >>
>  > >>
>  > Does the CodeSourcery CVS repository >> have complete CVS history? (i.e. >>
> did we >>
>  > copy the repository, or just the >> head version?) This should have been >>
> easy >>
>  > to determine via CVS. >>
>  > >>
>  >    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 [> HREF="mailto:rguenth at tat.physik.uni-tuebingen.de">mailto: >> rguenth at tat.physik.uni-tuebingen.de] >>
>  > > Sent: Tuesday, March 02, 2004 >> 3:29 AM >>
>  > > To: >> pooma-dev at pooma.codesourcery.com >>
>  > > Cc: Jeffrey D. Oldham >>
>  > > Subject: Re: [pooma-dev] >> AltView* classes >>
>  > > >>
>  > > On Tue, 2 Mar 2004, Richard >> Guenther wrote: >>
>  > > >>
>  > > > On Fri, 27 Feb 2004, >> Richard Guenther wrote: >>
>  > > > >>
>  > > > > Hi! >>
>  > > > > >>
>  > > > > Does anyone remember >> the exact reason for the existance of the >>
>  > > AltView* >>
>  > > > > classes in Array.h >> and Field.h?  Removing them and fixing their >>
> usage >>
>  > > to >>
>  > > > > use View* seems to >> work (full test with gcc 3.3 and 3.4 in >>
> progress). >>
>  > > > >>
>  > > > Testing completed with no >> new failures.  Would it be ok to remove >>
> those >>
>  > > > AltView* classes? >>
>  > > >>
>  > > Which would be... >>
>  > > >>
>  > > Ok? >>
>  > > >>
>  > > Richard. >>
>  > > >>
>  > > >>
>  > > 2004Mar02  Richard >> Guenther <richard.guenther at uni-tuebingen.de> >>
>  > > >>
>  > >  * src/Array/Array.h: >> remove all traces of AltView0 class. >>
>  > >  src/Field/Field.h: remove >> all traces of AltView1 and >>
>  > >  AltView1Implementation >> classes. >>
>  > > >>
>  > > ===== Array/Array.h 1.14 vs >> edited ===== >>
>  > > --- >> 1.14/r2/src/Array/Array.h    Tue Dec 16 15:19:57 >> 2003 >>
>  > > +++ edited/Array/Array.h Tue >> Mar  2 11:24:14 2004 >>
>  > > @@ -649,8 +649,6 @@ >>
>  > >  // an existing engine >> cannot be any kind of slice domain. >>
>  > >  // Also, bounds checking >> would make no sense because it would >>
>  > >  // reduce to >> contains(a.domain(), a.domain()); >>
>  > > -// >>
>  > > -// Any changes to this class >> should also be made to AltView0. >>
>  > > >>
>  > >  template<int Dim, >> class T, class EngineTag> >>
>  > >  struct >> View0<Array<Dim, T, EngineTag> > >>
>  > > @@ -695,41 +693,6 @@ >>
>  > >      >> } >>
>  > >  }; >>
>  > > >>
>  > > -// AltView0 avoids an >> instantiation problem that arises when two >>
>  > > -// classes use each >> other.  This class's definition should be >>
> exactly >>
>  > > -// the same as View0 except >> omitting member functions. >>
>  > > -// >>
>  > > -// Do NOT explicitly >> instantiate this class. >>
>  > > - >>
>  > > -template<class >> ArrayTag> >>
>  > > -struct AltView0; >>
>  > > - >>
>  > > -template<int Dim, class T, >> class EngineTag> >>
>  > > -struct >> AltView0<Array<Dim, T, EngineTag> > >>
>  > > -{ >>
>  > > -  // Convenience typedef >> for the thing we're taking a view of. >>
>  > > - >>
>  > > -  typedef Array<Dim, >> T, EngineTag> Subject_t; >>
>  > > - >>
>  > > -  // Deduce domains for >> the output type. >>
>  > > -  // At some point, we >> need to fix NewDomain1; until then, use >>
>  > > -  // the temporary >> version from Array.h. >>
>  > > - >>
>  > > -  typedef typename >> Subject_t::Engine_t Engine_t; >>
>  > > -  typedef typename >> Subject_t::Domain_t Domain_t; >>
>  > > - >>
>  > > -  // Deduce the template >> parameters for the output type. >>
>  > > - >>
>  > > -  typedef typename >> NewEngine<Engine_t, Domain_t>::Type_t >>
> NewEngine_t; >>
>  > > -  enum { newDim = >> NewEngine_t::dimensions }; >>
>  > > -  typedef typename >> NewEngine_t::Tag_t NewEngineTag_t; >>
>  > > - >>
>  > > -  // The output >> types. >>
>  > > - >>
>  > > -  typedef >> Array<newDim, T, NewEngineTag_t> Type_t; >>
>  > > -  typedef Type_t >> ReadType_t; >>
>  > > -}; >>
>  > > - >>
>  > >  template<int Dim, >> class T, class EngineTag> >>
>  > >  struct >> View1<Array<Dim, T, EngineTag>, int> >>
>  > >  { >>
>  > > @@ -1864,7 +1827,7 @@ >>
>  > >    /// A >> zero-argument version of operator(), which takes a view of >>
>  > >    /// array's >> domain, is also supplied. >>
>  > >    //@{ >>
>  > > -  typename >> AltView0<This_t>::ReadType_t >>
>  > > +  typename >> View0<This_t>::ReadType_t >>
>  > >    read() >> const >>
>  > >      >> { >>
>  > >> >        typedef >> View0<This_t> Ret_t; >>
>  > > @@ -1934,7 +1897,7 @@ >>
>  > >> >        return >> Ret_t::makeRead(*this, s1, s2, s3, s4, s5, s6, s7); >>
>  > >      >> } >>
>  > > >>
>  > > -  typename >> AltView0<This_t>::Type_t >>
>  > > +  typename >> View0<This_t>::Type_t >>
>  > >    operator()() >> const >>
>  > >      >> { >>
>  > >> >        typedef >> View0<This_t> Ret_t; >>
>  > > ===== Field/Field.h 1.14 vs >> edited ===== >>
>  > > --- >> 1.14/r2/src/Field/Field.h    Tue Dec 16 15:20:00 >> 2003 >>
>  > > +++ edited/Field/Field.h Tue >> Mar  2 11:25:22 2004 >>
>  > > @@ -269,9 +269,6 @@ >>
>  > >   * >> View1Implementation<Field, D, SV> specialization for indexing >> a >>
> field >>
>  > >   * with a single >> domain. There is a single-valued version (SV == >>
> true) >>
>  > >   * and a >> multi-valued version (SV == false). >>
>  > > - * >>
>  > > - * Any changes to >> View1Implementation should also be made to >>
>  > > - * >> AltView1Implementation. >>
>  > >   */ >>
>  > > >>
>  > >  // Single-valued version. >> Handles scalars and Locs. >>
>  > > @@ -508,62 +505,7 @@ >>
>  > > >>
>  > > >>
>  > >  /** >>
>  > > - * AltView1Implementation >> avoids an instantiation problem that >>
> arises >>
>  > > when two >>
>  > > - * classes use each >> other.  This class's definition should be >>
> exactly >>
>  > > - * the same as >> View1Implementation except omitting member functions. >>
>  > > - * >>
>  > > - * Do NOT explicitly >> instantiate this class. >>
>  > > - */ >>
>  > > - >>
>  > > -// Single-valued version. >> Handles scalars and Locs. >>
>  > > - >>
>  > > -template<class Subject, >> class Domain, bool SV> >>
>  > > -struct >> AltView1Implementation; >>
>  > > - >>
>  > > -template<class Mesh, class >> T, class EngineTag, class Domain> >>
>  > > -struct >> AltView1Implementation<Field<Mesh, T, EngineTag>, >> Domain, >>
> true> >>
>  > > -{ >>
>  > > -  // Convenience typedef >> for the thing we're taking a view of. >>
>  > > - >>
>  > > -  typedef Field<Mesh, >> T, EngineTag> Subject_t; >>
>  > > - >>
>  > > -  // The return types are >> pretty simple here. >>
>  > > - >>
>  > > -  typedef typename >> Subject_t::Element_t ReadType_t; >>
>  > > -  typedef typename >> Subject_t::ElementRef_t Type_t; >>
>  > > -}; >>
>  > > - >>
>  > > -template<class Mesh, class >> T, class EngineTag, class Domain> >>
>  > > -struct >> AltView1Implementation<Field<Mesh, T, EngineTag>, >> Domain, >>
> false> >>
>  > > -{ >>
>  > > -  // Convenience typedef >> for the thing we're taking a view of. >>
>  > > - >>
>  > > -  typedef Field<Mesh, >> T, EngineTag> Subject_t; >>
>  > > - >>
>  > > -  // Deduce domains for >> the output type. >>
>  > > - >>
>  > > -  typedef typename >> Subject_t::Engine_t Engine_t; >>
>  > > -  typedef typename >> NewEngine<Engine_t, Domain>::Type_t NewEngine_t; >>
>  > > -  typedef typename >> NewEngine_t::Element_t NewT_t; >>
>  > > -  typedef typename >> NewEngine_t::Tag_t NewEngineTag_t; >>
>  > > - >>
>  > > -  // Deduce the new >> Mesh. >>
>  > > - >>
>  > > -  typedef typename >>
>  > > -    >> NewMeshTag<NewEngine_t::dimensions, Mesh, >> Domain>::Type_t >>
>  > > -      >> NewMeshTag_t; >>
>  > > - >>
>  > > -  // The output >> types. >>
>  > > - >>
>  > > -  typedef >> Field<NewMeshTag_t, NewT_t, NewEngineTag_t> ReadType_t; >>
>  > > -  typedef >> Field<NewMeshTag_t, NewT_t, NewEngineTag_t> Type_t; >>
>  > > -}; >>
>  > > - >>
>  > > - >>
>  > > -/** >>
>  > >   * View1<Field, >> S1> specialization for indexing a field with a >>
> single >>
>  > > domain. >>
>  > > - * >>
>  > > - * Any changes to View1 should >> also be made to AltView1. >>
>  > >   */ >>
>  > > >>
>  > >  template<class Mesh, >> class T, class EngineTag, class Sub1> >>
>  > > @@ -613,8 +555,6 @@ >>
>  > > >>
>  > >  /** >>
>  > >   * View1<Field, >> int> specialization for indexing a field with an >>
> int. >>
>  > > - * >>
>  > > - * Any changes to View1 should >> also be made to AltView1. >>
>  > >   */ >>
>  > > >>
>  > >  template<class Mesh, >> class T, class EngineTag> >>
>  > > @@ -658,71 +598,6 @@ >>
>  > > >>
>  > > >>
>  > >  /** >>
>  > > - * AltView1 avoids an >> instantiation problem that arises when two >>
>  > > - * classes use each >> other.  This class's definition should be >>
> exactly >>
>  > > - * the same as View1 except >> omitting member functions. >>
>  > > - * >>
>  > > - * Do NOT explicitly >> instantiate this class. >>
>  > > - */ >>
>  > > - >>
>  > > -template<class FieldTag, >> class DomainTag> >>
>  > > -struct AltView1; >>
>  > > - >>
>  > > -template<class Mesh, class >> T, class EngineTag, class Sub1> >>
>  > > -struct >> AltView1<Field<Mesh, T, EngineTag>, Sub1> >>
>  > > -{ >>
>  > > -  // Convenience typedef >> for the thing we're taking a view of. >>
>  > > - >>
>  > > -  typedef Field<Mesh, >> T, EngineTag> Subject_t; >>
>  > > - >>
>  > > -  // Deduce domains for >> the output type. >>
>  > > -  // At some point, we >> need to fix NewDomain1; until then, use >>
>  > > -  // the temporary >> version from NewDomain.h. >>
>  > > - >>
>  > > -  typedef typename >> Subject_t::Domain_t Domain_t; >>
>  > > -  typedef >> TemporaryNewDomain1<Domain_t, Sub1> NewDomain_t; >>
>  > > -  typedef typename >> NewDomain_t::SliceType_t SDomain_t; >>
>  > > - >>
>  > > -  // Deduce appropriate >> version of implementation to dispatch to. >>
>  > > - >>
>  > > -  enum { sv = >> DomainTraits<SDomain_t>::singleValued }; >>
>  > > -  typedef >> AltView1Implementation<Subject_t, SDomain_t, sv> >>
> Dispatch_t; >>
>  > > - >>
>  > > -  // The optimized domain >> combiner. >>
>  > > - >>
>  > > -  typedef >> CombineDomainOpt<NewDomain_t, sv> Combine_t; >>
>  > > - >>
>  > > -  // The return >> types. >>
>  > > - >>
>  > > -  typedef typename >> Dispatch_t::ReadType_t ReadType_t; >>
>  > > -  typedef typename >> Dispatch_t::Type_t Type_t; >>
>  > > -}; >>
>  > > - >>
>  > > - >>
>  > > -/** >>
>  > > - * AltView1 avoids an >> instantiation problem that arises when two >>
>  > > - * classes use each >> other.  This class's definition should be >>
> exactly >>
>  > > - * the same as View1 except >> omitting member functions. >>
>  > > - * >>
>  > > - * Do NOT explicitly >> instantiate this class. >>
>  > > - */ >>
>  > > - >>
>  > > -template<class Mesh, class >> T, class EngineTag> >>
>  > > -struct >> AltView1<Field<Mesh, T, EngineTag>, int> >>
>  > > -{ >>
>  > > -  // Convenience typedef >> for the thing we're taking a view of. >>
>  > > - >>
>  > > -  typedef Field<Mesh, >> T, EngineTag> Subject_t; >>
>  > > - >>
>  > > -  // The return >> types. >>
>  > > - >>
>  > > -  typedef typename >> Subject_t::Element_t ReadType_t; >>
>  > > -  typedef typename >> Subject_t::ElementRef_t Type_t; >>
>  > > - >>
>  > > -}; >>
>  > > - >>
>  > > - >>
>  > > -/** >>
>  > >   * View2<Field, >> S1, S2> specialization for indexing a field with two >>
>  > >   * domains. >>
>  > >   */ >>
>  > > @@ -1455,14 +1330,14 @@ >>
>  > >    /// point >> fields the viewing domain is an actual centering domain. >>
>  > >    //@{ >>
>  > > >>
>  > > -  inline typename >> AltView1<This_t, Domain_t>::ReadType_t >>
>  > > +  inline typename >> View1<This_t, Domain_t>::ReadType_t >>
>  > >    read() >> const >>
>  > >      >> { >>
>  > >> >        typedef >> View1<This_t, Domain_t> Ret_t; >>
>  > >> >        return >> Ret_t::makeRead(*this, physicalDomain()); >>
>  > >      >> } >>
>  > > >>
>  > > -  inline typename >> AltView1<This_t, Domain_t>::ReadType_t >>
>  > > +  inline typename >> View1<This_t, Domain_t>::ReadType_t >>
>  > >    readAll() >> const >>
>  > >      >> { >>
>  > >> >        typedef >> View1<This_t, Domain_t> Ret_t; >>
>  > > @@ -1470,7 +1345,7 @@ >>
>  > >      >> } >>
>  > > >>
>  > >    >> template<class Sub1> >>
>  > > -  inline typename >> AltView1<This_t, Sub1>::ReadType_t >>
>  > > +  inline typename >> View1<This_t, Sub1>::ReadType_t >>
>  > >    read(const >> Sub1 &s1) const >>
>  > >      >> { >>
>  > >> >        typedef >> View1<This_t, Sub1> Ret_t; >>
>  > > @@ -1493,14 +1368,14 @@ >>
>  > >> >        return >> Ret_t::makeRead(*this, s1, s2, s3); >>
>  > >      >> } >>
>  > > >>
>  > > -  inline typename >> AltView1<This_t, Domain_t>::Type_t >>
>  > > +  inline typename >> View1<This_t, Domain_t>::Type_t >>
>  > >    operator()() >> const >>
>  > >      >> { >>
>  > >> >        typedef >> View1<This_t, Domain_t> Ret_t; >>
>  > >> >        return >> Ret_t::make(*this, physicalDomain()); >>
>  > >      >> } >>
>  > > >>
>  > > -  inline typename >> AltView1<This_t, Domain_t>::Type_t >>
>  > > +  inline typename >> View1<This_t, Domain_t>::Type_t >>
>  > >    all() >> const >>
>  > >      >> { >>
>  > >> >        typedef >> View1<This_t, Domain_t> Ret_t; >>
>  > > @@ -1508,7 +1383,7 @@ >>
>  > >      >> } >>
>  > > >>
>  > >    >> template<class Sub1> >>
>  > > -  inline typename >> AltView1<This_t, Sub1>::Type_t >>
>  > > +  inline typename >> View1<This_t, Sub1>::Type_t >>
>  > >    >> operator()(const Sub1 &s1) const >>
>  > >      >> { >>
>  > >> >        typedef >> View1<This_t, Sub1> Ret_t; >>
>  > <!DOCTYPE HTML PUBLIC >> "-//W3C//DTD HTML 3.2//EN"> >>
>  > <HTML> >>
>  > <HEAD> >>
>  > <META >> HTTP-EQUIV="Content-Type" CONTENT="text/html; >> charset=us-ascii"> >>
>  > <META NAME="Generator" >> CONTENT="MS Exchange Server version >>
> 5.5.2653.12"> >>
>  > <TITLE>RE: [pooma-dev] >> AltView* classes</TITLE> >>
>  > </HEAD> >>
>  > <BODY> >>
>  > >>
>  > <P><FONT SIZE=2>Hi >> Richard,</FONT> >>
>  > </P> >>
>  > >>
>  > <P><FONT SIZE=2>This >> tickled a neuron the other day, but I couldn't >>
> recall the details.</FONT> >>
>  > </P> >>
>  > >>
>  > <P><FONT SIZE=2>The >> AltView classes were put in to reduce link times >>
> and sizes for large codes. The classes that >> have enums end up having a >>
> link-time cost, both in space and time. I >> believe this refactoring was >>
> done to reduce the cardinality of classes >> having the &quot;sv&quot; enum. >>
> My recollection is that this, and other similar >> &quot;optimizations&quot;, >>
> had a pretty substantial impact on link-time >> for Blanca. Unless these are >>
> hurting something else, I would tend to leave >> them in. </FONT></P> >>
>  > >>
>  > <P><FONT SIZE=2>Does the >> CodeSourcery CVS repository have complete CVS >>
> history? (i.e. did we copy the repository, or >> just the head version?) This >>
> should have been easy to determine via CVS. >> </FONT></P> >>
>  > >>
>  > >> <P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; >> &nbsp; <FONT SIZE=2>Jim</FONT> >>
>  > </P> >>
>  > >>
>  > <P><FONT >> SIZE=2>-------------------------------------------------------> FONT> >>
> -----------------</FONT> >>
>  > <BR><FONT SIZE=2>James >> A. >>
> >> Crotinger&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; >> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp >>
> >> ;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& >> nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& >>
> nbsp;&nbsp;&nbsp; >> email:&nbsp;&nbsp;&nbsp;&nbsp; >> jimc at numerix.com</FONT> >>
>  > <BR><FONT >> SIZE=2>NumeriX, >>
> >> LLC&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& >> nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp >>
> >> ;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& >> nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& >>
> >> nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; >> &nbsp; phone:&nbsp; (505) 424- >>
> 4477 x104</FONT> >>
>  > <BR><FONT SIZE=2>2960 >> Rodeo Park Dr. W.</FONT> >>
>  > <BR><FONT SIZE=2>Santa >> Fe, NM 87505</FONT> >>
>  > <BR><FONT >> SIZE=2>&nbsp;</FONT> >>
>  > </P> >>
>  > >>
>  > <P><FONT SIZE=2>&gt; >> -----Original Message-----</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; From: Richard Guenther [<A >>
> HREF="> HREF="mailto:rguenth at tat.physik.uni-">mailto:rguenth at tat.physik.uni- >> >>
> tuebingen.de">> HREF="mailto:rguenth at tat.physik.uni-tuebingen.de">mailto: >> rguenth at tat.physik.uni-tuebingen.de</A>]</FONT>> FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; Sent: Tuesday, March 02, 2004 3:29 >> AM</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; To: >> pooma-dev at pooma.codesourcery.com</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; Cc: Jeffrey D. Oldham</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; Subject: Re: [pooma-dev] AltView* >> classes</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; </FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; On Tue, 2 Mar 2004, Richard Guenther >>
> wrote:</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; </FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; &gt; On Fri, 27 Feb 2004, Richard >> Guenther >>
> wrote:</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; &gt;</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; &gt; &gt; Hi!</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; &gt; &gt;</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; &gt; &gt; Does anyone remember the exact >> reason >>
> for the existance of the</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; AltView*</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; &gt; &gt; classes in Array.h and >> Field.h?&nbsp; >>
> Removing them and fixing their >> usage</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; to</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; &gt; &gt; use View* seems to work (full >> test with >>
> gcc 3.3 and 3.4 in >> progress).</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; &gt;</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; &gt; Testing completed with no new >>
> failures.&nbsp; Would it be ok to remove >> those</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; &gt; AltView* classes?</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; </FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; Which would be...</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; </FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; Ok?</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; </FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; Richard.</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; </FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; </FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; 2004Mar02&nbsp; Richard Guenther >>
> >> &lt;richard.guenther at uni-tuebingen.de&gt;</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; </FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; >> * >>
> src/Array/Array.h: remove all traces of >> AltView0 class.</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; >> src/Field/Field.h: >>
> remove all traces of AltView1 >> and</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; >> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; >>
> AltView1Implementation >> classes.</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; </FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; ===== Array/Array.h 1.14 vs edited >> =====</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; --- 1.14/r2/src/Array/Array.h Tue Dec 16 >> 15:19:57 >>
> 2003</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; +++ >>
> >> edited/Array/Array.h&nbsp;&nbsp;&nbsp;&nbsp;& >> nbsp; Tue Mar&nbsp; 2 >>
> 11:24:14 2004</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; @@ -649,8 +649,6 @@</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt;&nbsp; // an existing engine cannot be any kind >> of >>
> slice domain.</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt;&nbsp; // Also, bounds checking would make >> no >>
> sense because it would</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt;&nbsp; // reduce to contains(a.domain(), >>
> a.domain());</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -//</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -// Any changes to this class should also be >> made >>
> to AltView0.</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; </FONT> >>
>  > <BR><FONT >> SIZE=2>&gt;&nbsp; template&lt;int Dim, class T, >> class >>
> EngineTag&gt;</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt;&nbsp; struct View0&lt;Array&lt;Dim, >> T, >>
> EngineTag&gt; &gt;</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; @@ -695,41 +693,6 @@</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; >> }</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt;&nbsp; };</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; </FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -// AltView0 avoids an instantiation problem >> that >>
> arises when two</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -// classes use each other.&nbsp; This >> class's >>
> definition should be exactly</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -// the same as View0 except omitting >> member >>
> functions.</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -//</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -// Do NOT explicitly instantiate this >>
> class.</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -template&lt;class >> ArrayTag&gt;</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -struct AltView0;</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -template&lt;int Dim, class T, class >>
> EngineTag&gt;</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -struct AltView0&lt;Array&lt;Dim, >> T, >>
> EngineTag&gt; &gt;</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -{</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -&nbsp; // Convenience typedef for the >> thing >>
> we're taking a view of.</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -&nbsp; typedef Array&lt;Dim, T, >> EngineTag&gt; >>
> Subject_t;</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -&nbsp; // Deduce domains for the >> output >>
> type.</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -&nbsp; // At some point, we need to >> fix >>
> NewDomain1; until then, use</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -&nbsp; // the temporary version from >>
> Array.h.</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -&nbsp; typedef typename >> Subject_t::Engine_t >>
> Engine_t;</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -&nbsp; typedef typename >> Subject_t::Domain_t >>
> Domain_t;</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -&nbsp; // Deduce the template parameters for >> the >>
> output type.</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -&nbsp; typedef typename >> NewEngine&lt;Engine_t, >>
> Domain_t&gt;::Type_t >> NewEngine_t;</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -&nbsp; enum { newDim = >> NewEngine_t::dimensions >>
> };</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -&nbsp; typedef typename >> NewEngine_t::Tag_t >>
> NewEngineTag_t;</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -&nbsp; // The output >> types.</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -&nbsp; typedef Array&lt;newDim, T, >>
> NewEngineTag_t&gt; >> Type_t;</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -&nbsp; typedef Type_t >> ReadType_t;</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -};</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt;&nbsp; template&lt;int Dim, class T, >> class >>
> EngineTag&gt;</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt;&nbsp; struct View1&lt;Array&lt;Dim, >> T, >>
> EngineTag&gt;, >> int&gt;</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt;&nbsp; {</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; @@ -1864,7 +1827,7 @@</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt;&nbsp;&nbsp;&nbsp; /// A zero-argument >> version of >>
> operator(), which takes a view >> of</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt;&nbsp;&nbsp;&nbsp; /// array's domain, >> is also >>
> supplied.</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt;&nbsp;&nbsp;&nbsp; >> //@{</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -&nbsp; typename >>
> >> AltView0&lt;This_t&gt;::ReadType_t</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; +&nbsp; typename >>
> >> View0&lt;This_t&gt;::ReadType_t</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt;&nbsp;&nbsp;&nbsp; read() >> const</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; >> {</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; >> &nbsp;&nbsp; typedef >>
> View0&lt;This_t&gt; >> Ret_t;</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; @@ -1934,7 +1897,7 @@</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; >> &nbsp;&nbsp; return >>
> Ret_t::makeRead(*this, s1, s2, s3, s4, s5, s6, >> s7);</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; >> }</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; </FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -&nbsp; typename >>
> >> AltView0&lt;This_t&gt;::Type_t</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; +&nbsp; typename >>
> >> View0&lt;This_t&gt;::Type_t</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt;&nbsp;&nbsp;&nbsp; operator()() >> const</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; >> {</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; >> &nbsp;&nbsp; typedef >>
> View0&lt;This_t&gt; >> Ret_t;</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; ===== Field/Field.h 1.14 vs edited >> =====</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; --- 1.14/r2/src/Field/Field.h Tue Dec 16 >> 15:20:00 >>
> 2003</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; +++ >>
> >> edited/Field/Field.h&nbsp;&nbsp;&nbsp;&nbsp;& >> nbsp; Tue Mar&nbsp; 2 >>
> 11:25:22 2004</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; @@ -269,9 +269,6 @@</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt;&nbsp;&nbsp; * >> View1Implementation&lt;Field, D, >>
> SV&gt; specialization for indexing a >> field</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt;&nbsp;&nbsp; * with a single domain. There >> is a >>
> single-valued version (SV == >> true)</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt;&nbsp;&nbsp; * and a multi-valued version >> (SV == >>
> false).</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; - *</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; - * Any changes to View1Implementation >> should >>
> also be made to</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; - * AltView1Implementation.</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt;&nbsp;&nbsp; */</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; </FONT> >>
>  > <BR><FONT >> SIZE=2>&gt;&nbsp; // Single-valued version. Handles >> scalars >>
> and Locs.</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; @@ -508,62 +505,7 @@</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; </FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; </FONT> >>
>  > <BR><FONT >> SIZE=2>&gt;&nbsp; /**</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; - * AltView1Implementation avoids an >>
> instantiation problem that >> arises</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; when two</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; - * classes use each other.&nbsp; This >> class's >>
> definition should be exactly</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; - * the same as View1Implementation except >>
> omitting member functions.</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; - *</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; - * Do NOT explicitly instantiate this >>
> class.</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; - */</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -// Single-valued version. Handles scalars >> and >>
> Locs.</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -template&lt;class Subject, class Domain, >> bool >>
> SV&gt;</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -struct >> AltView1Implementation;</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -template&lt;class Mesh, class T, class >>
> EngineTag, class >> Domain&gt;</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -struct >> AltView1Implementation&lt;Field&lt;Mesh, >>
> T, EngineTag&gt;, Domain, >> true&gt;</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -{</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -&nbsp; // Convenience typedef for the >> thing >>
> we're taking a view of.</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -&nbsp; typedef Field&lt;Mesh, T, >> EngineTag&gt; >>
> Subject_t;</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -&nbsp; // The return types are pretty >> simple >>
> here.</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -&nbsp; typedef typename >> Subject_t::Element_t >>
> ReadType_t;</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -&nbsp; typedef typename >> Subject_t::ElementRef_t >>
> Type_t;</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -};</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -template&lt;class Mesh, class T, class >>
> EngineTag, class >> Domain&gt;</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -struct >> AltView1Implementation&lt;Field&lt;Mesh, >>
> T, EngineTag&gt;, Domain, >> false&gt;</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -{</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -&nbsp; // Convenience typedef for the >> thing >>
> we're taking a view of.</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -&nbsp; typedef Field&lt;Mesh, T, >> EngineTag&gt; >>
> Subject_t;</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -&nbsp; // Deduce domains for the >> output >>
> type.</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -&nbsp; typedef typename >> Subject_t::Engine_t >>
> Engine_t;</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -&nbsp; typedef typename >> NewEngine&lt;Engine_t, >>
> Domain&gt;::Type_t >> NewEngine_t;</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -&nbsp; typedef typename >> NewEngine_t::Element_t >>
> NewT_t;</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -&nbsp; typedef typename >> NewEngine_t::Tag_t >>
> NewEngineTag_t;</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -&nbsp; // Deduce the new >> Mesh.</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -&nbsp; typedef typename</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -&nbsp;&nbsp;&nbsp; >>
> NewMeshTag&lt;NewEngine_t::dimensions, >> Mesh, Domain&gt;::Type_t</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; >> -&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; >>
> NewMeshTag_t;</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -&nbsp; // The output >> types.</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -&nbsp; typedef Field&lt;NewMeshTag_t, >> NewT_t, >>
> NewEngineTag_t&gt; >> ReadType_t;</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -&nbsp; typedef Field&lt;NewMeshTag_t, >> NewT_t, >>
> NewEngineTag_t&gt; >> Type_t;</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -};</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -/**</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt;&nbsp;&nbsp; * View1&lt;Field, >> S1&gt; >>
> specialization for indexing a field with a >> single</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; domain.</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; - *</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; - * Any changes to View1 should also be made >> to >>
> AltView1.</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt;&nbsp;&nbsp; */</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; </FONT> >>
>  > <BR><FONT >> SIZE=2>&gt;&nbsp; template&lt;class Mesh, class T, >> class >>
> EngineTag, class >> Sub1&gt;</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; @@ -613,8 +555,6 @@</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; </FONT> >>
>  > <BR><FONT >> SIZE=2>&gt;&nbsp; /**</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt;&nbsp;&nbsp; * View1&lt;Field, >> int&gt; >>
> specialization for indexing a field with an >> int.</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; - *</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; - * Any changes to View1 should also be made >> to >>
> AltView1.</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt;&nbsp;&nbsp; */</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; </FONT> >>
>  > <BR><FONT >> SIZE=2>&gt;&nbsp; template&lt;class Mesh, class T, >> class >>
> EngineTag&gt;</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; @@ -658,71 +598,6 @@</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; </FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; </FONT> >>
>  > <BR><FONT >> SIZE=2>&gt;&nbsp; /**</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; - * AltView1 avoids an instantiation problem >> that >>
> arises when two</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; - * classes use each other.&nbsp; This >> class's >>
> definition should be exactly</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; - * the same as View1 except omitting >> member >>
> functions.</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; - *</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; - * Do NOT explicitly instantiate this >>
> class.</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; - */</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -template&lt;class FieldTag, class >>
> DomainTag&gt;</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -struct AltView1;</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -template&lt;class Mesh, class T, class >>
> EngineTag, class >> Sub1&gt;</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -struct AltView1&lt;Field&lt;Mesh, >> T, >>
> EngineTag&gt;, >> Sub1&gt;</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -{</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -&nbsp; // Convenience typedef for the >> thing >>
> we're taking a view of.</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -&nbsp; typedef Field&lt;Mesh, T, >> EngineTag&gt; >>
> Subject_t;</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -&nbsp; // Deduce domains for the >> output >>
> type.</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -&nbsp; // At some point, we need to >> fix >>
> NewDomain1; until then, use</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -&nbsp; // the temporary version from >>
> NewDomain.h.</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -&nbsp; typedef typename >> Subject_t::Domain_t >>
> Domain_t;</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -&nbsp; typedef >> TemporaryNewDomain1&lt;Domain_t, >>
> Sub1&gt; NewDomain_t;</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -&nbsp; typedef typename >> NewDomain_t::SliceType_t >>
> SDomain_t;</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -&nbsp; // Deduce appropriate version >> of >>
> implementation to dispatch >> to.</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -&nbsp; enum { sv = >>
> >> DomainTraits&lt;SDomain_t&gt;::singleValued >> };</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -&nbsp; typedef >>
> AltView1Implementation&lt;Subject_t, >> SDomain_t, sv&gt; Dispatch_t;</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -&nbsp; // The optimized domain >> combiner.</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -&nbsp; typedef >> CombineDomainOpt&lt;NewDomain_t, >>
> sv&gt; Combine_t;</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -&nbsp; // The return >> types.</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -&nbsp; typedef typename >> Dispatch_t::ReadType_t >>
> ReadType_t;</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -&nbsp; typedef typename >> Dispatch_t::Type_t >>
> Type_t;</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -};</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -/**</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; - * AltView1 avoids an instantiation problem >> that >>
> arises when two</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; - * classes use each other.&nbsp; This >> class's >>
> definition should be exactly</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; - * the same as View1 except omitting >> member >>
> functions.</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; - *</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; - * Do NOT explicitly instantiate this >>
> class.</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; - */</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -template&lt;class Mesh, class T, class >>
> EngineTag&gt;</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -struct AltView1&lt;Field&lt;Mesh, >> T, >>
> EngineTag&gt;, >> int&gt;</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -{</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -&nbsp; // Convenience typedef for the >> thing >>
> we're taking a view of.</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -&nbsp; typedef Field&lt;Mesh, T, >> EngineTag&gt; >>
> Subject_t;</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -&nbsp; // The return >> types.</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -&nbsp; typedef typename >> Subject_t::Element_t >>
> ReadType_t;</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -&nbsp; typedef typename >> Subject_t::ElementRef_t >>
> Type_t;</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -};</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -/**</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt;&nbsp;&nbsp; * View2&lt;Field, S1, >> S2&gt; >>
> specialization for indexing a field with >> two</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt;&nbsp;&nbsp; * domains.</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt;&nbsp;&nbsp; */</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; @@ -1455,14 +1330,14 @@</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt;&nbsp;&nbsp;&nbsp; /// point fields the >> viewing >>
> domain is an actual centering >> domain.</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt;&nbsp;&nbsp;&nbsp; >> //@{</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; </FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -&nbsp; inline typename >> AltView1&lt;This_t, >>
> Domain_t&gt;::ReadType_t</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; +&nbsp; inline typename >> View1&lt;This_t, >>
> Domain_t&gt;::ReadType_t</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt;&nbsp;&nbsp;&nbsp; read() >> const</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; >> {</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; >> &nbsp;&nbsp; typedef >>
> View1&lt;This_t, Domain_t&gt; >> Ret_t;</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; >> &nbsp;&nbsp; return >>
> Ret_t::makeRead(*this, >> physicalDomain());</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; >> }</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; </FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -&nbsp; inline typename >> AltView1&lt;This_t, >>
> Domain_t&gt;::ReadType_t</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; +&nbsp; inline typename >> View1&lt;This_t, >>
> Domain_t&gt;::ReadType_t</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt;&nbsp;&nbsp;&nbsp; readAll() >> const</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; >> {</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; >> &nbsp;&nbsp; typedef >>
> View1&lt;This_t, Domain_t&gt; >> Ret_t;</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; @@ -1470,7 +1345,7 @@</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; >> }</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; </FONT> >>
>  > <BR><FONT >> SIZE=2>&gt;&nbsp;&nbsp;&nbsp; >> template&lt;class >>
> Sub1&gt;</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -&nbsp; inline typename >> AltView1&lt;This_t, >>
> Sub1&gt;::ReadType_t</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; +&nbsp; inline typename >> View1&lt;This_t, >>
> Sub1&gt;::ReadType_t</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt;&nbsp;&nbsp;&nbsp; read(const Sub1 >> &amp;s1) >>
> const</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; >> {</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; >> &nbsp;&nbsp; typedef >>
> View1&lt;This_t, Sub1&gt; >> Ret_t;</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; @@ -1493,14 +1368,14 @@</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; >> &nbsp;&nbsp; return >>
> Ret_t::makeRead(*this, s1, s2, >> s3);</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; >> }</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; </FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -&nbsp; inline typename >> AltView1&lt;This_t, >>
> Domain_t&gt;::Type_t</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; +&nbsp; inline typename >> View1&lt;This_t, >>
> Domain_t&gt;::Type_t</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt;&nbsp;&nbsp;&nbsp; operator()() >> const</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; >> {</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; >> &nbsp;&nbsp; typedef >>
> View1&lt;This_t, Domain_t&gt; >> Ret_t;</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; >> &nbsp;&nbsp; return >>
> Ret_t::make(*this, >> physicalDomain());</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; >> }</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; </FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -&nbsp; inline typename >> AltView1&lt;This_t, >>
> Domain_t&gt;::Type_t</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; +&nbsp; inline typename >> View1&lt;This_t, >>
> Domain_t&gt;::Type_t</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt;&nbsp;&nbsp;&nbsp; all() >> const</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; >> {</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; >> &nbsp;&nbsp; typedef >>
> View1&lt;This_t, Domain_t&gt; >> Ret_t;</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; @@ -1508,7 +1383,7 @@</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; >> }</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; </FONT> >>
>  > <BR><FONT >> SIZE=2>&gt;&nbsp;&nbsp;&nbsp; >> template&lt;class >>
> Sub1&gt;</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; -&nbsp; inline typename >> AltView1&lt;This_t, >>
> Sub1&gt;::Type_t</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt; +&nbsp; inline typename >> View1&lt;This_t, >>
> Sub1&gt;::Type_t</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt;&nbsp;&nbsp;&nbsp; operator()(const >> Sub1 &amp;s1) >>
> const</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; >> {</FONT> >>
>  > <BR><FONT >> SIZE=2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; >> &nbsp;&nbsp; typedef >>
> View1&lt;This_t, Sub1&gt; >> Ret_t;</FONT> >>
>  > </P> >>
>  > >>
>  > </BODY> >>
>  > </HTML> >>

>> >> >> From jhall at swcp.com Tue Mar 2 17:38:51 2004 From: jhall at swcp.com (John H. Hall) Date: Tue, 2 Mar 2004 10:38:51 -0700 Subject: Releasing Blanca Demo In-Reply-To: <4044C25B.6030001@tat.physik.uni-tuebingen.de> References: <16452.49542.996541.986692@bedell.lanl.gov> <4044C25B.6030001@tat.physik.uni-tuebingen.de> Message-ID: <78561879-6C70-11D8-95A7-000A958E5012@swcp.com> Richard: We are working on it. I am the bottleneck right now, but there will be a lot more bottlenecks before we get it transferred out of the laboratory. John Hall On Mar 2, 2004, at 10:20 AM, Richard Guenther wrote: > Dave Nystrom wrote: >> No problem. I think my neurons are less rusty because of my perverse >> hobby:-). I've actually compiled the Blanca Demo stuff in the last >> year and >> I try to keep up with evolution of Pooma 2 with the thought that I >> will >> sometime get back to using it. John, Don and Jean have actually been >> doing >> some work on the source code base in the last year. >> Also, the Blanca Demo project and it's progeny is the only Blanca >> related >> source code base that to my knowledge ever used Pooma 2. And >> supposedly, the >> Blanca project is dead and unlikely to use anything that we ever did. > > I suppose it is not possible to "release" some of this demo code, if > not for "educating of Pooma2" purpose? > > Thanks, > Richard. From wdn at lanl.gov Tue Mar 2 17:42:31 2004 From: wdn at lanl.gov (Dave Nystrom) Date: Tue, 2 Mar 2004 10:42:31 -0700 Subject: [pooma-dev] AltView* classes In-Reply-To: <4044C25B.6030001@tat.physik.uni-tuebingen.de> References: <16452.49542.996541.986692@bedell.lanl.gov> <4044C25B.6030001@tat.physik.uni-tuebingen.de> Message-ID: <16452.51079.577876.213313@bedell.lanl.gov> Hi Richard, John Hall would be the person to discuss this with since he knows more about the process of getting software at LANL released or open sourced. Could you comment on this John? Richard Guenther writes: > Dave Nystrom wrote: > > No problem. I think my neurons are less rusty because of my perverse > > hobby:-). I've actually compiled the Blanca Demo stuff in the last year and > > I try to keep up with evolution of Pooma 2 with the thought that I will > > sometime get back to using it. John, Don and Jean have actually been doing > > some work on the source code base in the last year. > > > > Also, the Blanca Demo project and it's progeny is the only Blanca related > > source code base that to my knowledge ever used Pooma 2. And supposedly, the > > Blanca project is dead and unlikely to use anything that we ever did. > > I suppose it is not possible to "release" some of this demo code, if not > for "educating of Pooma2" purpose? > > Thanks, > Richard. > -- Dave Nystrom email: wdn at lanl.gov LANL X-2 phone: 505-667-7913 fax: 505-665-2227 From wdn at lanl.gov Tue Mar 2 17:43:57 2004 From: wdn at lanl.gov (Dave Nystrom) Date: Tue, 2 Mar 2004 10:43:57 -0700 Subject: [pooma-dev] AltView* classes In-Reply-To: <16452.51079.577876.213313@bedell.lanl.gov> References: <16452.49542.996541.986692@bedell.lanl.gov> <4044C25B.6030001@tat.physik.uni-tuebingen.de> <16452.51079.577876.213313@bedell.lanl.gov> Message-ID: <16452.51165.520668.554904@bedell.lanl.gov> Dave Nystrom writes: > Hi Richard, > > John Hall would be the person to discuss this with since he knows more about > the process of getting software at LANL released or open sourced. > > Could you comment on this John? And I guess he did. > Richard Guenther writes: > > Dave Nystrom wrote: > > > No problem. I think my neurons are less rusty because of my perverse > > > hobby:-). I've actually compiled the Blanca Demo stuff in the last year and > > > I try to keep up with evolution of Pooma 2 with the thought that I will > > > sometime get back to using it. John, Don and Jean have actually been doing > > > some work on the source code base in the last year. > > > > > > Also, the Blanca Demo project and it's progeny is the only Blanca related > > > source code base that to my knowledge ever used Pooma 2. And supposedly, the > > > Blanca project is dead and unlikely to use anything that we ever did. > > > > I suppose it is not possible to "release" some of this demo code, if not > > for "educating of Pooma2" purpose? > > > > Thanks, > > Richard. > > > > -- > Dave Nystrom email: wdn at lanl.gov > LANL X-2 phone: 505-667-7913 fax: 505-665-2227 > -- Dave Nystrom email: wdn at lanl.gov LANL X-2 phone: 505-667-7913 fax: 505-665-2227 From rguenth at tat.physik.uni-tuebingen.de Mon Mar 15 10:28:26 2004 From: rguenth at tat.physik.uni-tuebingen.de (Richard Guenther) Date: Mon, 15 Mar 2004 11:28:26 +0100 (CET) Subject: [PATCH] Add missing #includes Message-ID: Hi! A first step cleaning up #includes. Makes more headers pass generation of a precompiled header. Next step is to remove unnecessary #includes. Ok? Richard. 2004Mar15 Richard Guenther * src/Domain/DomainMap.h: add missing #include. src/Domain/NewDomain.h: likewise. src/Evaluator/MultiArgEvaluator.h: likewise. src/Evaluator/MultiArgKernel.h: likewise. src/Evaluator/SimpleIntersector.h: likewise. src/Functions/MultiArg.h: likewise. Index: Domain/DomainMap.h =================================================================== RCS file: /home/pooma/Repository/r2/src/Domain/DomainMap.h,v retrieving revision 1.20 diff -u -u -r1.20 DomainMap.h --- Domain/DomainMap.h 10 Oct 2003 19:26:43 -0000 1.20 +++ Domain/DomainMap.h 15 Mar 2004 10:24:10 -0000 @@ -58,6 +58,7 @@ #include #include #include +#include /////////////////////////////////////////////////////////////////////////////// Index: Domain/NewDomain.h =================================================================== RCS file: /home/pooma/Repository/r2/src/Domain/NewDomain.h,v retrieving revision 1.34 diff -u -u -r1.34 NewDomain.h --- Domain/NewDomain.h 12 Oct 2003 11:14:38 -0000 1.34 +++ Domain/NewDomain.h 15 Mar 2004 10:24:12 -0000 @@ -65,6 +65,7 @@ #include "Domain/DomainTraits.h" #include "Utilities/PAssert.h" +#include "Utilities/NoInit.h" //----------------------------------------------------------------------------- // Forward Declarations: Index: Evaluator/MultiArgEvaluator.h =================================================================== RCS file: /home/pooma/Repository/r2/src/Evaluator/MultiArgEvaluator.h,v retrieving revision 1.14 diff -u -u -r1.14 MultiArgEvaluator.h --- Evaluator/MultiArgEvaluator.h 21 Nov 2003 17:36:10 -0000 1.14 +++ Evaluator/MultiArgEvaluator.h 15 Mar 2004 10:24:14 -0000 @@ -64,6 +64,8 @@ //----------------------------------------------------------------------------- #include "Engine/Intersector.h" +#include "Evaluator/EvaluatorTags.h" +#include "Evaluator/RequestLocks.h" #include "Evaluator/MultiArgKernel.h" #include "Evaluator/SimpleIntersector.h" #include "Evaluator/ScalarCodeInfo.h" Index: Evaluator/MultiArgKernel.h =================================================================== RCS file: /home/pooma/Repository/r2/src/Evaluator/MultiArgKernel.h,v retrieving revision 1.3 diff -u -u -r1.3 MultiArgKernel.h --- Evaluator/MultiArgKernel.h 22 Oct 2003 20:43:26 -0000 1.3 +++ Evaluator/MultiArgKernel.h 15 Mar 2004 10:24:14 -0000 @@ -61,8 +61,10 @@ //----------------------------------------------------------------------------- #include "Engine/EngineFunctor.h" +#include "Evaluator/RequestLocks.h" #include "Evaluator/LoopApply.h" #include "Functions/MultiArg.h" +#include //----------------------------------------------------------------------------- // Forward Declarations: Index: Evaluator/SimpleIntersector.h =================================================================== RCS file: /home/pooma/Repository/r2/src/Evaluator/SimpleIntersector.h,v retrieving revision 1.6 diff -u -u -r1.6 SimpleIntersector.h --- Evaluator/SimpleIntersector.h 22 Oct 2003 20:43:26 -0000 1.6 +++ Evaluator/SimpleIntersector.h 15 Mar 2004 10:24:15 -0000 @@ -55,10 +55,16 @@ //----------------------------------------------------------------------------- #include "Engine/EngineFunctor.h" +#include "Layout/INode.h" +#include "Utilities/RefCounted.h" +#include "Utilities/RefCountedPtr.h" //----------------------------------------------------------------------------- // Forward Declarations: //----------------------------------------------------------------------------- + +template +class MultiPatchView; //----------------------------------------------------------------------------- // Index: Functions/MultiArg.h =================================================================== RCS file: /home/pooma/Repository/r2/src/Functions/MultiArg.h,v retrieving revision 1.9 diff -u -u -r1.9 MultiArg.h --- Functions/MultiArg.h 25 Oct 2003 12:06:55 -0000 1.9 +++ Functions/MultiArg.h 15 Mar 2004 10:24:16 -0000 @@ -70,6 +70,7 @@ //----------------------------------------------------------------------------- #include "Pooma/View.h" +#include //----------------------------------------------------------------------------- // Forward Declarations: From jcrotinger at proximation.com Mon Mar 15 13:52:45 2004 From: jcrotinger at proximation.com (James Crotinger) Date: Mon, 15 Mar 2004 06:52:45 -0700 Subject: [pooma-dev] [PATCH] Add missing #includes Message-ID: Hi Richard, If you add you should remove , though it is generally better to use the latter in a header if it only needs references (on some platforms, unnecessary includes of iostream have made significant differences in compile speed, and at one point, including was verboten in public header files, though I think this decision was ultimately abandoned). 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: Monday, March 15, 2004 3:28 AM > To: pooma-dev at pooma.codesourcery.com > Cc: Jeffrey D. Oldham > Subject: [pooma-dev] [PATCH] Add missing #includes > > Hi! > > A first step cleaning up #includes. Makes more headers pass generation of > a precompiled header. Next step is to remove unnecessary #includes. > > Ok? > > Richard. > > > 2004Mar15 Richard Guenther > > * src/Domain/DomainMap.h: add missing #include. > src/Domain/NewDomain.h: likewise. > src/Evaluator/MultiArgEvaluator.h: likewise. > src/Evaluator/MultiArgKernel.h: likewise. > src/Evaluator/SimpleIntersector.h: likewise. > src/Functions/MultiArg.h: likewise. > > Index: Domain/DomainMap.h > =================================================================== > RCS file: /home/pooma/Repository/r2/src/Domain/DomainMap.h,v > retrieving revision 1.20 > diff -u -u -r1.20 DomainMap.h > --- Domain/DomainMap.h 10 Oct 2003 19:26:43 -0000 1.20 > +++ Domain/DomainMap.h 15 Mar 2004 10:24:10 -0000 > @@ -58,6 +58,7 @@ > #include > #include > #include > +#include > > > > ////////////////////////////////////////////////////////////////////////// > ///// > Index: Domain/NewDomain.h > =================================================================== > RCS file: /home/pooma/Repository/r2/src/Domain/NewDomain.h,v > retrieving revision 1.34 > diff -u -u -r1.34 NewDomain.h > --- Domain/NewDomain.h 12 Oct 2003 11:14:38 -0000 1.34 > +++ Domain/NewDomain.h 15 Mar 2004 10:24:12 -0000 > @@ -65,6 +65,7 @@ > > #include "Domain/DomainTraits.h" > #include "Utilities/PAssert.h" > +#include "Utilities/NoInit.h" > > //----------------------------------------------------------------------- > ------ > // Forward Declarations: > Index: Evaluator/MultiArgEvaluator.h > =================================================================== > RCS file: /home/pooma/Repository/r2/src/Evaluator/MultiArgEvaluator.h,v > retrieving revision 1.14 > diff -u -u -r1.14 MultiArgEvaluator.h > --- Evaluator/MultiArgEvaluator.h 21 Nov 2003 17:36:10 -0000 1.14 > +++ Evaluator/MultiArgEvaluator.h 15 Mar 2004 10:24:14 -0000 > @@ -64,6 +64,8 @@ > //----------------------------------------------------------------------- > ------ > > #include "Engine/Intersector.h" > +#include "Evaluator/EvaluatorTags.h" > +#include "Evaluator/RequestLocks.h" > #include "Evaluator/MultiArgKernel.h" > #include "Evaluator/SimpleIntersector.h" > #include "Evaluator/ScalarCodeInfo.h" > Index: Evaluator/MultiArgKernel.h > =================================================================== > RCS file: /home/pooma/Repository/r2/src/Evaluator/MultiArgKernel.h,v > retrieving revision 1.3 > diff -u -u -r1.3 MultiArgKernel.h > --- Evaluator/MultiArgKernel.h 22 Oct 2003 20:43:26 -0000 1.3 > +++ Evaluator/MultiArgKernel.h 15 Mar 2004 10:24:14 -0000 > @@ -61,8 +61,10 @@ > //----------------------------------------------------------------------- > ------ > > #include "Engine/EngineFunctor.h" > +#include "Evaluator/RequestLocks.h" > #include "Evaluator/LoopApply.h" > #include "Functions/MultiArg.h" > +#include > > //----------------------------------------------------------------------- > ------ > // Forward Declarations: > Index: Evaluator/SimpleIntersector.h > =================================================================== > RCS file: /home/pooma/Repository/r2/src/Evaluator/SimpleIntersector.h,v > retrieving revision 1.6 > diff -u -u -r1.6 SimpleIntersector.h > --- Evaluator/SimpleIntersector.h 22 Oct 2003 20:43:26 -0000 1.6 > +++ Evaluator/SimpleIntersector.h 15 Mar 2004 10:24:15 -0000 > @@ -55,10 +55,16 @@ > //----------------------------------------------------------------------- > ------ > > #include "Engine/EngineFunctor.h" > +#include "Layout/INode.h" > +#include "Utilities/RefCounted.h" > +#include "Utilities/RefCountedPtr.h" > > //----------------------------------------------------------------------- > ------ > // Forward Declarations: > //----------------------------------------------------------------------- > ------ > + > +template > +class MultiPatchView; > > //----------------------------------------------------------------------- > ------ > // > Index: Functions/MultiArg.h > =================================================================== > RCS file: /home/pooma/Repository/r2/src/Functions/MultiArg.h,v > retrieving revision 1.9 > diff -u -u -r1.9 MultiArg.h > --- Functions/MultiArg.h 25 Oct 2003 12:06:55 -0000 1.9 > +++ Functions/MultiArg.h 15 Mar 2004 10:24:16 -0000 > @@ -70,6 +70,7 @@ > //----------------------------------------------------------------------- > ------ > > #include "Pooma/View.h" > +#include > > //----------------------------------------------------------------------- > ------ > // Forward Declarations: -------------- next part -------------- An HTML attachment was scrubbed... URL: From rguenth at tat.physik.uni-tuebingen.de Tue Mar 23 09:07:18 2004 From: rguenth at tat.physik.uni-tuebingen.de (Richard Guenther) Date: Tue, 23 Mar 2004 10:07:18 +0100 (CET) Subject: [PATCH] Another PrintField tweak Message-ID: Hi! This allows more cases of expression printing, like pinfo << 2.0*a; or more complex expressions. The problem was the PerformPrintField::print(*this, s, a.subField(m, c)); call in the PrintField::print() method and the prototype for the PerformPrinfField::print method without a suitable auto-conversion from the result type of a.subField(m, c) back to A. Fixed by effectively removing the Metrowerks workaround and templating the member of PerformPrintField on A, S, rather than PerformPrintField itself. The workaround is from 12-Aug-99, so the compiler had rather been fixed until now. The PrintArray counterpart works (including the same workaround), because we don't take subfield-views here and the types can match exactly. Ok? Richard. 2004Mar23 Richard Guenther * src/Field/PrintField.h: template PerformPrintField on Dim only, template member on stream and field instead. ===== PrintField.h 1.4 vs edited ===== --- 1.4/r2/src/Field/PrintField.h Thu Jan 29 12:01:39 2004 +++ edited/PrintField.h Tue Mar 23 09:58:02 2004 @@ -71,23 +71,24 @@ /** * PerformPrintField struct: a simple wrapper around the templated 'print' - * method of PrintField. This is here as a workaround to a Metrowerks - * problem that prevents having templated member functions defined as - * out-of-line. This struct defines one static method 'print', which + * method of PrintField. + * This struct defines one static method 'print', which * prints an field to a stream (the two template parameters). The Dim * parameter is used to specialize this to the case of a 1D domain. This is * called by the 'print' templated member function of PrintField. */ -template +template struct PerformPrintField { + template static void print(const PrintField &, S &, const A &); }; -template -struct PerformPrintField +template<> +struct PerformPrintField<1> { + template static void print(const PrintField &, S &, const A &); }; @@ -239,7 +240,7 @@ { s << "Material #" << m << ", Centering #" << c << " " << a.centering(c) << "\n"<< "-------------\n"; - PerformPrintField::print(*this, s, a.subField(m, c)); + PerformPrintField::print(*this, s, a.subField(m, c)); } } @@ -375,7 +376,7 @@ template void -PerformPrintField::print(const PrintField &p, S &s, const A &a) +PerformPrintField<1>::print(const PrintField &p, S &s, const A &a) { // make sure this is the right function @@ -459,9 +460,10 @@ */ //----------------------------------------------------------------------------- -template +template +template void -PerformPrintField::print(const PrintField &p, S &s, const A &a) +PerformPrintField::print(const PrintField &p, S &s, const A &a) { int i, j, k; From rguenth at tat.physik.uni-tuebingen.de Tue Mar 23 09:10:57 2004 From: rguenth at tat.physik.uni-tuebingen.de (Richard Guenther) Date: Tue, 23 Mar 2004 10:10:57 +0100 (CET) Subject: [PATCH] AltComponentView Message-ID: Hi! Forgot that last time. Ok? Richard. 2004Mar23 Richard Guenther * src/Array/Array.h: remove AltComponentView. ===== Array/Array.h 1.6 vs edited ===== --- 1.6/r2/src/Array/Array.h Tue Nov 25 16:39:01 2003 +++ edited/Array/Array.h Tue Mar 23 10:09:11 2004 @@ -649,8 +649,6 @@ // an existing engine cannot be any kind of slice domain. // Also, bounds checking would make no sense because it would // reduce to contains(a.domain(), a.domain()); -// -// Any changes to this class should also be made to AltView0. template struct View0 > @@ -695,41 +693,6 @@ } }; -// AltView0 avoids an instantiation problem that arises when two -// classes use each other. This class's definition should be exactly -// the same as View0 except omitting member functions. -// -// Do NOT explicitly instantiate this class. - -template -struct AltView0; - -template -struct AltView0 > -{ - // Convenience typedef for the thing we're taking a view of. - - typedef Array Subject_t; - - // Deduce domains for the output type. - // At some point, we need to fix NewDomain1; until then, use - // the temporary version from Array.h. - - typedef typename Subject_t::Engine_t Engine_t; - typedef typename Subject_t::Domain_t Domain_t; - - // Deduce the template parameters for the output type. - - typedef typename NewEngine::Type_t NewEngine_t; - enum { newDim = NewEngine_t::dimensions }; - typedef typename NewEngine_t::Tag_t NewEngineTag_t; - - // The output types. - - typedef Array Type_t; - typedef Type_t ReadType_t; -}; - template struct View1, int> { @@ -1322,7 +1285,6 @@ /** * ComponentView specialization for Array. - * Changes to ComponentView should also be made to AltComponentView. */ template @@ -1358,36 +1320,6 @@ } }; -/** - * AltComponentView avoids an instantiation problem that arises when - * two classes use each other. These classes' definitions should be - * exactly the same as ComponentView except omitting member functions. - * - * Do NOT explicitly instantiate these alternative classes. - */ - -template -struct AltComponentView; - -template -struct AltComponentView > -{ - // Convenience typedef for the thing we're taking a component view of. - - typedef Array Subject_t; - - // Deduce the template parameters for the output type. - - typedef typename Subject_t::Element_t Element_t; - typedef typename Subject_t::Engine_t Engine_t; - typedef typename ComponentAccess::Element_t NewT_t; - typedef CompFwd NewEngineTag_t; - - // The output type. - - typedef Array Type_t; -}; - //----------------------------------------------------------------------------- // Array //----------------------------------------------------------------------------- @@ -1863,7 +1795,7 @@ /// A zero-argument version of operator(), which takes a view of /// array's domain, is also supplied. //@{ - typename AltView0::ReadType_t + typename View0::ReadType_t read() const { typedef View0 Ret_t; @@ -1933,7 +1865,7 @@ return Ret_t::makeRead(*this, s1, s2, s3, s4, s5, s6, s7); } - typename AltView0::Type_t + typename View0::Type_t operator()() const { typedef View0 Ret_t; @@ -2014,46 +1946,46 @@ /// ultimately work, Element_t must have a working const operator()(Loc) /// that returns a reference or proxy to the component. //@{ - inline typename AltComponentView, This_t>::Type_t + inline typename ComponentView, This_t>::Type_t comp(const int &i1) const { return ComponentView, This_t>::make(*this, Loc<1>(i1)); } - inline typename AltComponentView, This_t>::Type_t + inline typename ComponentView, This_t>::Type_t comp(int i1, int i2) const { return ComponentView, This_t>::make(*this, Loc<2>(i1, i2)); } - inline typename AltComponentView, This_t>::Type_t + inline typename ComponentView, This_t>::Type_t comp(int i1, int i2, int i3) const { return ComponentView, This_t>::make(*this, Loc<3>(i1, i2, i3)); } - inline typename AltComponentView, This_t>::Type_t + inline typename ComponentView, This_t>::Type_t comp(int i1, int i2, int i3, int i4) const { return ComponentView, This_t>::make(*this, Loc<4>(i1, i2, i3, i4)); } - inline typename AltComponentView, This_t>::Type_t + inline typename ComponentView, This_t>::Type_t comp(int i1, int i2, int i3, int i4, int i5) const { return ComponentView, This_t>::make(*this, Loc<5>(i1, i2, i3, i4, i5)); } - inline typename AltComponentView, This_t>::Type_t + inline typename ComponentView, This_t>::Type_t comp(int i1, int i2, int i3, int i4, int i5, int i6) const { return ComponentView, This_t>::make(*this, Loc<6>(i1, i2, i3, i4, i5, i6)); } - inline typename AltComponentView, This_t>::Type_t + inline typename ComponentView, This_t>::Type_t comp(int i1, int i2, int i3, int i4, int i5, int i6, int i7) const { return ComponentView, This_t>::make(*this, @@ -2611,6 +2543,6 @@ // ACL:rcsinfo // ---------------------------------------------------------------------- // $RCSfile: Array.h,v $ $Author: pooma $ -// $Revision: 1.149 $ $Date: 2003/11/21 17:35:16 $ +// $Revision: 1.150 $ $Date: 2004/03/02 18:18:45 $ // ---------------------------------------------------------------------- // ACL:rcsinfo From rguenth at tat.physik.uni-tuebingen.de Tue Mar 23 09:30:20 2004 From: rguenth at tat.physik.uni-tuebingen.de (Richard Guenther) Date: Tue, 23 Mar 2004 10:30:20 +0100 (CET) Subject: [PATCH] Add PETSc wrapper. Message-ID: Hi! This adds support for using the PETSc library of sparse (non-)linear (MPI-)parallel solvers with POOMA. It does so by excercising the PETSc distributed array (DA) API for interfacing with POOMA engines. Accompanied with an example in Solvers/PETSc. Tested with serial PETSc/POOMA and MPI PETSc/POOMA. Ok? Richard. 2004Mar23 Richard Guenther * src/Transform/PETSc.h: new. examples/Solvers/PETSc/PETSc.cpp: new. examples/Solvers/PETSc/include.mk: new. examples/Solvers/PETSc/makefile: new. diff -Nru a/r2/examples/Solvers/PETSc/PETSc.cpp b/r2/examples/Solvers/PETSc/PETSc.cpp --- /dev/null Wed Dec 31 16:00:00 1969 +++ b/r2/examples/Solvers/PETSc/PETSc.cpp Tue Mar 23 10:25:34 2004 @@ -0,0 +1,100 @@ +// Example on how to use PETSc linear solvers from inside a Pooma program. +// This solves the Poisson equation for a density distribution in a 3D +// Array to create the corresponding gravitational potential. + +#include +#include "Transform/PETSc.h" + +#include "petscda.h" +#include "petscksp.h" + +void doit() +{ + typedef Array<2, double, MultiPatch > > Array_t; + typedef Array_t::Layout_t::const_iterator layout_iter; + + Interval<2> domain(8, 8); + Loc<2> blocks = makeRBlocks(domain, Pooma::contexts()); + GridLayout<2> layout(domain, blocks, GuardLayers<2>(1), DistributedTag()); + + // Create DA + Pooma::PoomaDA da(layout, DA_NONPERIODIC, DA_STENCIL_STAR, 1); + + // Assemble matrix + Mat jac; + DAGetMatrix(da, MATMPIAIJ, &jac); + { + int mx, my; + PetscScalar Hx, Hy, HxdHy, HydHx; + DAGetInfo(da,0,&mx,&my,PETSC_NULL,0,0,0,0,0,0,0); + Hx = 1.0 / (PetscReal)(mx-1); Hy = 1.0 / (PetscReal)(my-1); + HxdHy = Hx/Hy; HydHx = Hy/Hx; + int xs, ys, xm, ym; + MatStencil row,col[5]; + DAGetCorners(da,&xs,&ys,PETSC_NULL,&xm,&ym,PETSC_NULL); + PetscScalar v[5]; + for (int j=ys; j +// +// This file is in the public domain. + +/** @file + * @ingroup Utilities + * @brief + * Interfacing with the PETSc library of (non-)linear solvers. + * + * Interfacing supports the PETSc DA (distributed arrays) notion + * for creating (non-)linear solvers for implicit finite difference + * methods. Using this wrappers you can fill your right-hand-side + * vector from a POOMA engine and transfer the result-vector to + * a POOMA engine. + * + * You are going to use the PetscDA class and its methods. + * See examples/Solver/PETSc for how to use this. + */ + +#include "Pooma/Arrays.h" +#include "petscda.h" + + +template +class Field; + + +namespace Pooma { + + +/** + * Helper to convert DALocalInfo domain info to appropriate + * Pooma Interval + */ + +template +struct PoomaDAGetDomain; + +template <> +struct PoomaDAGetDomain<1> { + static inline + Interval<1> innerDomain(DALocalInfo& i) + { + return Interval<1>(i.xs, i.xs+i.xm-1); + } + static inline + Interval<1> totalDomain(DALocalInfo& i) + { + return Interval<1>(i.gxs, i.gxs+i.gxm-1); + } +}; + +template <> +struct PoomaDAGetDomain<2> { + static inline + Interval<2> innerDomain(DALocalInfo& i) + { + return Interval<2>(Interval<1>(i.xs, i.xs+i.xm-1), + Interval<1>(i.ys, i.ys+i.ym-1)); + } + static inline + Interval<2> totalDomain(DALocalInfo& i) + { + return Interval<2>(Interval<1>(i.gxs, i.gxs+i.gxm-1), + Interval<1>(i.gys, i.gys+i.gym-1)); + } +}; + +template <> +struct PoomaDAGetDomain<3> { + static inline + Interval<3> innerDomain(DALocalInfo& i) + { + return Interval<3>(Interval<1>(i.xs, i.xs+i.xm-1), + Interval<1>(i.ys, i.ys+i.ym-1), + Interval<1>(i.zs, i.zs+i.zm-1)); + } + static inline + Interval<3> totalDomain(DALocalInfo& i) + { + return Interval<3>(Interval<1>(i.gxs, i.gxs+i.gxm-1), + Interval<1>(i.gys, i.gys+i.gym-1), + Interval<1>(i.gzs, i.gzs+i.gzm-1)); + } +}; + + + +/** + * Helper to ease brick-engine -> vector copy + */ + +template +struct PoomaDACopy; + +template <> +struct PoomaDACopy<1> { + template + static + void copy(Vec v, const Engine<1, T, Brick>& e) + { + PetscScalar *pa; + VecGetArray(v, &pa); + int idx=0; + Interval<1> d(e.domain()); + for (int I=d.first(); I<=d.last(); ++I) + pa[idx++] = e(I); + VecRestoreArray(v, &pa); + } + template + static + void copy(const Engine<1, T, Brick>& e, Vec v) + { + PetscScalar *pa; + VecGetArray(v, &pa); + int idx=0; + Interval<1> d(e.domain()); + for (int I=d.first(); I<=d.last(); ++I) + e(I) = pa[idx++]; + VecRestoreArray(v, &pa); + } +}; + +template <> +struct PoomaDACopy<2> { + template + static + void copy(Vec v, const Engine<2, T, Brick>& e) + { + PetscScalar *pa; + VecGetArray(v, &pa); + int idx=0; + Interval<2> d(e.domain()); + for (int J=d[1].first(); J<=d[1].last(); ++J) + for (int I=d[0].first(); I<=d[0].last(); ++I) + pa[idx++] = e(I, J); + VecRestoreArray(v, &pa); + } + template + static + void copy(const Engine<2, T, Brick>& e, Vec v) + { + PetscScalar *pa; + VecGetArray(v, &pa); + int idx=0; + Interval<2> d(e.domain()); + for (int J=d[1].first(); J<=d[1].last(); ++J) + for (int I=d[0].first(); I<=d[0].last(); ++I) + e(I, J) = pa[idx++]; + VecRestoreArray(v, &pa); + } +}; + +template <> +struct PoomaDACopy<3> { + template + static + void copy(Vec v, const Engine<3, T, Brick>& e) + { + PetscScalar *pa; + VecGetArray(v, &pa); + int idx=0; + Interval<3> d(e.domain()); + for (int K=d[2].first(); K<=d[2].last(); ++K) + for (int J=d[1].first(); J<=d[1].last(); ++J) + for (int I=d[0].first(); I<=d[0].last(); ++I) + pa[idx++] = e(I, J, K); + VecRestoreArray(v, &pa); + } + template + static + void copy(const Engine<3, T, Brick>& e, Vec v) + { + PetscScalar *pa; + VecGetArray(v, &pa); + int idx=0; + Interval<3> d(e.domain()); + for (int K=d[2].first(); K<=d[2].last(); ++K) + for (int J=d[1].first(); J<=d[1].last(); ++J) + for (int I=d[0].first(); I<=d[0].last(); ++I) + e(I, J, K) = pa[idx++]; + VecRestoreArray(v, &pa); + } +}; + + + +/** + * Struct to wrap extra global information about a DA. + */ + +struct PoomaDA { + + /// Creates a PETSc DA from the specified layout. + /// Extra arguments are like DACreateNd, namely the periodicity + /// and stencil type and the stencil width. + + template + PoomaDA(const Layout &l, DAPeriodicType pt, DAStencilType st, int sw); + + ~PoomaDA() + { + delete[] info; + DADestroy(da); + } + + + /// Can use this as PETSc DA type. + + operator DA() const { return da; } + + + /// Assign from POOMA engine to PETSc vector. + + template + void assign(Vec v, const Engine &e); + + /// Assign from POOMA array to PETSc vector. + + template + void assign(Vec v, const Array &a) + { + this->assign(v, a.engine()); + } + + /// Assign from POOMA field to PETSc vector. + + template + void assign(Vec v, const Field &f) + { + this->assign(v, f.fieldEngine().engine()); + } + + + /// Assign from PETSc vector to POOMA engine. + + template + void assign(const Engine &e, Vec v); + + /// Assign from PETSc vector to POOMA array. + + template + void assign(const Array &a, Vec v) + { + this->assign(a.engine(), v); + } + + /// Assign from PETSc vector to POOMA field. + + template + void assign(const Field &f, Vec v) + { + this->assign(f.fieldEngine().engine(), v); + } + + +private: + DA da; + int n; + DALocalInfo *info; + +}; + + +template +PoomaDA::PoomaDA(const Layout &l, DAPeriodicType pt, DAStencilType st, int sw) +{ + enum { Dim = Layout::dimensions }; + + // create DA + if (Dim == 1) { + DACreate1d(PETSC_COMM_WORLD, /* MPI communicator */ + pt, /* grid periodicity */ + l.innerDomain()[0].size(), /* global domain size */ + 1, /* degrees of freedom */ + sw, /* stencil width */ + PETSC_NULL, /* local domain sizes per dimension */ + &this->da); + } else if (Dim == 2) { + DACreate2d(PETSC_COMM_WORLD, /* MPI communicator */ + pt, /* grid periodicity */ + st, /* stencil type */ + l.innerDomain()[0].size(), + l.innerDomain()[1].size(), /* global domain size */ + PETSC_DECIDE, PETSC_DECIDE,/* # processors */ + 1, /* degrees of freedom */ + sw, /* stencil width */ + PETSC_NULL, PETSC_NULL, /* local domain sizes per dimension */ + &this->da); + } else if (Dim == 3) { + DACreate3d(PETSC_COMM_WORLD, /* MPI communicator */ + pt, /* grid periodicity */ + st, /* stencil type */ + l.innerDomain()[0].size(), l.innerDomain()[1].size(), + l.innerDomain()[2].size(), /* global domain size */ + PETSC_DECIDE, PETSC_DECIDE, + PETSC_DECIDE, /* # processors */ + 1, /* degrees of freedom */ + sw, /* stencil width */ + PETSC_NULL, PETSC_NULL, + PETSC_NULL, /* local domain sizes per dimension */ + &this->da); + } + + // collect local information + int m, n, p; + DAGetInfo(this->da, PETSC_NULL, PETSC_NULL, PETSC_NULL, PETSC_NULL, + &m, &n, &p, + PETSC_NULL, PETSC_NULL, PETSC_NULL, PETSC_NULL); + this->n = m*n*p; + PInsist(Pooma::contexts() == this->n, "nr patches"); + this->info = new DALocalInfo[this->n]; + DAGetLocalInfo(this->da, &this->info[Pooma::context()]); + + // distribute local information + // fixme - MPI_Allgather wrapper missing +#if POOMA_MPI + MPI_Allgather(&this->info[Pooma::context()], sizeof(DALocalInfo), MPI_CHAR, + this->info, sizeof(DALocalInfo), MPI_CHAR, + MPI_COMM_WORLD); +#endif +} + +template +void PoomaDA::assign(Vec v, const Engine &e) +{ + typedef Engine Engine_t; + typedef typename NewEngine >::Type_t ViewEngine_t; + + // our local brick engine + Engine local_e; + Interval local_I; + + // loop over all DA patches + for (int i=0; in; ++i) { + // create DA patch context local pooma array + Interval lPatch(PoomaDAGetDomain::innerDomain(this->info[i])); + Array > a; + a.engine() = Engine >(i, lPatch); + Array e_array(ViewEngine_t(e, lPatch)); + a = e_array; + + // remember local engine + if (i == Pooma::context()) { + local_e = a.engine().localEngine(); + local_I = lPatch; + } + } + Pooma::blockAndEvaluate(); + + // do the copy locally + PoomaDACopy::copy(v, local_e); +} + +template +void PoomaDA::assign(const Engine &e, Vec v) +{ + typedef Engine Engine_t; + typedef typename NewEngine >::Type_t ViewEngine_t; + + // our local brick engine + Interval local_I(PoomaDAGetDomain::innerDomain(this->info[Pooma::context()])); + Engine local_e(local_I); + + // copy into the local brick + // if it were not the different array index ordering we could construct + // the brick engine with external data and avoid the double copying + PoomaDACopy::copy(local_e, v); + + // loop over all DA patches + for (int i=0; in; ++i) { + // create DA patch context local pooma array + Interval lPatch(PoomaDAGetDomain::innerDomain(this->info[i])); + Array > a; + a.engine() = Engine >(i, lPatch); + + // override local engine with our one + if (Pooma::context() == i) + a.engine().localEngine() = local_e; + + // distribute the copy + Array e_array; + e_array.engine() = ViewEngine_t(e, lPatch); + e_array = a; + } +} + + +} // namespace Pooma + +#endif From rguenth at tat.physik.uni-tuebingen.de Tue Mar 23 11:11:35 2004 From: rguenth at tat.physik.uni-tuebingen.de (Richard Guenther) Date: Tue, 23 Mar 2004 12:11:35 +0100 (CET) Subject: [pooma-dev] [PATCH] AltComponentView In-Reply-To: References: Message-ID: On Tue, 23 Mar 2004, Richard Guenther wrote: > Hi! > > Forgot that last time. > @@ -2014,46 +1946,46 @@ > /// ultimately work, Element_t must have a working const operator()(Loc) > /// that returns a reference or proxy to the component. > //@{ > - inline typename AltComponentView, This_t>::Type_t > + inline typename ComponentView, This_t>::Type_t > comp(const int &i1) const > { > return ComponentView, This_t>::make(*this, Loc<1>(i1)); > } I'll take that back - causes "interesting" failures of array_test22: /home/rguenth/src/pooma-bk/r2/src/Array/Array.h(1951): error: class "ComponentView, Array<1, Vector<2, double, Full>, Brick>>" has no member "Type_t" inline typename ComponentView, This_t>::Type_t ^ detected during: instantiation of class "Array [with Dim=1, T=Vector<2, double, Full>, EngineTag=Brick]" at line 1307 instantiation of class "ComponentView> [with Components=Loc<1>, Dim=1, T=Vector<2, double, Full>, EngineTag=Brick]" at line 54 of "/net/bellatrix/home/rguenth/src/pooma-bk/r2/src/Array/tests/array_test22.cpp" where array_test22 just does: typedef Array<1, Vector<2, double>, Brick> Array_t; 54 typedef ComponentView, Array_t>::Type_t CView_t; Array_t b(dom); CView_t d(b.comp(1)); The intel compiler seems to rewrite the template names (ComponentView>), but I'm curious which ComponentView gets instantiated, as the overload in Array.h should work. gcc just says /home/rguenth/src/pooma-bk/r2/src/Array/Array.h: In instantiation of `Array<1, Vector<2, double, Full>, Brick>': /home/rguenth/src/pooma-bk/r2/src/Array/Array.h:1307: instantiated from `ComponentView, main(int, char**)::Array_t>' /net/bellatrix/home/rguenth/src/pooma-bk/r2/src/Array/tests/array_test22.cpp:54: instantiated from here /home/rguenth/src/pooma-bk/r2/src/Array/Array.h:1953: error: no type named `Type_t' in `struct ComponentView, main(int, char**)::Array_t>' which is equally un-helpful. Also, in Array.h:1290, the integer overload of ComponentView seems to have only potential negative effect, but disabling it doesn't fix the above problem (nor does it introduce new problems). Any suggestions? Thanks, Richard. -- Richard Guenther WWW: http://www.tat.physik.uni-tuebingen.de/~rguenth/ From oldham at codesourcery.com Wed Mar 24 10:13:16 2004 From: oldham at codesourcery.com (Jeffrey D. Oldham) Date: Wed, 24 Mar 2004 02:13:16 -0800 Subject: [pooma-dev] [PATCH] Another PrintField tweak In-Reply-To: References: Message-ID: <40615F3C.6070603@codesourcery.com> Richard Guenther wrote: >Hi! > >This allows more cases of expression printing, like > >pinfo << 2.0*a; > >or more complex expressions. > >The problem was the >PerformPrintField::print(*this, s, a.subField(m, c)); >call in the PrintField::print() method and the prototype for the >PerformPrinfField::print method without a suitable auto-conversion from >the result type of a.subField(m, c) back to A. > >Fixed by effectively removing the Metrowerks workaround and templating >the member of PerformPrintField on A, S, rather than PerformPrintField >itself. The workaround is from 12-Aug-99, so the compiler had rather been >fixed until now. > >The PrintArray counterpart works (including the same workaround), because >we don't take subfield-views here and the types can match exactly. > > > Yes, thanks for improving printing. >2004Mar23 Richard Guenther > > * src/Field/PrintField.h: template PerformPrintField on Dim > only, template member on stream and field instead. > >===== PrintField.h 1.4 vs edited ===== >--- 1.4/r2/src/Field/PrintField.h Thu Jan 29 12:01:39 2004 >+++ edited/PrintField.h Tue Mar 23 09:58:02 2004 >@@ -71,23 +71,24 @@ > > /** > * PerformPrintField struct: a simple wrapper around the templated 'print' >- * method of PrintField. This is here as a workaround to a Metrowerks >- * problem that prevents having templated member functions defined as >- * out-of-line. This struct defines one static method 'print', which >+ * method of PrintField. >+ * This struct defines one static method 'print', which > * prints an field to a stream (the two template parameters). The Dim > * parameter is used to specialize this to the case of a 1D domain. This is > * called by the 'print' templated member function of PrintField. > */ > >-template >+template > struct PerformPrintField > { >+ template > static void print(const PrintField &, S &, const A &); > }; > >-template >-struct PerformPrintField >+template<> >+struct PerformPrintField<1> > { >+ template > static void print(const PrintField &, S &, const A &); > }; > >@@ -239,7 +240,7 @@ > { > s << "Material #" << m << ", Centering #" << c << " " << a.centering(c) > << "\n"<< "-------------\n"; >- PerformPrintField::print(*this, s, a.subField(m, c)); >+ PerformPrintField::print(*this, s, a.subField(m, c)); > } > } > >@@ -375,7 +376,7 @@ > > template > void >-PerformPrintField::print(const PrintField &p, S &s, const A &a) >+PerformPrintField<1>::print(const PrintField &p, S &s, const A &a) > { > // make sure this is the right function > >@@ -459,9 +460,10 @@ > */ > //----------------------------------------------------------------------------- > >-template >+template >+template > void >-PerformPrintField::print(const PrintField &p, S &s, const A &a) >+PerformPrintField::print(const PrintField &p, S &s, const A &a) > { > int i, j, k; > > > -- Jeffrey D. Oldham oldham at codesourcery.com From oldham at codesourcery.com Wed Mar 24 10:17:30 2004 From: oldham at codesourcery.com (Jeffrey D. Oldham) Date: Wed, 24 Mar 2004 02:17:30 -0800 Subject: [pooma-dev] [PATCH] Add PETSc wrapper. In-Reply-To: References: Message-ID: <4061603A.1050506@codesourcery.com> Richard Guenther wrote: >Hi! > >This adds support for using the PETSc library of sparse (non-)linear >(MPI-)parallel solvers with POOMA. It does so by excercising the PETSc >distributed array (DA) API for interfacing with POOMA engines. > >Accompanied with an example in Solvers/PETSc. Tested with serial >PETSc/POOMA and MPI PETSc/POOMA. > >Ok? > > It's great to get PETSc integrated into POOMA. We might want to change the RCSinfo tags since you, not julianc nor shaney, did the work. If there is interest, it might be interesting to write a webpage documenting how to use PETSc within POOMA. >Richard. > > >2004Mar23 Richard Guenther > > * src/Transform/PETSc.h: new. > examples/Solvers/PETSc/PETSc.cpp: new. > examples/Solvers/PETSc/include.mk: new. > examples/Solvers/PETSc/makefile: new. > >diff -Nru a/r2/examples/Solvers/PETSc/PETSc.cpp b/r2/examples/Solvers/PETSc/PETSc.cpp >--- /dev/null Wed Dec 31 16:00:00 1969 >+++ b/r2/examples/Solvers/PETSc/PETSc.cpp Tue Mar 23 10:25:34 2004 >@@ -0,0 +1,100 @@ >+// Example on how to use PETSc linear solvers from inside a Pooma program. >+// This solves the Poisson equation for a density distribution in a 3D >+// Array to create the corresponding gravitational potential. >+ >+#include >+#include "Transform/PETSc.h" >+ >+#include "petscda.h" >+#include "petscksp.h" >+ >+void doit() >+{ >+ typedef Array<2, double, MultiPatch > > Array_t; >+ typedef Array_t::Layout_t::const_iterator layout_iter; >+ >+ Interval<2> domain(8, 8); >+ Loc<2> blocks = makeRBlocks(domain, Pooma::contexts()); >+ GridLayout<2> layout(domain, blocks, GuardLayers<2>(1), DistributedTag()); >+ >+ // Create DA >+ Pooma::PoomaDA da(layout, DA_NONPERIODIC, DA_STENCIL_STAR, 1); >+ >+ // Assemble matrix >+ Mat jac; >+ DAGetMatrix(da, MATMPIAIJ, &jac); >+ { >+ int mx, my; >+ PetscScalar Hx, Hy, HxdHy, HydHx; >+ DAGetInfo(da,0,&mx,&my,PETSC_NULL,0,0,0,0,0,0,0); >+ Hx = 1.0 / (PetscReal)(mx-1); Hy = 1.0 / (PetscReal)(my-1); >+ HxdHy = Hx/Hy; HydHx = Hy/Hx; >+ int xs, ys, xm, ym; >+ MatStencil row,col[5]; >+ DAGetCorners(da,&xs,&ys,PETSC_NULL,&xm,&ym,PETSC_NULL); >+ PetscScalar v[5]; >+ for (int j=ys; j+ for(int i=xs; i+ row.i = i; row.j = j; >+ if (i==0 || j==0 || i==mx-1 || j==my-1) { >+ v[0] = 2.0*(HxdHy + HydHx); >+ MatSetValuesStencil(jac,1,&row,1,&row,v,INSERT_VALUES); >+ } else { >+ v[0] = -HxdHy; col[0].i = i; col[0].j = j-1; >+ v[1] = -HydHx; col[1].i = i-1; col[1].j = j; >+ v[2] = 2.0*(HxdHy + HydHx); col[2].i = i; col[2].j = j; >+ v[3] = -HydHx; col[3].i = i+1; col[3].j = j; >+ v[4] = -HxdHy; col[4].i = i; col[4].j = j+1; >+ MatSetValuesStencil(jac,1,&row,5,col,v,INSERT_VALUES); >+ } >+ } >+ } >+ } >+ MatAssemblyBegin(jac,MAT_FINAL_ASSEMBLY); >+ MatAssemblyEnd(jac,MAT_FINAL_ASSEMBLY); >+ >+ // problem >+ Array_t rh(layout), ph(layout); >+ rh(rh.totalDomain()) = 1.0; >+ ph(ph.totalDomain()) = 0.0; >+ Pooma::pinfo << "Density distribution:\n" << rh << std::endl; >+ >+ // assemble rhs and solution >+ Vec pph, prh; >+ DACreateGlobalVector(da, &prh); >+ VecDuplicate(prh, &pph); >+ >+ da.assign(prh, rh); >+ >+ // create solver >+ KSP ksp; >+ KSPCreate(PETSC_COMM_WORLD, &ksp); >+ KSPSetTolerances(ksp, 1e-10, 1e-5, 1e5, 10); >+ KSPSetOperators(ksp, jac, jac, DIFFERENT_NONZERO_PATTERN); >+ KSPSetFromOptions(ksp); >+ >+ // solve and copy solution >+ KSPSetRhs(ksp, prh); >+ KSPSetSolution(ksp, pph); >+ KSPSolve(ksp); >+ da.assign(ph, pph); >+ >+ // show soultion >+ Pooma::pinfo << "Solution:\n" << ph << std::endl; >+} >+ >+int main(int argc, char **argv) >+{ >+ Pooma::initialize(argc, argv); >+ >+ PetscSetCommWorld(MPI_COMM_WORLD); >+ PetscInitialize(&argc, &argv, NULL, NULL); >+ >+ doit(); >+ >+ // cleanup >+ PetscFinalize(); >+ Pooma::finalize(); >+ return 0; >+} >+ >diff -Nru a/r2/examples/Solvers/PETSc/include.mk b/r2/examples/Solvers/PETSc/include.mk >--- /dev/null Wed Dec 31 16:00:00 1969 >+++ b/r2/examples/Solvers/PETSc/include.mk Tue Mar 23 10:25:34 2004 >@@ -0,0 +1,59 @@ >+# Generated by mm.pl: Mon Mar 9 13:58:39 MST 1998 >+# ACL:license >+# ---------------------------------------------------------------------- >+# This software and ancillary information (herein called "SOFTWARE") >+# called POOMA (Parallel Object-Oriented Methods and Applications) is >+# made available under the terms described here. The SOFTWARE has been >+# approved for release with associated LA-CC Number LA-CC-98-65. >+# >+# Unless otherwise indicated, this SOFTWARE has been authored by an >+# employee or employees of the University of California, operator of the >+# Los Alamos National Laboratory under Contract No. W-7405-ENG-36 with >+# the U.S. Department of Energy. The U.S. Government has rights to use, >+# reproduce, and distribute this SOFTWARE. The public may copy, distribute, >+# prepare derivative works and publicly display this SOFTWARE without >+# charge, provided that this Notice and any statement of authorship are >+# reproduced on all copies. Neither the Government nor the University >+# makes any warranty, express or implied, or assumes any liability or >+# responsibility for the use of this SOFTWARE. >+# >+# If SOFTWARE is modified to produce derivative works, such modified >+# SOFTWARE should be clearly marked, so as not to confuse it with the >+# version available from LANL. >+# >+# For more information about POOMA, send e-mail to pooma at acl.lanl.gov, >+# or visit the POOMA web page at http://www.acl.lanl.gov/pooma/. >+# ---------------------------------------------------------------------- >+# ACL:license >+ >+ >+# Wrap make components from SHARED_ROOT and the current directory in the >+# proper order so that variables like ODIR have the correct directory-specific >+# value at the right moment. See the included files for details of what they >+# are doing. This file should NOT be manually edited. >+ >+# Set NEXTDIR, THISDIR and DIR_LIST >+include $(SHARED_ROOT)/include1.mk >+ >+# Include list of subdirectories to process >+-include $(THISDIR)/subdir.mk >+ >+# Set ODIR, PROJECT_INCLUDES, UNIQUE >+include $(SHARED_ROOT)/include2.mk >+ >+# Set list of object files, relative to ODIR >+-include $(THISDIR)/objfile.mk >+ >+# Set rules for the ODIR directory >+include $(SHARED_ROOT)/compilerules.mk >+ >+# Remove current dir from DIR_LIST >+DIR_LIST :=$(filter-out $(firstword $(DIR_LIST)), $(DIR_LIST)) >+ >+ >+# ACL:rcsinfo >+# ---------------------------------------------------------------------- >+# $RCSfile: include.mk,v $ $Author: swhaney $ >+# $Revision: 1.3 $ $Date: 2000/03/07 13:15:37 $ >+# ---------------------------------------------------------------------- >+# ACL:rcsinfo >diff -Nru a/r2/examples/Solvers/PETSc/makefile b/r2/examples/Solvers/PETSc/makefile >--- /dev/null Wed Dec 31 16:00:00 1969 >+++ b/r2/examples/Solvers/PETSc/makefile Tue Mar 23 10:25:34 2004 >@@ -0,0 +1,65 @@ >+# Generated by mm.pl: Mon Mar 9 13:58:39 MST 1998 >+# ACL:license >+# ---------------------------------------------------------------------- >+# This software and ancillary information (herein called "SOFTWARE") >+# called POOMA (Parallel Object-Oriented Methods and Applications) is >+# made available under the terms described here. The SOFTWARE has been >+# approved for release with associated LA-CC Number LA-CC-98-65. >+# >+# Unless otherwise indicated, this SOFTWARE has been authored by an >+# employee or employees of the University of California, operator of the >+# Los Alamos National Laboratory under Contract No. W-7405-ENG-36 with >+# the U.S. Department of Energy. The U.S. Government has rights to use, >+# reproduce, and distribute this SOFTWARE. The public may copy, distribute, >+# prepare derivative works and publicly display this SOFTWARE without >+# charge, provided that this Notice and any statement of authorship are >+# reproduced on all copies. Neither the Government nor the University >+# makes any warranty, express or implied, or assumes any liability or >+# responsibility for the use of this SOFTWARE. >+# >+# If SOFTWARE is modified to produce derivative works, such modified >+# SOFTWARE should be clearly marked, so as not to confuse it with the >+# version available from LANL. >+# >+# For more information about POOMA, send e-mail to pooma at acl.lanl.gov, >+# or visit the POOMA web page at http://www.acl.lanl.gov/pooma/. >+# ---------------------------------------------------------------------- >+# ACL:license >+ >+# This file is user-editable >+ >+PROJECT_ROOT = $(shell cd ../../..; pwd) >+include $(PROJECT_ROOT)/config/head.mk >+ >+PASS=APP >+ >+default:: PETSc >+ >+.PHONY: PETSc >+ >+PETSc:: $(ODIR)/PETSc >+ >+include $(SHARED_ROOT)/tail.mk >+ >+$(ODIR)/PETSc.o: PETSc.cpp >+ $(CXX) -o $@ -c $< $(RULE_CXXOPTS) $(RULE_INCLUDES) $(SUITE_DEFINES) \ >+ -DPETSC_USE_EXTERN_CXX \ >+ -I$(PETSC_DIR)/bmake/linux-gnu \ >+ -I$(PETSC_DIR)/include >+ >+$(ODIR)/PETSc: $(ODIR)/PETSc.o >+ $(CXX) -o $@ $^ $(RULE_LD_OPTS) \ >+ -L$(PETSC_DIR)/lib/libg/linux-gnu \ >+ -lpetscmat -lpetscksp -lpetscdm -lpetscvec -lpetscmat -lpetscdm -lpetsc -lpetscts -lpetscvec -lpetscsnes -lblas -llapack -lblas -lg2c -ldl -static >+ >+# ACL:rcsinfo >+# ---------------------------------------------------------------------- >+# $RCSfile: makefile,v $ $Author: julianc $ >+# $Revision: 1.6 $ $Date: 2000/07/21 20:43:14 $ >+# ---------------------------------------------------------------------- >+# ACL:rcsinfo >diff -Nru a/r2/src/Transform/PETSc.h b/r2/src/Transform/PETSc.h >--- /dev/null Wed Dec 31 16:00:00 1969 >+++ b/r2/src/Transform/PETSc.h Tue Mar 23 10:25:34 2004 >@@ -0,0 +1,396 @@ >+#ifndef POOMA_TRANSFORM_PETSC_H >+#define POOMA_TRANSFORM_PETSC_H >+ >+// PETSc interfacing with POOMA using the PETSc DA interface. >+// >+// Copyright (c) 2004 by Richard Guenther >+// >+// This file is in the public domain. >+ >+/** @file >+ * @ingroup Utilities >+ * @brief >+ * Interfacing with the PETSc library of (non-)linear solvers. >+ * >+ * Interfacing supports the PETSc DA (distributed arrays) notion >+ * for creating (non-)linear solvers for implicit finite difference >+ * methods. Using this wrappers you can fill your right-hand-side >+ * vector from a POOMA engine and transfer the result-vector to >+ * a POOMA engine. >+ * >+ * You are going to use the PetscDA class and its methods. >+ * See examples/Solver/PETSc for how to use this. >+ */ >+ >+#include "Pooma/Arrays.h" >+#include "petscda.h" >+ >+ >+template >+class Field; >+ >+ >+namespace Pooma { >+ >+ >+/** >+ * Helper to convert DALocalInfo domain info to appropriate >+ * Pooma Interval >+ */ >+ >+template >+struct PoomaDAGetDomain; >+ >+template <> >+struct PoomaDAGetDomain<1> { >+ static inline >+ Interval<1> innerDomain(DALocalInfo& i) >+ { >+ return Interval<1>(i.xs, i.xs+i.xm-1); >+ } >+ static inline >+ Interval<1> totalDomain(DALocalInfo& i) >+ { >+ return Interval<1>(i.gxs, i.gxs+i.gxm-1); >+ } >+}; >+ >+template <> >+struct PoomaDAGetDomain<2> { >+ static inline >+ Interval<2> innerDomain(DALocalInfo& i) >+ { >+ return Interval<2>(Interval<1>(i.xs, i.xs+i.xm-1), >+ Interval<1>(i.ys, i.ys+i.ym-1)); >+ } >+ static inline >+ Interval<2> totalDomain(DALocalInfo& i) >+ { >+ return Interval<2>(Interval<1>(i.gxs, i.gxs+i.gxm-1), >+ Interval<1>(i.gys, i.gys+i.gym-1)); >+ } >+}; >+ >+template <> >+struct PoomaDAGetDomain<3> { >+ static inline >+ Interval<3> innerDomain(DALocalInfo& i) >+ { >+ return Interval<3>(Interval<1>(i.xs, i.xs+i.xm-1), >+ Interval<1>(i.ys, i.ys+i.ym-1), >+ Interval<1>(i.zs, i.zs+i.zm-1)); >+ } >+ static inline >+ Interval<3> totalDomain(DALocalInfo& i) >+ { >+ return Interval<3>(Interval<1>(i.gxs, i.gxs+i.gxm-1), >+ Interval<1>(i.gys, i.gys+i.gym-1), >+ Interval<1>(i.gzs, i.gzs+i.gzm-1)); >+ } >+}; >+ >+ >+ >+/** >+ * Helper to ease brick-engine -> vector copy >+ */ >+ >+template >+struct PoomaDACopy; >+ >+template <> >+struct PoomaDACopy<1> { >+ template >+ static >+ void copy(Vec v, const Engine<1, T, Brick>& e) >+ { >+ PetscScalar *pa; >+ VecGetArray(v, &pa); >+ int idx=0; >+ Interval<1> d(e.domain()); >+ for (int I=d.first(); I<=d.last(); ++I) >+ pa[idx++] = e(I); >+ VecRestoreArray(v, &pa); >+ } >+ template >+ static >+ void copy(const Engine<1, T, Brick>& e, Vec v) >+ { >+ PetscScalar *pa; >+ VecGetArray(v, &pa); >+ int idx=0; >+ Interval<1> d(e.domain()); >+ for (int I=d.first(); I<=d.last(); ++I) >+ e(I) = pa[idx++]; >+ VecRestoreArray(v, &pa); >+ } >+}; >+ >+template <> >+struct PoomaDACopy<2> { >+ template >+ static >+ void copy(Vec v, const Engine<2, T, Brick>& e) >+ { >+ PetscScalar *pa; >+ VecGetArray(v, &pa); >+ int idx=0; >+ Interval<2> d(e.domain()); >+ for (int J=d[1].first(); J<=d[1].last(); ++J) >+ for (int I=d[0].first(); I<=d[0].last(); ++I) >+ pa[idx++] = e(I, J); >+ VecRestoreArray(v, &pa); >+ } >+ template >+ static >+ void copy(const Engine<2, T, Brick>& e, Vec v) >+ { >+ PetscScalar *pa; >+ VecGetArray(v, &pa); >+ int idx=0; >+ Interval<2> d(e.domain()); >+ for (int J=d[1].first(); J<=d[1].last(); ++J) >+ for (int I=d[0].first(); I<=d[0].last(); ++I) >+ e(I, J) = pa[idx++]; >+ VecRestoreArray(v, &pa); >+ } >+}; >+ >+template <> >+struct PoomaDACopy<3> { >+ template >+ static >+ void copy(Vec v, const Engine<3, T, Brick>& e) >+ { >+ PetscScalar *pa; >+ VecGetArray(v, &pa); >+ int idx=0; >+ Interval<3> d(e.domain()); >+ for (int K=d[2].first(); K<=d[2].last(); ++K) >+ for (int J=d[1].first(); J<=d[1].last(); ++J) >+ for (int I=d[0].first(); I<=d[0].last(); ++I) >+ pa[idx++] = e(I, J, K); >+ VecRestoreArray(v, &pa); >+ } >+ template >+ static >+ void copy(const Engine<3, T, Brick>& e, Vec v) >+ { >+ PetscScalar *pa; >+ VecGetArray(v, &pa); >+ int idx=0; >+ Interval<3> d(e.domain()); >+ for (int K=d[2].first(); K<=d[2].last(); ++K) >+ for (int J=d[1].first(); J<=d[1].last(); ++J) >+ for (int I=d[0].first(); I<=d[0].last(); ++I) >+ e(I, J, K) = pa[idx++]; >+ VecRestoreArray(v, &pa); >+ } >+}; >+ >+ >+ >+/** >+ * Struct to wrap extra global information about a DA. >+ */ >+ >+struct PoomaDA { >+ >+ /// Creates a PETSc DA from the specified layout. >+ /// Extra arguments are like DACreateNd, namely the periodicity >+ /// and stencil type and the stencil width. >+ >+ template >+ PoomaDA(const Layout &l, DAPeriodicType pt, DAStencilType st, int sw); >+ >+ ~PoomaDA() >+ { >+ delete[] info; >+ DADestroy(da); >+ } >+ >+ >+ /// Can use this as PETSc DA type. >+ >+ operator DA() const { return da; } >+ >+ >+ /// Assign from POOMA engine to PETSc vector. >+ >+ template >+ void assign(Vec v, const Engine &e); >+ >+ /// Assign from POOMA array to PETSc vector. >+ >+ template >+ void assign(Vec v, const Array &a) >+ { >+ this->assign(v, a.engine()); >+ } >+ >+ /// Assign from POOMA field to PETSc vector. >+ >+ template >+ void assign(Vec v, const Field &f) >+ { >+ this->assign(v, f.fieldEngine().engine()); >+ } >+ >+ >+ /// Assign from PETSc vector to POOMA engine. >+ >+ template >+ void assign(const Engine &e, Vec v); >+ >+ /// Assign from PETSc vector to POOMA array. >+ >+ template >+ void assign(const Array &a, Vec v) >+ { >+ this->assign(a.engine(), v); >+ } >+ >+ /// Assign from PETSc vector to POOMA field. >+ >+ template >+ void assign(const Field &f, Vec v) >+ { >+ this->assign(f.fieldEngine().engine(), v); >+ } >+ >+ >+private: >+ DA da; >+ int n; >+ DALocalInfo *info; >+ >+}; >+ >+ >+template >+PoomaDA::PoomaDA(const Layout &l, DAPeriodicType pt, DAStencilType st, int sw) >+{ >+ enum { Dim = Layout::dimensions }; >+ >+ // create DA >+ if (Dim == 1) { >+ DACreate1d(PETSC_COMM_WORLD, /* MPI communicator */ >+ pt, /* grid periodicity */ >+ l.innerDomain()[0].size(), /* global domain size */ >+ 1, /* degrees of freedom */ >+ sw, /* stencil width */ >+ PETSC_NULL, /* local domain sizes per dimension */ >+ &this->da); >+ } else if (Dim == 2) { >+ DACreate2d(PETSC_COMM_WORLD, /* MPI communicator */ >+ pt, /* grid periodicity */ >+ st, /* stencil type */ >+ l.innerDomain()[0].size(), >+ l.innerDomain()[1].size(), /* global domain size */ >+ PETSC_DECIDE, PETSC_DECIDE,/* # processors */ >+ 1, /* degrees of freedom */ >+ sw, /* stencil width */ >+ PETSC_NULL, PETSC_NULL, /* local domain sizes per dimension */ >+ &this->da); >+ } else if (Dim == 3) { >+ DACreate3d(PETSC_COMM_WORLD, /* MPI communicator */ >+ pt, /* grid periodicity */ >+ st, /* stencil type */ >+ l.innerDomain()[0].size(), l.innerDomain()[1].size(), >+ l.innerDomain()[2].size(), /* global domain size */ >+ PETSC_DECIDE, PETSC_DECIDE, >+ PETSC_DECIDE, /* # processors */ >+ 1, /* degrees of freedom */ >+ sw, /* stencil width */ >+ PETSC_NULL, PETSC_NULL, >+ PETSC_NULL, /* local domain sizes per dimension */ >+ &this->da); >+ } >+ >+ // collect local information >+ int m, n, p; >+ DAGetInfo(this->da, PETSC_NULL, PETSC_NULL, PETSC_NULL, PETSC_NULL, >+ &m, &n, &p, >+ PETSC_NULL, PETSC_NULL, PETSC_NULL, PETSC_NULL); >+ this->n = m*n*p; >+ PInsist(Pooma::contexts() == this->n, "nr patches"); >+ this->info = new DALocalInfo[this->n]; >+ DAGetLocalInfo(this->da, &this->info[Pooma::context()]); >+ >+ // distribute local information >+ // fixme - MPI_Allgather wrapper missing >+#if POOMA_MPI >+ MPI_Allgather(&this->info[Pooma::context()], sizeof(DALocalInfo), MPI_CHAR, >+ this->info, sizeof(DALocalInfo), MPI_CHAR, >+ MPI_COMM_WORLD); >+#endif >+} >+ >+template >+void PoomaDA::assign(Vec v, const Engine &e) >+{ >+ typedef Engine Engine_t; >+ typedef typename NewEngine >::Type_t ViewEngine_t; >+ >+ // our local brick engine >+ Engine local_e; >+ Interval local_I; >+ >+ // loop over all DA patches >+ for (int i=0; in; ++i) { >+ // create DA patch context local pooma array >+ Interval lPatch(PoomaDAGetDomain::innerDomain(this->info[i])); >+ Array > a; >+ a.engine() = Engine >(i, lPatch); >+ Array e_array(ViewEngine_t(e, lPatch)); >+ a = e_array; >+ >+ // remember local engine >+ if (i == Pooma::context()) { >+ local_e = a.engine().localEngine(); >+ local_I = lPatch; >+ } >+ } >+ Pooma::blockAndEvaluate(); >+ >+ // do the copy locally >+ PoomaDACopy::copy(v, local_e); >+} >+ >+template >+void PoomaDA::assign(const Engine &e, Vec v) >+{ >+ typedef Engine Engine_t; >+ typedef typename NewEngine >::Type_t ViewEngine_t; >+ >+ // our local brick engine >+ Interval local_I(PoomaDAGetDomain::innerDomain(this->info[Pooma::context()])); >+ Engine local_e(local_I); >+ >+ // copy into the local brick >+ // if it were not the different array index ordering we could construct >+ // the brick engine with external data and avoid the double copying >+ PoomaDACopy::copy(local_e, v); >+ >+ // loop over all DA patches >+ for (int i=0; in; ++i) { >+ // create DA patch context local pooma array >+ Interval lPatch(PoomaDAGetDomain::innerDomain(this->info[i])); >+ Array > a; >+ a.engine() = Engine >(i, lPatch); >+ >+ // override local engine with our one >+ if (Pooma::context() == i) >+ a.engine().localEngine() = local_e; >+ >+ // distribute the copy >+ Array e_array; >+ e_array.engine() = ViewEngine_t(e, lPatch); >+ e_array = a; >+ } >+} >+ >+ >+} // namespace Pooma >+ >+#endif > > -- Jeffrey D. Oldham oldham at codesourcery.com From rguenth at tat.physik.uni-tuebingen.de Wed Mar 24 18:29:16 2004 From: rguenth at tat.physik.uni-tuebingen.de (Richard Guenther) Date: Wed, 24 Mar 2004 19:29:16 +0100 Subject: [pooma-dev] [PATCH] Add PETSc wrapper. In-Reply-To: <4061603A.1050506@codesourcery.com> References: <4061603A.1050506@codesourcery.com> Message-ID: <4061D37C.40006@tat.physik.uni-tuebingen.de> Jeffrey D. Oldham wrote: > Richard Guenther wrote: > >> Hi! >> >> This adds support for using the PETSc library of sparse (non-)linear >> (MPI-)parallel solvers with POOMA. It does so by excercising the PETSc >> distributed array (DA) API for interfacing with POOMA engines. >> >> Accompanied with an example in Solvers/PETSc. Tested with serial >> PETSc/POOMA and MPI PETSc/POOMA. >> >> Ok? > > It's great to get PETSc integrated into POOMA. We might want to change > the RCSinfo tags since you, not julianc nor shaney, did the work. If > there is interest, it might be interesting to write a webpage > documenting how to use PETSc within POOMA. Yes, but I'd rather have some opinion where to put it, as the docs/ webpages are rather out of date. Also whoever wants to use PETSc with POOMA had better be familiar with PETSc already. I think for now the example is enough to get the idea. Committed. Thanks, Richard. From rguenth at tat.physik.uni-tuebingen.de Wed Mar 31 14:45:41 2004 From: rguenth at tat.physik.uni-tuebingen.de (Richard Guenther) Date: Wed, 31 Mar 2004 16:45:41 +0200 (CEST) Subject: Relations and required copy constructor Message-ID: Hi! Does anyone remember why relation functors require a "copy constructor" with the relation target as the second parameter? I.e. why RelationBase.h: template class RelationBase : public RelationRetargetBase { public: //--------------------------------------------------------------------------- // Constructors. // Initialize the target and functor. RelationBase(const Target &t, const Functor &f) : RelationRetargetBase(t), functor_m(f, t) { } here functor_m is constucted from f and t and not just f which is called from newRelation(...) via RelationN constructor: Relations.h: template class Relation2: public RelationBase { public: //--------------------------------------------------------------------------- // Constructors. Relation2(const Target &t, const R1 &r1, const R2 &r2, const RelationFunctor &f) : RelationBase(t, f), r1_m(r1), r2_m(r2) { } ? I.e. what was the purpose of exposing the target to the relation functor constructor here? Thanks, Richard. -- Richard Guenther WWW: http://www.tat.physik.uni-tuebingen.de/~rguenth/