freepooma-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [pooma-dev] Testing Pooma Code Using Explicit Instantiations?


From: Dave Nystrom
Subject: RE: [pooma-dev] Testing Pooma Code Using Explicit Instantiations?
Date: Tue, 8 May 2001 13:24:54 -0600 (MDT)

James Crotinger writes:
 > There are definitely parts of r2 that were designed in such a way that
 > explicit instantiation will not work - they rely on the fact that some
 > functionality only make sense with certain types of engines, etc. For

Hi Jim,

Don't you really mean here that there are parts of Pooma 2 that were designed 
in a way that precludes instantiating the whole class for a given set of
template parameters whether it is done explicitly or otherwise?  It seems
important to me to make that distinction because the compiler only
instantiates the actual methods that are referenced and if the compiler can
instantiate a given templated method with specific template parameters, then
it should be possible to explicitly instantiate the same method with the same 
template parameters.

Being unfamiliar with the details of Pooma 2, I couldn't really comment on
the feasibility of designing all the templated classes so that the whole
class could be explicitly instantiated.  But I thought I had heard either you 
or Scott say the same sorts of things previously that you are saying in this
email i.e. it is very difficult to design all your classes so they can all be 
fully instantiated as classes for all the desired template parameters.  I
just want to be able to explicitly instantiate anything the compiler can 
instantiate.

Dave

 > instance, MultiPatchEngine handles dynamic events, but the code that deals
 > with these events only makes sense for patch engines that handle dynamic
 > events. The event code is used for non-dynamic engines as well (for things
 > like repartitioning a shared layout). The handling of dynamic events is
 > delegated to a separate function dynamicHandler(...,WrappedInt<true>). This
 > is called as 
 > 
 >    dynamicHandler(...,WrappedInt<PatchEngine_t::dynamic>);
 > 
 > in the event handler, and the dynamicHandler(...,WrappedInt<false>) is just
 > an empty stub. Since only the "false" version of this function is compiled
 > for non-dynamic patch engines, this works. Explicit instantiation would
 > attempt to compile both versions, and that would not work. The alternatives
 > were to either make all engines support the dynamic interface, which would
 > be a mess (and only makes sense in 1D), or to have a separate
 > DynamicMultiPatch engine, which would mostly be a straight copy of
 > MultiPatchEngine. 
 > 
 > Also, there are more than a few template member functions in r2, so explicit
 > instantiation of classes is not enough to ensure that everything compiles.
 > (Furthermore, many of these are inline due to problems with certain
 > compilers/debuggers - it would be very nice to move these as many of them
 > certainly don't need to be inline, but I think CW 6.0 still has trouble
 > debugging template member functions that are defined outside of the class
 > body [at least the beta did].)
 > 
 >      Jim
 > 
 > > -----Original Message-----
 > > From: Dave Nystrom [mailto:address@hidden
 > > Sent: Saturday, May 05, 2001 11:47 AM
 > > To: Jeffrey Oldham
 > > Cc: address@hidden; Dave Nystrom
 > > Subject: RE: [pooma-dev] Testing Pooma Code Using Explicit
 > > Instantiations?
 > > 
 > > 
 > > Hi Jeff,
 > > 
 > > Don't know how you got Nyholm but my last name is Nystrom.  
 > > I'm not sure
 > > whether Pooma 2 has a goal of being able to instantiate all 
 > > the members of a
 > > class.  Perhaps Scott or Jim could comment on that> 
 > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
 > <HTML>
 > <HEAD>
 > <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
 > <META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2650.12">
 > <TITLE>RE: [pooma-dev] Testing Pooma Code Using Explicit 
 > Instantiations?</TITLE>
 > </HEAD>
 > <BODY>
 > 
 > <P><FONT SIZE=2>There are definitely parts of r2 that were designed in such 
 > a way that explicit instantiation will not work - they rely on the fact that 
 > some functionality only make sense with certain types of engines, etc. For 
 > instance, MultiPatchEngine handles dynamic events, but the code that deals 
 > with these events only makes sense for patch engines that handle dynamic 
 > events. The event code is used for non-dynamic engines as well (for things 
 > like repartitioning a shared layout). The handling of dynamic events is 
 > delegated to a separate function dynamicHandler(...,WrappedInt&lt;true&gt;). 
 > This is called as </FONT></P>
 > 
 > <P><FONT SIZE=2>&nbsp;&nbsp; 
 > dynamicHandler(...,WrappedInt&lt;PatchEngine_t::dynamic&gt;);</FONT>
 > </P>
 > 
 > <P><FONT SIZE=2>in the event handler, and the 
 > dynamicHandler(...,WrappedInt&lt;false&gt;) is just an empty stub. Since 
 > only the &quot;false&quot; version of this function is compiled for 
 > non-dynamic patch engines, this works. Explicit instantiation would attempt 
 > to compile both versions, and that would not work. The alternatives were to 
 > either make all engines support the dynamic interface, which would be a mess 
 > (and only makes sense in 1D), or to have a separate DynamicMultiPatch 
 > engine, which would mostly be a straight copy of MultiPatchEngine. 
 > </FONT></P>
 > 
 > <P><FONT SIZE=2>Also, there are more than a few template member functions in 
 > r2, so explicit instantiation of classes is not enough to ensure that 
 > everything compiles. (Furthermore, many of these are inline due to problems 
 > with certain compilers/debuggers - it would be very nice to move these as 
 > many of them certainly don't need to be inline, but I think CW 6.0 still has 
 > trouble debugging template member functions that are defined outside of the 
 > class body [at least the beta did].)</FONT></P>
 > 
 > <P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2>Jim</FONT>
 > </P>
 > 
 > <P><FONT SIZE=2>&gt; -----Original Message-----</FONT>
 > <BR><FONT SIZE=2>&gt; From: Dave Nystrom [<A 
 > HREF="mailto:address@hidden";>mailto:address@hidden</A>]</FONT>
 > <BR><FONT SIZE=2>&gt; Sent: Saturday, May 05, 2001 11:47 AM</FONT>
 > <BR><FONT SIZE=2>&gt; To: Jeffrey Oldham</FONT>
 > <BR><FONT SIZE=2>&gt; Cc: address@hidden; Dave Nystrom</FONT>
 > <BR><FONT SIZE=2>&gt; Subject: RE: [pooma-dev] Testing Pooma Code Using 
 > Explicit</FONT>
 > <BR><FONT SIZE=2>&gt; Instantiations?</FONT>
 > <BR><FONT SIZE=2>&gt; </FONT>
 > <BR><FONT SIZE=2>&gt; </FONT>
 > <BR><FONT SIZE=2>&gt; Hi Jeff,</FONT>
 > <BR><FONT SIZE=2>&gt; </FONT>
 > <BR><FONT SIZE=2>&gt; Don't know how you got Nyholm but my last name is 
 > Nystrom.&nbsp; </FONT>
 > <BR><FONT SIZE=2>&gt; I'm not sure</FONT>
 > <BR><FONT SIZE=2>&gt; whether Pooma 2 has a goal of being able to 
 > instantiate all </FONT>
 > <BR><FONT SIZE=2>&gt; the members of a</FONT>
 > <BR><FONT SIZE=2>&gt; class.&nbsp; Perhaps Scott or Jim could comment on 
 > that&gt; </FONT>
 > </P>
 > 
 > </BODY>
 > </HTML>

reply via email to

[Prev in Thread] Current Thread [Next in Thread]