Skip to content

Commit

Permalink
comms/rankScatter: replace shallowCopy with move for gcArc/gcOrc
Browse files Browse the repository at this point in the history
  • Loading branch information
jxy committed Sep 28, 2022
1 parent bbf72e9 commit bc539e4
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/comms/rankScatter.nim
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,16 @@ proc exchange[T](desc: var seq[RankScatterDescriptor2[T]], comm: auto,

if rrank > rank:
newdesc.add rmsg
shallowCopy desc, newdesc
when defined(gcArc) or defined(gcOrc):
desc = move newdesc
else:
shallowCopy desc, newdesc
else:
rmsg.add newdesc
shallowCopy desc, rmsg
when defined(gcArc) or defined(gcOrc):
desc = move rmsg
else:
shallowCopy desc, rmsg

proc scatter*[T](desc0: RankScatterSeq[T], comm: auto): RankScatterSeq[T] =
let myrank = comm.commrank
Expand Down

0 comments on commit bc539e4

Please sign in to comment.