[PATCH] Fix RemoteProxy for std::string

Richard Guenther rguenth at tat.physik.uni-tuebingen.de
Wed Jul 16 18:11:57 UTC 2003


Hi!

The following patch fixes RemoteProxy handling of std::string (and
possibly other non-POD types) by using the delegate mechanism of
Cheetah. This will turn silent failures of non-POD transmissions
into compile errors, if no suitable overrides are provided. It also
will diagnose transfer of yet unknown POD objects as they need to
be registered with Cheetah as being POD (I've done so for the objects
I usually transfer with RemoteProxy).

Regtested Tulip serially (it works with cheetah and MPI for my parallel
code). Ok to apply? Better ideas to detect PODness?

Richard.


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

	* src/Tulip/RemoteProxy.h: use Cheetah delegate mechanism
	to pack/unpack objects. Add specializations for
	Cheetah::DelegateType.

===== src/Tulip/RemoteProxy.h 1.4 vs edited =====
--- 1.4/r2/src/Tulip/RemoteProxy.h	Fri Jan 24 18:32:30 2003
+++ edited/src/Tulip/RemoteProxy.h	Wed Jul 16 20:04:42 2003
@@ -57,6 +57,34 @@
 # include "Cheetah/Cheetah.h"
 #endif

+
+// For Cheetah support we need to mark more types not delegate.
+
+#if POOMA_CHEETAH
+namespace Cheetah {
+
+  template<int Dim>
+  class DelegateType<Interval<Dim> > {
+  public:
+    enum { delegate = false };
+  };
+
+  template<int Dim>
+  class DelegateType<Loc<Dim> > {
+  public:
+    enum { delegate = false };
+  };
+
+  template<int Dim, class T, class Tag>
+  class DelegateType<Vector<Dim, T, Tag> > {
+  public:
+    enum { delegate = false };
+  };
+
+} // namespace Cheetah
+#endif
+
+
 //-----------------------------------------------------------------------------
 //
 // RemoteProxy<T>
@@ -120,7 +148,7 @@
       {
 	if (toContext != Pooma::context())
 	{
-	  Pooma::indexHandler()->send(toContext, tag, val);
+	  Pooma::indexHandler()->sendWith(Cheetah::DELEGATE(), toContext, tag, val);
 	}
       }
 #endif
@@ -133,7 +161,8 @@

       RemoteProxyBase::ready_m = false;

-      Pooma::indexHandler()->request(owningContext, tag, receive, this);
+      Pooma::indexHandler()->requestWith(Cheetah::DELEGATE(), owningContext,
+                                         tag, receive, this);

       while (!RemoteProxyBase::ready_m)
       {




More information about the pooma-dev mailing list