diff --git a/src/vt/datarep/dr.impl.h b/src/vt/datarep/dr.impl.h index 26e9161afc..76a92a60a2 100644 --- a/src/vt/datarep/dr.impl.h +++ b/src/vt/datarep/dr.impl.h @@ -59,7 +59,7 @@ Reader DataReplicator::makeReader(DataRepIDType handle) { "makeReader: handle_id={}\n", handle ); - return Reader{typename Reader::READER_CONSTRUCT_TAG{}, handle}; + return Reader{handle}; } template @@ -92,6 +92,23 @@ DR DataReplicator::makeIndexedHandle( return DR{TagType{}, proxy_bits, index, tag}; } +template +Reader DataReplicator::makeIndexedReader( + ProxyType proxy, TagType tag +) { + using IndexType = typename ProxyType::IndexType; + + auto proxy_bits = proxy.getCollectionProxy(); + auto index = proxy.getElementProxy().getIndex(); + vt_debug_print( + normal, gen, + "makeIndexedReader: proxy={:x}, index={}, tag={}\n", + proxy_bits, index, tag + ); + + return Reader{proxy_bits, index, tag}; +} + template void DataReplicator::publishVersion( detail::DR_Base dr_base, DataVersionType version, T&& data @@ -195,13 +212,23 @@ bool DataReplicator::requestData( "requestData: handle_id={} remote request\n", handle ); waiting_[handle].push_back(reader); + auto tr = static_cast*>(reader); using MsgType = detail::DataRequestMsg; auto const this_node = theContext()->getNode(); auto msg = makeMessage(dr_base, this_node, version); - theLocMan()->dataRep->routeMsgHandler>( - handle, getHomeNode(handle), msg.get() - ); + if (tr->isProxy()) { + // auto const proxy_bits = tr->getHandleID(); + // auto const idx = tr->getIndex(); + // auto lm = theLocMan()->getCollectionLM(proxy); + vtAssert(false, "Unimplemented"); + return false; + } else { + auto lm = theLocMan()->dataRep.get(); + lm->routeMsgHandler>( + handle, getHomeNode(handle), msg.get() + ); + } return false; } } diff --git a/src/vt/datarep/reader.h b/src/vt/datarep/reader.h index ff0ebdef3b..aafe1f2201 100644 --- a/src/vt/datarep/reader.h +++ b/src/vt/datarep/reader.h @@ -52,6 +52,7 @@ namespace vt { namespace datarep { template struct Reader : detail::DR_Base { + Reader() = default; explicit Reader(DataRepIDType in_handle) : detail::DR_Base(in_handle) { }