diff options
author | Erik Schnetter <schnetter@cct.lsu.edu> | 2008-01-30 22:14:00 +0000 |
---|---|---|
committer | Erik Schnetter <schnetter@cct.lsu.edu> | 2008-01-30 22:14:00 +0000 |
commit | 5965d01d9f8e7ad97be9d334d7466f7665289a23 (patch) | |
tree | 9c46c47aa40ea78fe6989184bc0e9b270d7e3594 /Carpet/CarpetLib/src/ggf.cc | |
parent | b1d2e755cddb2c77b63bd770b450a806135079bc (diff) |
CarpetLib: Remove old-style communication routines
Remove the declarations and definitions of old-style communication
routines.
darcs-hash:20080130221457-dae7b-1d759b545bf0e56273f6c7ba3aeb628fa9ade7ef.gz
Diffstat (limited to 'Carpet/CarpetLib/src/ggf.cc')
-rw-r--r-- | Carpet/CarpetLib/src/ggf.cc | 268 |
1 files changed, 0 insertions, 268 deletions
diff --git a/Carpet/CarpetLib/src/ggf.cc b/Carpet/CarpetLib/src/ggf.cc index f24f03163..b0c9baa56 100644 --- a/Carpet/CarpetLib/src/ggf.cc +++ b/Carpet/CarpetLib/src/ggf.cc @@ -167,42 +167,6 @@ void ggf::recompose_fill (comm_state & state, int const rl, } } -#if 0 - for (int c = 0; c < h.components (rl); ++c) { - - // Initialise from the same level of the old hierarchy, where - // possible - if (rl < (int)oldstorage.AT(ml).size()) { - for (int tl = 0; tl < timelevels (ml, rl); ++tl) { - transfer_from (state, - tl, rl, c, ml, - & dh::dboxes::fast_old2new_sync_recv, - & dh::dboxes::fast_old2new_sync_send, - tl, rl, ml, - & oldstorage); - } // for tl - } // if rl - - if (do_prolongate) { - // Initialise from a coarser level of the new hierarchy, where - // possible - if (rl > 0) { - if (transport_operator != op_none and transport_operator != op_sync) { - for (int tl = 0; tl < timelevels (ml, rl); ++tl) { - transfer_from (state, - tl, rl, c, ml, - & dh::dboxes::fast_old2new_ref_prol_recv, - & dh::dboxes::fast_old2new_ref_prol_send, - tls, rl - 1, ml, - t.time (tl, rl, ml)); - } // for tl - } // if transport_operator - } // if rl - } // if do_prolongate - - } // for c -#endif - // Initialise from the same level of the old hierarchy, where // possible if (rl < (int)oldstorage.AT(ml).size()) { @@ -323,24 +287,6 @@ void ggf::fill (int rl, int c, int ml) { -// Synchronise the boundaries of a component -void -ggf:: -sync (comm_state & state, - int const tl, int const rl, int const c, int const ml) -{ - if (transport_operator == op_none) return; - // Copy - static Timer timer ("sync"); - timer.start (); - transfer_from (state, - tl,rl,c,ml, - & dh::dboxes::fast_sync_recv, - & dh::dboxes::fast_sync_send, - tl,rl, ml); - timer.stop (0); -} - // Synchronise the boundaries of all components void ggf:: @@ -360,46 +306,6 @@ sync_all (comm_state & state, -// Prolongate the boundaries of a component -void -ggf:: -ref_bnd_prolongate (comm_state & state, - int const tl, int const rl, int const c, int const ml, - CCTK_REAL const time) -{ - // Interpolate - assert (rl>=1); - if (transport_operator == op_none or transport_operator == op_sync) return; - vector<int> tl2s; - static Timer timer ("ref_bnd_prolongate"); - timer.start (); - if (transport_operator != op_copy) { - // Interpolation in time - if (not (timelevels(ml,rl) >= prolongation_order_time+1)) { - char * const fullname = CCTK_FullName (varindex); - CCTK_VWarn (0, __LINE__, __FILE__, CCTK_THORNSTRING, - "The variable \"%s\" has only %d active time levels, which is not enough for boundary prolongation of order %d", - fullname ? fullname : "<unknown variable>", - timelevels(ml,rl), prolongation_order_time); - free (fullname); - } - assert (timelevels(ml,rl) >= prolongation_order_time+1); - tl2s.resize(prolongation_order_time+1); - for (int i=0; i<=prolongation_order_time; ++i) tl2s.AT(i) = i; - } else { - assert (timelevels(ml,rl) >= 1); - tl2s.resize(1); - tl2s.AT(0) = 0; - } - transfer_from (state, - tl ,rl ,c,ml, - & dh::dboxes::fast_ref_bnd_prol_recv, - & dh::dboxes::fast_ref_bnd_prol_send, - tl2s,rl-1, ml, - time); - timer.stop (0); -} - // Prolongate the boundaries of all components void ggf:: @@ -444,29 +350,6 @@ ref_bnd_prolongate_all (comm_state & state, // Restrict a multigrid level void ggf:: -mg_restrict (comm_state & state, - int const tl, int const rl, int const c, int const ml, - CCTK_REAL const time) -{ - static Timer timer ("mg_restrict"); - timer.start (); - // Require same times - static_assert (abs(0.1) > 0, "Function CarpetLib::abs has wrong signature"); - assert (abs(t.get_time(rl,ml) - t.get_time(rl,ml-1)) - <= 1.0e-8 * abs(t.get_time(rl,ml))); - vector<int> const tl2s(1,tl); - transfer_from (state, - tl ,rl,c,ml, - & dh::dboxes::fast_mg_rest_recv, - & dh::dboxes::fast_mg_rest_send, - tl2s,rl, ml-1, - time); - timer.stop (0); -} - -// Restrict a multigrid level -void -ggf:: mg_restrict_all (comm_state & state, int const tl, int const rl, int const ml, CCTK_REAL const time) @@ -491,29 +374,6 @@ mg_restrict_all (comm_state & state, // Prolongate a multigrid level void ggf:: -mg_prolongate (comm_state & state, - int const tl, int const rl, int const c, int const ml, - CCTK_REAL const time) -{ - static Timer timer ("mg_prolongate"); - timer.start (); - // Require same times - static_assert (abs(0.1) > 0, "Function CarpetLib::abs has wrong signature"); - assert (abs(t.get_time(rl,ml) - t.get_time(rl,ml+1)) - <= 1.0e-8 * abs(t.get_time(rl,ml))); - vector<int> const tl2s(1,tl); - transfer_from (state, - tl ,rl,c,ml, - & dh::dboxes::fast_mg_prol_recv, - & dh::dboxes::fast_mg_prol_send, - tl2s,rl, ml+1, - time); - timer.stop (0); -} - -// Prolongate a multigrid level -void -ggf:: mg_prolongate_all (comm_state & state, int const tl, int const rl, int const ml, CCTK_REAL const time) @@ -538,30 +398,6 @@ mg_prolongate_all (comm_state & state, // Restrict a refinement level void ggf:: -ref_restrict (comm_state & state, - int const tl, int const rl, int const c, int const ml, - CCTK_REAL const time) -{ - // Require same times - static_assert (abs(0.1) > 0, "Function CarpetLib::abs has wrong signature"); - assert (abs(t.get_time(rl,ml) - t.get_time(rl+1,ml)) - <= 1.0e-8 * abs(t.get_time(rl,ml))); - if (transport_operator == op_none or transport_operator == op_sync) return; - static Timer timer ("ref_restrict"); - timer.start (); - vector<int> const tl2s(1,tl); - transfer_from (state, - tl ,rl ,c,ml, - & dh::dboxes::fast_ref_rest_recv, - & dh::dboxes::fast_ref_rest_send, - tl2s,rl+1, ml, - time); - timer.stop (0); -} - -// Restrict a refinement level -void -ggf:: ref_restrict_all (comm_state & state, int const tl, int const rl, int const ml, CCTK_REAL const time) @@ -587,31 +423,6 @@ ref_restrict_all (comm_state & state, // Prolongate a refinement level void ggf:: -ref_prolongate (comm_state & state, - int const tl, int const rl, int const c, int const ml, - CCTK_REAL const time) -{ - assert (rl>=1); - if (transport_operator == op_none or transport_operator == op_sync) return; - static Timer timer ("ref_prolongate"); - timer.start (); - vector<int> tl2s; - // Interpolation in time - assert (timelevels(ml,rl) >= prolongation_order_time+1); - tl2s.resize(prolongation_order_time+1); - for (int i=0; i<=prolongation_order_time; ++i) tl2s.AT(i) = i; - transfer_from (state, - tl ,rl ,c,ml, - & dh::dboxes::fast_ref_prol_recv, - & dh::dboxes::fast_ref_prol_send, - tl2s,rl-1, ml, - time); - timer.stop (0); -} - -// Prolongate a refinement level -void -ggf:: ref_prolongate_all (comm_state & state, int const tl, int const rl, int const ml, CCTK_REAL const time) @@ -635,85 +446,6 @@ ref_prolongate_all (comm_state & state, -// Transfer regions -void -ggf:: -transfer_from (comm_state & state, - int const tl1, int const rl1, int const c1, int const ml1, - pvect const dh::dboxes::* recvs, - pvect const dh::dboxes::* sends, - vector<int> const & tl2s, int const rl2, int const ml2, - CCTK_REAL const & time, - mdata * const srcstorage_) -{ - assert (rl1>=0 and rl1<h.reflevels()); - assert (c1>=0 and c1<h.components(rl1)); - assert (ml1>=0 and ml1<h.mglevels()); - assert (tl1>=0 and tl1<timelevels(ml1,rl1)); - - pvect const & precvs = d.boxes.AT(ml1).AT(rl1).AT(c1).*recvs; - pvect const & psends = d.boxes.AT(ml1).AT(rl1).AT(c1).*sends; - assert (precvs.size() == psends.size()); - - // Return early if this communication does not concern us - if (precvs.empty()) return; - - mdata & srcstorage = srcstorage_ ? * srcstorage_ : storage; - - if (not precvs.empty()) { - // Check only when *recvs is not empty - assert ( ml2<(int)srcstorage.size()); - assert (rl2>=0 and rl2<(int)srcstorage.AT(ml2).size()); - for (size_t i = 0; i < tl2s.size(); ++ i) { - int const tl2 = tl2s.AT(i); - assert (tl2>=0 and tl2<(int)srcstorage.AT(ml2).AT(rl2).AT(0).size()); - } - } - - static Timer total ("transfer_from"); - total.start (); - - // Interpolation orders - assert (transport_operator != op_none); - int const pos = - transport_operator == op_copy ? 0 : d.prolongation_order_space; - int const pot = - transport_operator == op_copy ? 0 : prolongation_order_time; - - // Source and destination data - gdata * const dst = storage.AT(ml1).AT(rl1).AT(c1).AT(tl1); - cdata const & srcs = srcstorage.AT(ml2).AT(rl2); - vector<const gdata*> gsrcs(tl2s.size()); - - // Set up source times - vector<CCTK_REAL> times(tl2s.size()); - for (size_t i=0; i<tl2s.size(); ++i) { - assert (tl2s.AT(i)>=0 and tl2s.AT(i)<timelevels(ml2,rl2)); - for (size_t j=0; j<i; ++j) { - assert (tl2s.AT(i) != tl2s.AT(j)); - } - times.AT(i) = t.time(tl2s.AT(i),rl2,ml2); - } - - // Walk all regions - for (pvect::const_iterator iprecv=precvs.begin(), ipsend=psends.begin(); - iprecv!=precvs.end(); ++ iprecv, ++ ipsend) - { - pseudoregion const & precv = * iprecv; - pseudoregion const & psend = * ipsend; - ibbox const & recv = precv.extent; - ibbox const & send = psend.extent; - int const c2 = precv.processor; - assert (psend.processor == c2); - for (int i=0; i<(int)gsrcs.size(); ++i) { - gsrcs.AT(i) = srcs.AT(c2).AT(tl2s.AT(i)); - } - dst->transfer_from (state, gsrcs, times, recv, send, time, pos, pot); - } - - total.stop (0); -} - // Transfer regions of all components void ggf:: |