freepooma-devel
[Top][All Lists]
Advanced

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

[PATCH] Fix RemoteProxy for std::string


From: Richard Guenther
Subject: [PATCH] Fix RemoteProxy for std::string
Date: Wed, 16 Jul 2003 20:11:57 +0200 (CEST)

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 <address@hidden>

        * 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)
       {

reply via email to

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