Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • sac2c sac2c
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 394
    • Issues 394
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 15
    • Merge requests 15
  • Deployments
    • Deployments
    • Releases
  • Wiki
    • Wiki
  • External wiki
    • External wiki
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • sac-group
  • sac2csac2c
  • Merge requests
  • !129

Fix mt fold sbs

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Sven-Bodo Scholz requested to merge sbs/sac2c:fix-mt-fold-sbs into develop Nov 06, 2020
  • Overview 7
  • Commits 7
  • Changes 12

This fixes the long standing non-scalar mt-fold bug. The problem was that we in general try to reuse the neutral element within the folding. While this is desirable in the sequential case it cannot be done in the parallel case. What we did was to simply create an on-stack dummy descriptor for all arguments of the spmd function, including the neutral element. We did not bother to modify the RC of those arguments since we assumed that the RC would be done in a way that keeps all relatively free variables alive. Reusing the neutral element breaks with this invariant! So the first thing I did was to set the RC of the dummy RC to 2! That way, reuse within the With-loop has become impossible. While this solves the segfault problem, it also means that the neutral element that is expected to be consumed within the with-loop exactly once, now was not consumed any more! The solution to this problem is a dec_rc_free on the neutral element AFTER the call to the spmd function!

Besides this fix I added tests specifically for testing against the non-scalar fold with loop and the possible space leak.

I also did a major brushing of the spmd function creation phase, mainly inserting a large comment on what the phase does and a sketch on how it is implemented.

Edited Nov 08, 2020 by Sven-Bodo Scholz
Assignee
Assign to
Reviewer
Request review from
Time tracking
Source branch: fix-mt-fold-sbs