Skip to content

Commit 6e89d84

Browse files
author
Edgar Solomonik
committed
disable fast slice when tensors are not mapped to all processors in attempt to fix (#125)
1 parent 36b1f6d commit 6e89d84

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/tensor/untyped_tensor.cxx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1028,7 +1028,15 @@ namespace CTF_int {
10281028
bool tsr_has_sym = false;
10291029
bool tsr_has_virt = false;
10301030

1031+
int topo_dims_A = tsr_A->topo->order;
1032+
int topo_dims_B = tsr_B->topo->order;
10311033
for (int i=0; i<this->order; i++){
1034+
if (tsr_A->edge_map[i].type == PHYSICAL_MAP){
1035+
topo_dims_A--;
1036+
}
1037+
if (tsr_B->edge_map[i].type == PHYSICAL_MAP){
1038+
topo_dims_B--;
1039+
}
10321040
if (A->sym[i] != NS || this->sym[i] != NS)
10331041
tsr_has_sym = true;
10341042
if (A->edge_map[i].type == VIRTUAL_MAP || (A->edge_map[i].has_child && A->edge_map[i].child->type == VIRTUAL_MAP)){
@@ -1040,7 +1048,7 @@ namespace CTF_int {
10401048
}
10411049
int nvirt_A = tsr_A->calc_nvirt();
10421050
int nvirt_B = tsr_B->calc_nvirt();
1043-
if (tsr_B->wrld->np == tsr_A->wrld->np && !tsr_has_sym && !this->is_sparse && !A->is_sparse && nvirt_A == 1 && nvirt_B == 1 && !tsr_has_virt){
1051+
if (tsr_B->wrld->np == tsr_A->wrld->np && !tsr_has_sym && !this->is_sparse && !A->is_sparse && nvirt_A == 1 && nvirt_B == 1 && !tsr_has_virt && topo_dims_A ==0 && topo_dims_B == 0){
10441052
push_slice(this, offsets_B, ends_B, beta, A, offsets_A, ends_A, alpha);
10451053
TAU_FSTOP(slice);
10461054
return;

0 commit comments

Comments
 (0)