[PATCH] Fix Engine/tests/dynamiclayout_test1 failure

Richard Guenther rguenth at tat.physik.uni-tuebingen.de
Sun Jun 15 12:38:03 UTC 2003


Hi!

The following patch fixes the failure. The problem is, the default
constructor of Engine<1, T, Remote<Dynamic> > doesnt create a sane
state and such makeOwnCopy() called from ElementProperties::construct
will fail with an assertion.

Tested Layout, Engine and DynamicArray with no new failures on ppc-linux.

Ok?

Richard.


2003Jun15  Richard Guenther <richard.guenther at uni-tuebingen.de>

	* src/Engine/RemoteDynamicEngine.h: (makeOwnCopy) verify engine
	before copying.

Index: RemoteDynamicEngine.h
===================================================================
RCS file: /home/pooma/Repository/r2/src/Engine/RemoteDynamicEngine.h,v
retrieving revision 1.19
diff -u -u -r1.19 RemoteDynamicEngine.h
--- RemoteDynamicEngine.h	18 Dec 2002 21:38:19 -0000	1.19
+++ RemoteDynamicEngine.h	15 Jun 2003 12:09:25 -0000
@@ -239,7 +239,7 @@
   inline
   Engine_t &makeOwnCopy()
   {
-    if (engineIsLocal())
+    if (engineIsLocal() && localEnginePtr_m != NULL)
     {
       // Ideally this would be localEnginePtr_m.makeOwnCopy();
       // but Shared<> doesn't implement ElementProperties correctly.
@@ -516,7 +516,7 @@

 template <class T>
 Engine<1, T, Remote<Dynamic> >::Engine()
-  : owningContext_m(0)
+  : owningContext_m(0), localEnginePtr_m(NULL)
 {
   PAssert(owningContext_m < Pooma::contexts());





More information about the pooma-dev mailing list