Skip to content

Change some nested foralls to for/foralls in HistogramMsg - #4180

Merged
ajpotts merged 1 commit into
Bears-R-Us:masterfrom
e-kayrakli:histogram-less-foralls
Mar 17, 2025
Merged

ajpotts merged 1 commit into
Bears-R-Us:masterfrom
e-kayrakli:histogram-less-foralls

Conversation

@e-kayrakli

Copy link
Copy Markdown
Contributor

This PR is to assist #4176.

That PR makes toSymEntry a throwing function. Unfortunately, in the histogram code, there are some nested foralls which are subject to an existing bug in the Chapel compiler that gets exposed by making toSymEntry a throwing function. This PR adjusts the histogram code to avoid that bug.

In general, the change here shouldn't be seen as a workaround, although the implementation could still be less than ideal. When you have nested foralls, in almost all cases, the outer one will grab all the cores in the system, forcing the inner one to be sequential one. Where this PR makes changes, it feels way more important for the inner loop to execute in parallel compared to the outer one. Therefore, I expect the change here to be an improvement for performance as well.

@ajpotts ajpotts left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@ajpotts
ajpotts added this pull request to the merge queue Mar 17, 2025
Merged via the queue into Bears-R-Us:master with commit df3ddf8 Mar 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants