aboutsummaryrefslogtreecommitdiff
path: root/Carpet/CarpetLib/src/gdata.hh
diff options
context:
space:
mode:
authorschnetter <>2003-11-05 15:18:00 +0000
committerschnetter <>2003-11-05 15:18:00 +0000
commitf1bfa75fa4425d8cf55937fa26b33b2c6ba8f27a (patch)
treedb14971237fb532d89eff53dde64282084b73e6f /Carpet/CarpetLib/src/gdata.hh
parent1072312e58ca8b5d10bcb738a117a5fdf9cd6415 (diff)
Many changes that accumulated while Cactus and Carpet diverged.
Many changes that accumulated while Cactus and Carpet diverged. Add processor splitting mechanism "along-dir" that splits along a specified direction. Rename group PostRestrict to bin POSTRESTRICT. Prolongate initial data only when desired. This saves much time. Sorry, Ian. Fix bug in time level cycling of grid arrays. (Note: grid arrays should not have time levels.) Fix time_t bug on IRIX. Make sure that there is no integer overflow when there are many refinement levels. Always put parentheses around (maxreflevelfact/reflevelfact). Fix typo in Carpet verbose output. Add debug output in processor splitting. Communicate in three stages: Irecv, (work), Isend, Wait. This might be more efficient. Much more, potentially. Fix bug in processor layout of grid arrays. Sorry, Ian. Make the interpolator interpolate between time levels. Untested. Fix bug in processor communication in interpolator. Sorry, Ian. Rewrite prolongation operators to make them twice as fast. There you are, Ian. Move prolongation operator kind handling from data to gdata. Add official hyperslabbing interfaces to CarpetSlab. Adapt to new cGH * handling. darcs-hash:20031105151837-07bb3-758a87ff0355dba053269df4b7d7d79bea018669.gz
Diffstat (limited to 'Carpet/CarpetLib/src/gdata.hh')
-rw-r--r--Carpet/CarpetLib/src/gdata.hh97
1 files changed, 84 insertions, 13 deletions
diff --git a/Carpet/CarpetLib/src/gdata.hh b/Carpet/CarpetLib/src/gdata.hh
index edc08c8e7..808a8eb51 100644
--- a/Carpet/CarpetLib/src/gdata.hh
+++ b/Carpet/CarpetLib/src/gdata.hh
@@ -1,4 +1,4 @@
-// $Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetLib/src/gdata.hh,v 1.19 2003/10/15 07:14:01 hawke Exp $
+// $Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetLib/src/gdata.hh,v 1.20 2003/11/05 16:18:39 schnetter Exp $
#ifndef GDATA_HH
#define GDATA_HH
@@ -8,6 +8,7 @@
#include <iostream>
#include <string>
+#include <vector>
#include "cctk.h"
@@ -19,6 +20,29 @@
using namespace std;
+
+
+template<int D>
+class gdata;
+
+
+
+// State information for communications
+enum astate { state_recv, state_send, state_wait, state_done };
+
+template<int D>
+struct comm_state {
+ astate thestate;
+ comm_state ();
+ void step ();
+ bool done ();
+ ~comm_state ();
+
+ vector<gdata<D>*> tmps;
+ size_t current;
+};
+
+
// A generic data storage without type information
template<int D>
@@ -57,7 +81,13 @@ public:
virtual gdata<D>* make_typed (const int varindex) const = 0;
// Processor management
- virtual void change_processor (const int newproc, void* const mem=0) = 0;
+ virtual void change_processor (comm_state<D>& state,
+ const int newproc, void* const mem=0) = 0;
+ protected:
+ virtual void change_processor_recv (const int newproc, void* const mem=0) = 0;
+ virtual void change_processor_send (const int newproc, void* const mem=0) = 0;
+ virtual void change_processor_wait (const int newproc, void* const mem=0) = 0;
+ public:
// Storage management
virtual void transfer_from (gdata<D>* src) = 0;
@@ -68,10 +98,6 @@ public:
// Accessors
- int var_index () const {
- return varindex;
- }
-
bool has_storage () const {
return _has_storage;
}
@@ -117,14 +143,59 @@ public:
assert (all(ind>=0 && ind<=shape()));
return dot(ind, stride());
}
-
+
+ // Transport operator types
+ protected:
+ enum operator_type { op_error, op_none, op_Lagrange, op_TVD };
+ // readonly
+ operator_type transport_operator;
+ private:
+ static operator_type find_transport_operator (const int varindex_);
+
// Data manipulators
- void copy_from (const gdata* src, const ibbox& box);
- void interpolate_from (const vector<const gdata*> srcs,
- const vector<CCTK_REAL> times,
- const ibbox& box, const CCTK_REAL time,
- const int order_space,
- const int order_time);
+ public:
+ void copy_from (comm_state<D>& state, const gdata* src, const ibbox& box);
+ private:
+ void copy_from_nocomm (const gdata* src, const ibbox& box);
+ void copy_from_recv (comm_state<D>& state,
+ const gdata* src, const ibbox& box);
+ void copy_from_send (comm_state<D>& state,
+ const gdata* src, const ibbox& box);
+ void copy_from_wait (comm_state<D>& state,
+ const gdata* src, const ibbox& box);
+ public:
+ void interpolate_from (comm_state<D>& state,
+ const vector<const gdata*> srcs,
+ const vector<CCTK_REAL> times,
+ const ibbox& box, const CCTK_REAL time,
+ const int order_space,
+ const int order_time);
+ private:
+ void interpolate_from_nocomm (const vector<const gdata*> srcs,
+ const vector<CCTK_REAL> times,
+ const ibbox& box, const CCTK_REAL time,
+ const int order_space,
+ const int order_time);
+ void interpolate_from_recv (comm_state<D>& state,
+ const vector<const gdata*> srcs,
+ const vector<CCTK_REAL> times,
+ const ibbox& box, const CCTK_REAL time,
+ const int order_space,
+ const int order_time);
+ void interpolate_from_send (comm_state<D>& state,
+ const vector<const gdata*> srcs,
+ const vector<CCTK_REAL> times,
+ const ibbox& box, const CCTK_REAL time,
+ const int order_space,
+ const int order_time);
+ void interpolate_from_wait (comm_state<D>& state,
+ const vector<const gdata*> srcs,
+ const vector<CCTK_REAL> times,
+ const ibbox& box, const CCTK_REAL time,
+ const int order_space,
+ const int order_time);
+ public:
+
protected:
virtual void
copy_from_innerloop (const gdata* src, const ibbox& box) = 0;