diff --git a/empi/tensor.go b/empi/tensor.go index 0a7d7fa..cee878c 100644 --- a/empi/tensor.go +++ b/empi/tensor.go @@ -108,6 +108,9 @@ func GatherTensorRowsString(dest, src *etensor.String, comm *mpi.Comm) error { for _, l := range dln { mxlen = ints.MaxInt(mxlen, l) } + if mxlen == 0 { + return nil // nothing to transfer + } sdt := make([]byte, ssz*mxlen) ddt := make([]byte, dsz*mxlen) idx := 0