Skip to content

Commit

Permalink
Merge branch 'apriakhin/fix-cuda-gather' into 'master'
Browse files Browse the repository at this point in the history
Realm: pass indirection only on appropriate side of the transfer graph

See merge request StanfordLegion/legion!1150
  • Loading branch information
apryakhin committed Mar 20, 2024
2 parents 7d57a58 + c0d1ab0 commit 4b0e746
Showing 1 changed file with 22 additions and 6 deletions.
28 changes: 22 additions & 6 deletions runtime/realm/transfer/transfer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3095,6 +3095,9 @@ namespace Realm {
ChannelCopyInfo copy_info = channel_copy_info;
copy_info.dst_mem = partials[i].ib_mem;
copy_info.is_direct = false;
if(channel_copy_info.is_scatter) {
copy_info.ind_mem = Memory::NO_MEMORY;
}
if(best_channel_for_mem_pair(copy_info,
serdez_id, 0 /*no dst serdez*/,
0 /*no redop on not-last hops*/,
Expand Down Expand Up @@ -3134,6 +3137,7 @@ namespace Realm {
ChannelCopyInfo copy_info = channel_copy_info;
copy_info.src_mem = partials[src_idx].ib_mem;
copy_info.dst_mem = partials[dst_idx].ib_mem;
copy_info.ind_mem = Memory::NO_MEMORY;
copy_info.is_direct = false;
if(best_channel_for_mem_pair(copy_info,
0, 0, 0, // no serdez or redop on interhops
Expand Down Expand Up @@ -3178,6 +3182,9 @@ namespace Realm {
XferDesKind kind;
ChannelCopyInfo copy_info = channel_copy_info;
copy_info.src_mem = partials[i].ib_mem;
if(!channel_copy_info.is_scatter) {
copy_info.ind_mem = Memory::NO_MEMORY;
}
copy_info.is_direct = false;
if(best_channel_for_mem_pair(copy_info,
0 /*no src serdez*/, serdez_id, redop_id,
Expand Down Expand Up @@ -4922,9 +4929,11 @@ namespace Realm {

for(size_t i = 0; i < graph.ib_edges.size(); i++) {
log_xplan.debug() << "analysis: plan=" << (void *)this << " ibs[" << i
<< "]: memory=" << graph.ib_edges[i].memory
<< "]: memory=" << graph.ib_edges[i].memory << ":"
<< graph.ib_edges[i].memory.kind()
<< " size=" << graph.ib_edges[i].size;
}

if(!graph.ib_edges.empty()) {
log_xplan.debug() << "analysis: plan=" << (void *)this
<< " ib_alloc=" << PrettyVector<unsigned>(graph.ib_alloc_order);
Expand Down Expand Up @@ -5208,17 +5217,24 @@ namespace Realm {
create_xds();
}

std::ostream& operator<<(std::ostream& os, const TransferGraph::XDTemplate::IO& io)
std::ostream &operator<<(std::ostream &os, const TransferGraph::XDTemplate::IO &io)
{
switch(io.iotype) {
case TransferGraph::XDTemplate::IO_INST:
os << "inst(" << io.inst.inst << "," << io.inst.fld_start << "+" << io.inst.fld_count << ")"; break;
os << "inst(" << io.inst.inst << ":" << io.inst.inst.get_location().kind() << ","
<< io.inst.fld_start << "+" << io.inst.fld_count << ")";
break;
case TransferGraph::XDTemplate::IO_INDIRECT_INST:
os << "ind(" << io.indirect.ind_idx << "," << io.indirect.port << "," << io.indirect.inst << "," << io.indirect.fld_start << "+" << io.indirect.fld_count << ")"; break;
os << "ind(" << io.indirect.ind_idx << "," << io.indirect.port << ","
<< io.indirect.inst << ":" << io.indirect.inst.get_location().kind() << ","
<< io.indirect.fld_start << "+" << io.indirect.fld_count << ")";
break;
case TransferGraph::XDTemplate::IO_EDGE:
os << "edge(" << io.edge << ")"; break;
os << "edge(" << io.edge << ")";
break;
case TransferGraph::XDTemplate::IO_FILL_DATA:
os << "fill(" << io.fill.fill_start << "+" << io.fill.fill_size << ")"; break;
os << "fill(" << io.fill.fill_start << "+" << io.fill.fill_size << ")";
break;
default:
assert(0);
}
Expand Down

0 comments on commit 4b0e746

Please sign in to comment.